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

// --- FUN_005f000d at 0x005F000D (size: 344) ---


undefined4 __fastcall FUN_005f000d(int *param_1)



{

  int iVar1;

  undefined4 uVar2;

  uint uVar3;

  int iVar4;

  uint uVar5;

  undefined4 *puVar6;

  undefined4 *puVar7;

  undefined4 *puVar8;

  undefined4 *puVar9;

  undefined4 *puVar10;

  uint local_10;

  undefined4 *local_c;

  uint local_8;

  

  iVar4 = *param_1;

  if (((*(uint *)(iVar4 + 0x48) | *(uint *)(iVar4 + 0x44) | *(uint *)(iVar4 + 0x3c) |

       *(uint *)(iVar4 + 0x40)) & 3) != 0) {

    return 0x80004005;

  }

  iVar1 = param_1[1];

  if (((*(uint *)(iVar1 + 0x48) | *(uint *)(iVar1 + 0x44) | *(uint *)(iVar1 + 0x40) |

       *(uint *)(iVar1 + 0x3c)) & 3) == 0) {

    iVar1 = *(int *)(param_1[1] + 4);

    if (iVar1 == 0x31545844) {

      local_8 = 8;

    }

    else {

      if ((((iVar1 != 0x32545844) && (iVar1 != 0x33545844)) && (iVar1 != 0x34545844)) &&

         (iVar1 != 0x35545844)) goto LAB_005f0052;

      local_8 = 0x10;

    }

    iVar1 = param_1[1];

    uVar5 = (*(uint *)(iVar1 + 0x68) >> 2) * local_8;

    local_10 = 0;

    puVar6 = (undefined4 *)

             ((*(uint *)(iVar1 + 0x40) >> 2) * *(int *)(iVar1 + 0x60) +

              *(int *)(iVar1 + 100) * *(int *)(iVar1 + 0x4c) +

              (*(uint *)(iVar1 + 0x3c) >> 2) * local_8 + *(int *)(iVar1 + 0x20));

    local_c = (undefined4 *)

              ((*(uint *)(iVar4 + 0x40) >> 2) * *(int *)(iVar4 + 0x60) +

               *(int *)(iVar4 + 100) * *(int *)(iVar4 + 0x4c) +

               (*(uint *)(iVar4 + 0x3c) >> 2) * local_8 + *(int *)(iVar4 + 0x20));

    if (*(int *)(param_1[1] + 0x70) != 0) {

      uVar3 = *(uint *)(param_1[1] + 0x6c);

      do {

        local_8 = 0;

        puVar8 = local_c;

        puVar10 = puVar6;

        if (uVar3 != 0) {

          do {

            local_8 = local_8 + 4;

            puVar7 = puVar8;

            puVar9 = puVar10;

            for (uVar3 = uVar5 >> 2; uVar3 != 0; uVar3 = uVar3 - 1) {

              *puVar9 = *puVar7;

              puVar7 = puVar7 + 1;

              puVar9 = puVar9 + 1;

            }

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

              *(undefined1 *)puVar9 = *(undefined1 *)puVar7;

              puVar7 = (undefined4 *)((int)puVar7 + 1);

              puVar9 = (undefined4 *)((int)puVar9 + 1);

            }

            puVar10 = (undefined4 *)((int)puVar10 + *(int *)(param_1[1] + 0x60));

            puVar8 = (undefined4 *)((int)puVar8 + *(int *)(*param_1 + 0x60));

            uVar3 = *(uint *)(param_1[1] + 0x6c);

          } while (local_8 < uVar3);

        }

        local_c = (undefined4 *)((int)local_c + *(int *)(*param_1 + 100));

        puVar6 = (undefined4 *)((int)puVar6 + *(int *)(param_1[1] + 100));

        local_10 = local_10 + 1;

      } while (local_10 < *(uint *)(param_1[1] + 0x70));

    }

    uVar2 = 0;

  }

  else {

LAB_005f0052:

    uVar2 = 0x80004005;

  }

  return uVar2;

}





// --- FUN_005f0165 at 0x005F0165 (size: 298) ---


undefined4 FUN_005f0165(uint *param_1,uint param_2,int param_3,uint param_4,int param_5,int param_6)



{

  uint uVar1;

  uint uVar2;

  uint uVar3;

  uint uVar4;

  uint uVar5;

  uint *puVar6;

  int local_14;

  uint *local_8;

  

  uVar5 = param_4 * param_5 + param_2;

  if (param_2 < uVar5) {

    param_4 = param_2 + param_3 * 4;

    do {

      local_8 = param_1;

      if (param_2 < param_4) {

        puVar6 = (uint *)(param_2 + 4);

        local_14 = ((param_4 - param_2) - 1 >> 3) + 1;

        do {

          uVar1 = *(uint *)((int)puVar6 + param_5);

          uVar2 = *(uint *)(param_5 + -4 + (int)puVar6);

          uVar3 = *puVar6;

          uVar4 = puVar6[-1];

          *local_8 = ((uVar4 >> 2 & 0xffc03fc0) + (uVar2 >> 2 & 0xffc03fc0) +

                      (uVar1 >> 2 & 0xffc03fc0) + -0x7fff80 + (uVar3 >> 2 & 0xffc03fc0) ^

                     (uVar4 & 0xff00ff) + (uVar2 & 0xff00ff) + (uVar1 & 0xff00ff) + 0x20002 +

                     (uVar3 & 0xff00ff) >> 2) & 0xff00ff ^

                     (uint)("Mouse-Look" +

                           (uVar3 >> 2 & 0x3fc03fc0) +

                           (uVar4 >> 2 & 0x3fc03fc0) + (uVar2 >> 2 & 0x3fc03fc0) +

                           (uVar1 >> 2 & 0x3fc03fc0) + 4);

          puVar6 = puVar6 + 2;

          local_14 = local_14 + -1;

          local_8 = local_8 + 1;

        } while (local_14 != 0);

      }

      param_1 = (uint *)((int)param_1 + param_6);

      param_4 = param_4 + param_5 * 2;

      param_2 = param_2 + param_5 * 2;

    } while (param_2 < uVar5);

  }

  return 0;

}





// --- FUN_005f028f at 0x005F028F (size: 34) ---


void __fastcall FUN_005f028f(int *param_1)



{

  int iVar1;

  

  iVar1 = *param_1;

  (*(code *)PTR_FUN_00825c6c)

            (*(undefined4 *)(param_1[1] + 0x20),*(undefined4 *)(iVar1 + 0x20),

             *(undefined4 *)(iVar1 + 0x68),*(undefined4 *)(iVar1 + 0x6c),

             *(undefined4 *)(iVar1 + 0x60),*(undefined4 *)(param_1[1] + 0x60));

  return;

}





// --- FUN_005f02b1 at 0x005F02B1 (size: 236) ---


undefined4

FUN_005f02b1(uint *param_1,uint param_2,uint *param_3,uint param_4,int param_5,int param_6)



{

  uint *puVar1;

  uint *puVar2;

  uint uVar3;

  uint uVar4;

  uint uVar5;

  uint *puVar6;

  int local_10;

  

  uVar5 = param_4 * param_5 + param_2;

  if (param_2 < uVar5) {

    param_4 = param_2 + (int)param_3 * 4;

    do {

      param_3 = param_1;

      if (param_2 < param_4) {

        local_10 = ((param_4 - param_2) - 1 >> 3) + 1;

        puVar6 = (uint *)(param_2 + 4);

        do {

          puVar2 = (uint *)((int)puVar6 + param_5);

          uVar3 = *puVar6;

          uVar4 = *(uint *)(param_5 + -4 + (int)puVar6);

          puVar1 = puVar6 + -1;

          puVar6 = puVar6 + 2;

          local_10 = local_10 + -1;

          *param_3 = ((*puVar1 & 0xff00ff) + (uVar4 & 0xff00ff) + (*puVar2 & 0xff00ff) + 0x20002 +

                      (uVar3 & 0xff00ff) & 0x3fc03fc |

                     (*puVar1 & 0xff00) + (uVar4 & 0xff00) + (*puVar2 & 0xff00) + 0x200 +

                     (uVar3 & 0xff00) & 0x3fc00) >> 2;

          param_3 = param_3 + 1;

        } while (local_10 != 0);

      }

      param_1 = (uint *)((int)param_1 + param_6);

      param_4 = param_4 + param_5 * 2;

      param_2 = param_2 + param_5 * 2;

    } while (param_2 < uVar5);

  }

  return 0;

}





// --- FUN_005f039d at 0x005F039D (size: 282) ---


undefined4

FUN_005f039d(undefined8 *param_1,undefined8 *param_2,uint param_3,int param_4,int param_5,

            int param_6)



{

  undefined8 uVar1;

  undefined8 uVar2;

  short sVar3;

  short sVar4;

  short sVar5;

  short sVar6;

  short sVar7;

  short sVar8;

  short sVar9;

  short sVar10;

  undefined8 *puVar11;

  undefined4 uVar12;

  undefined8 *puVar13;

  undefined8 *puVar14;

  undefined8 *puVar15;

  undefined8 uVar16;

  undefined8 uVar17;

  

  if ((param_3 & 3) == 0) {

    puVar13 = (undefined8 *)(param_4 * param_5 + (int)param_2);

    for (; (int)param_2 < (int)puVar13; param_2 = (undefined8 *)((int)param_2 + param_5 * 2)) {

      puVar14 = (undefined8 *)((int)param_2 + param_5);

      puVar11 = param_1;

      puVar15 = param_2;

      while ((int)puVar15 < (int)((int)param_2 + param_3 * 4)) {

        uVar16 = *puVar15;

        uVar17 = *puVar14;

        uVar1 = puVar15[1];

        uVar2 = puVar14[1];

        puVar15 = puVar15 + 2;

        puVar14 = puVar14 + 2;

        uVar16 = psraw(CONCAT26((ushort)(byte)((ulonglong)uVar16 >> 0x18) +

                                (ushort)(byte)((ulonglong)uVar16 >> 0x38) +

                                (ushort)(byte)((ulonglong)uVar17 >> 0x18) +

                                (ushort)(byte)((ulonglong)uVar17 >> 0x38) + 2,

                                CONCAT24((ushort)(byte)((ulonglong)uVar16 >> 0x10) +

                                         (ushort)(byte)((ulonglong)uVar16 >> 0x30) +

                                         (ushort)(byte)((ulonglong)uVar17 >> 0x10) +

                                         (ushort)(byte)((ulonglong)uVar17 >> 0x30) + 2,

                                         CONCAT22((ushort)(byte)((ulonglong)uVar16 >> 8) +

                                                  (ushort)(byte)((ulonglong)uVar16 >> 0x28) +

                                                  (ushort)(byte)((ulonglong)uVar17 >> 8) +

                                                  (ushort)(byte)((ulonglong)uVar17 >> 0x28) + 2,

                                                  (ushort)(byte)uVar16 +

                                                  (ushort)(byte)((ulonglong)uVar16 >> 0x20) +

                                                  (ushort)(byte)uVar17 +

                                                  (ushort)(byte)((ulonglong)uVar17 >> 0x20) + 2))),2

                      );

        uVar17 = psraw(CONCAT26((ushort)(byte)((ulonglong)uVar1 >> 0x18) +

                                (ushort)(byte)((ulonglong)uVar1 >> 0x38) +

                                (ushort)(byte)((ulonglong)uVar2 >> 0x18) +

                                (ushort)(byte)((ulonglong)uVar2 >> 0x38) + 2,

                                CONCAT24((ushort)(byte)((ulonglong)uVar1 >> 0x10) +

                                         (ushort)(byte)((ulonglong)uVar1 >> 0x30) +

                                         (ushort)(byte)((ulonglong)uVar2 >> 0x10) +

                                         (ushort)(byte)((ulonglong)uVar2 >> 0x30) + 2,

                                         CONCAT22((ushort)(byte)((ulonglong)uVar1 >> 8) +

                                                  (ushort)(byte)((ulonglong)uVar1 >> 0x28) +

                                                  (ushort)(byte)((ulonglong)uVar2 >> 8) +

                                                  (ushort)(byte)((ulonglong)uVar2 >> 0x28) + 2,

                                                  (ushort)(byte)uVar1 +

                                                  (ushort)(byte)((ulonglong)uVar1 >> 0x20) +

                                                  (ushort)(byte)uVar2 +

                                                  (ushort)(byte)((ulonglong)uVar2 >> 0x20) + 2))),2)

        ;

        sVar3 = (short)uVar16;

        sVar4 = (short)((ulonglong)uVar16 >> 0x10);

        sVar5 = (short)((ulonglong)uVar16 >> 0x20);

        sVar6 = (short)((ulonglong)uVar16 >> 0x30);

        sVar7 = (short)uVar17;

        sVar8 = (short)((ulonglong)uVar17 >> 0x10);

        sVar9 = (short)((ulonglong)uVar17 >> 0x20);

        sVar10 = (short)((ulonglong)uVar17 >> 0x30);

        *puVar11 = CONCAT17((0 < sVar10) * (sVar10 < 0x100) * (char)((ulonglong)uVar17 >> 0x30) -

                            (0xff < sVar10),

                            CONCAT16((0 < sVar9) * (sVar9 < 0x100) *

                                     (char)((ulonglong)uVar17 >> 0x20) - (0xff < sVar9),

                                     CONCAT15((0 < sVar8) * (sVar8 < 0x100) *

                                              (char)((ulonglong)uVar17 >> 0x10) - (0xff < sVar8),

                                              CONCAT14((0 < sVar7) * (sVar7 < 0x100) * (char)uVar17

                                                       - (0xff < sVar7),

                                                       CONCAT13((0 < sVar6) * (sVar6 < 0x100) *

                                                                (char)((ulonglong)uVar16 >> 0x30) -

                                                                (0xff < sVar6),

                                                                CONCAT12((0 < sVar5) *

                                                                         (sVar5 < 0x100) *

                                                                         (char)((ulonglong)uVar16 >>

                                                                               0x20) -

                                                                         (0xff < sVar5),

                                                                         CONCAT11((0 < sVar4) *

                                                                                  (sVar4 < 0x100) *

                                                                                  (char)((ulonglong)

                                                                                         uVar16 >>

                                                                                        0x10) -

                                                                                  (0xff < sVar4),

                                                                                  (0 < sVar3) *

                                                                                  (sVar3 < 0x100) *

                                                                                  (char)uVar16 -

                                                                                  (0xff < sVar3)))))

                                             )));

        puVar11 = puVar11 + 1;

      }

      param_1 = (undefined8 *)((int)param_1 + param_6);

    }

    uVar12 = 0;

  }

  else {

    uVar12 = FUN_005f0165(param_1,param_2,param_3,param_4,param_5,param_6);

  }

  return uVar12;

}





// --- FUN_005f04b7 at 0x005F04B7 (size: 58) ---


void FUN_005f04b7(void)



{

  int iVar1;

  

  iVar1 = FUN_005ff68e();

  if (iVar1 == 0) {

    PTR_FUN_00825c6c = FUN_005f0165;

    PTR_FUN_00825c70 = FUN_005f02b1;

  }

  else {

    PTR_FUN_00825c6c = FUN_005f039d;

    PTR_FUN_00825c70 = FUN_005f039d;

  }

                    /* WARNING: Could not recover jumptable at 0x005f04eb. Too many branches */

                    /* WARNING: Treating indirect jump as call */

  (*(code *)PTR_FUN_00825c6c)();

  return;

}





// --- FUN_005f04f1 at 0x005F04F1 (size: 49) ---


void FUN_005f04f1(void)



{

  int iVar1;

  code *UNRECOVERED_JUMPTABLE;

  

  iVar1 = FUN_005ff68e();

  if (iVar1 == 0) {

    PTR_FUN_00825c6c = FUN_005f0165;

    UNRECOVERED_JUMPTABLE = FUN_005f02b1;

  }

  else {

    UNRECOVERED_JUMPTABLE = FUN_005f039d;

    PTR_FUN_00825c6c = FUN_005f039d;

  }

  PTR_FUN_00825c70 = UNRECOVERED_JUMPTABLE;

                    /* WARNING: Could not recover jumptable at 0x005f0520. Too many branches */

                    /* WARNING: Treating indirect jump as call */

  (*UNRECOVERED_JUMPTABLE)();

  return;

}





// --- FUN_005f0522 at 0x005F0522 (size: 34) ---


void __fastcall FUN_005f0522(int *param_1)



{

  int iVar1;

  

  iVar1 = *param_1;

  (*(code *)PTR_FUN_00825c70)

            (*(undefined4 *)(param_1[1] + 0x20),*(undefined4 *)(iVar1 + 0x20),

             *(undefined4 *)(iVar1 + 0x68),*(undefined4 *)(iVar1 + 0x6c),

             *(undefined4 *)(iVar1 + 0x60),*(undefined4 *)(param_1[1] + 0x60));

  return;

}





// --- FUN_005f0544 at 0x005F0544 (size: 308) ---


undefined4 __fastcall FUN_005f0544(int *param_1)



{

  ushort uVar1;

  ushort uVar2;

  ushort uVar3;

  int iVar4;

  ushort *puVar5;

  int iVar6;

  ushort *puVar7;

  uint uVar8;

  ushort *puVar9;

  ushort *puVar10;

  ushort *puVar11;

  ushort *puVar12;

  

  iVar4 = *param_1;

  puVar9 = *(ushort **)(param_1[1] + 0x20);

  puVar5 = *(ushort **)(iVar4 + 0x20);

  puVar11 = (ushort *)(*(int *)(iVar4 + 0x6c) * *(int *)(iVar4 + 0x60) + (int)puVar5);

  for (; puVar5 < puVar11; puVar5 = puVar5 + *(int *)(iVar4 + 0x60)) {

    iVar6 = *(int *)(iVar4 + 0x68);

    puVar12 = (ushort *)(*(int *)(iVar4 + 0x60) + (int)puVar5);

    puVar7 = puVar9;

    for (puVar10 = puVar5; puVar10 < puVar5 + iVar6; puVar10 = puVar10 + 2) {

      uVar8 = (uint)*puVar12;

      uVar1 = puVar12[1];

      uVar2 = puVar10[1];

      uVar3 = *puVar10;

      *puVar7 = ((ushort)((uint)(uVar1 & 0xf81f) + (uint)(uVar3 & 0xf81f) + (uVar8 & 0xfffff81f) +

                          0x1002 + (uint)(uVar2 & 0xf81f) >> 2) ^

                (ushort)((uVar1 & 0xffff07e0) + (uVar3 & 0xffff07e0) + (uVar8 & 0xffff07e0) + 0x40 +

                         (uVar2 & 0xffff07e0) >> 2)) & 0x7e0 ^

                (ushort)((uVar1 & 0xf81f) + (uVar3 & 0xf81f) + (uVar8 & 0xf81f) + 0x1002 +

                         (uVar2 & 0xf81f) >> 2);

      puVar12 = puVar12 + 2;

      puVar7 = puVar7 + 1;

    }

    puVar9 = (ushort *)((int)puVar9 + *(int *)(param_1[1] + 0x60));

    iVar4 = *param_1;

  }

  return 0;

}





// --- FUN_005f0678 at 0x005F0678 (size: 261) ---


undefined4 __fastcall FUN_005f0678(int *param_1)



{

  ushort *puVar1;

  ushort uVar2;

  int iVar3;

  ushort *puVar4;

  int iVar5;

  ushort *puVar6;

  ushort *puVar7;

  ushort *puVar8;

  ushort *puVar9;

  ushort *puVar10;

  

  iVar3 = *param_1;

  puVar7 = *(ushort **)(param_1[1] + 0x20);

  puVar4 = *(ushort **)(iVar3 + 0x20);

  puVar9 = (ushort *)(*(int *)(iVar3 + 0x6c) * *(int *)(iVar3 + 0x60) + (int)puVar4);

  for (; puVar4 < puVar9; puVar4 = puVar4 + *(int *)(iVar3 + 0x60)) {

    iVar5 = *(int *)(iVar3 + 0x68);

    puVar10 = (ushort *)(*(int *)(iVar3 + 0x60) + (int)puVar4);

    puVar6 = puVar7;

    for (puVar8 = puVar4; puVar8 < puVar4 + iVar5; puVar8 = puVar8 + 2) {

      uVar2 = *puVar10;

      puVar1 = puVar10 + 1;

      puVar10 = puVar10 + 2;

      *puVar6 = (ushort)((*puVar1 & 0xffff03e0) + (*puVar8 & 0xffff03e0) + (uVar2 & 0xffff03e0) +

                         0x40 + (puVar8[1] & 0xffff03e0) >> 2) & 0x3e0 |

                (ushort)((*puVar1 & 0x7c1f) + (*puVar8 & 0x7c1f) + (uVar2 & 0x7c1f) + 0x802 +

                         (puVar8[1] & 0x7c1f) >> 2) & 0x7c1f;

      puVar6 = puVar6 + 1;

    }

    puVar7 = (ushort *)((int)puVar7 + *(int *)(param_1[1] + 0x60));

    iVar3 = *param_1;

  }

  return 0;

}





// --- FUN_005f077d at 0x005F077D (size: 297) ---


undefined4 __fastcall FUN_005f077d(int *param_1)



{

  int iVar1;

  ushort *puVar2;

  int iVar3;

  ushort *puVar4;

  ushort *puVar5;

  uint uVar6;

  uint uVar7;

  ushort *puVar8;

  uint uVar9;

  ushort *puVar10;

  ushort *puVar11;

  uint uVar12;

  

  iVar1 = *param_1;

  puVar2 = *(ushort **)(iVar1 + 0x20);

  puVar10 = *(ushort **)(param_1[1] + 0x20);

  puVar5 = (ushort *)(*(int *)(iVar1 + 0x6c) * *(int *)(iVar1 + 0x60) + (int)puVar2);

  for (; puVar2 < puVar5; puVar2 = puVar2 + *(int *)(iVar1 + 0x60)) {

    iVar3 = *(int *)(iVar1 + 0x68);

    puVar11 = (ushort *)(*(int *)(iVar1 + 0x60) + (int)puVar2);

    puVar4 = puVar10;

    for (puVar8 = puVar2; puVar8 < puVar2 + iVar3; puVar8 = puVar8 + 2) {

      uVar6 = (uint)puVar8[1];

      uVar9 = (uint)puVar11[1];

      uVar7 = (uint)*puVar11;

      uVar12 = (uint)*puVar8;

      puVar11 = puVar11 + 2;

      *puVar4 = ((ushort)((uVar9 & 0x83e0) + (uVar12 & 0x83e0) + (uVar7 & 0x83e0) + 0x10040 +

                          (uVar6 & 0x83e0) >> 2) ^

                (ushort)((uVar9 & 0x7c1f) + (uVar12 & 0x7c1f) + (uVar7 & 0x7c1f) + 0x802 +

                         (uVar6 & 0x7c1f) >> 2)) & 0x7c1f ^

                (ushort)((uVar9 & 0x83e0) + (uVar12 & 0x83e0) + (uVar7 & 0x83e0) + 0x10040 +

                         (uVar6 & 0x83e0) >> 2);

      puVar4 = puVar4 + 1;

    }

    puVar10 = (ushort *)((int)puVar10 + *(int *)(param_1[1] + 0x60));

    iVar1 = *param_1;

  }

  return 0;

}





// --- FUN_005f08a6 at 0x005F08A6 (size: 311) ---


undefined4 __fastcall FUN_005f08a6(int *param_1)



{

  ushort uVar1;

  ushort uVar2;

  ushort uVar3;

  int iVar4;

  ushort *puVar5;

  int iVar6;

  ushort *puVar7;

  uint uVar8;

  ushort *puVar9;

  ushort *puVar10;

  ushort *puVar11;

  ushort *puVar12;

  

  iVar4 = *param_1;

  puVar9 = *(ushort **)(param_1[1] + 0x20);

  puVar5 = *(ushort **)(iVar4 + 0x20);

  puVar11 = (ushort *)(*(int *)(iVar4 + 0x6c) * *(int *)(iVar4 + 0x60) + (int)puVar5);

  for (; puVar5 < puVar11; puVar5 = puVar5 + *(int *)(iVar4 + 0x60)) {

    iVar6 = *(int *)(iVar4 + 0x68);

    puVar12 = (ushort *)(*(int *)(iVar4 + 0x60) + (int)puVar5);

    puVar7 = puVar9;

    for (puVar10 = puVar5; puVar10 < puVar5 + iVar6; puVar10 = puVar10 + 2) {

      uVar8 = (uint)*puVar12;

      uVar1 = puVar12[1];

      uVar2 = puVar10[1];

      uVar3 = *puVar10;

      *puVar7 = ((ushort)((uint)(uVar1 & 0xf0f0) + (uint)(uVar3 & 0xf0f0) + (uVar8 & 0xfffff0f0) +

                          0x2020 + (uint)(uVar2 & 0xf0f0) >> 2) ^

                (ushort)((uVar1 & 0xffff0f0f) + (uVar3 & 0xffff0f0f) + (uVar8 & 0xffff0f0f) + 0x202

                         + (uVar2 & 0xffff0f0f) >> 2)) & 0xf0f ^

                (ushort)((uVar1 & 0xf0f0) + (uVar3 & 0xf0f0) + (uVar8 & 0xf0f0) + 0x2020 +

                         (uVar2 & 0xf0f0) >> 2);

      puVar12 = puVar12 + 2;

      puVar7 = puVar7 + 1;

    }

    puVar9 = (ushort *)((int)puVar9 + *(int *)(param_1[1] + 0x60));

    iVar4 = *param_1;

  }

  return 0;

}





// --- FUN_005f09dd at 0x005F09DD (size: 286) ---


undefined4 __fastcall FUN_005f09dd(int *param_1)



{

  byte bVar1;

  byte bVar2;

  byte bVar3;

  int iVar4;

  byte *pbVar5;

  int iVar6;

  byte *pbVar7;

  uint uVar8;

  byte *pbVar9;

  byte *pbVar10;

  byte *pbVar11;

  byte *pbVar12;

  

  pbVar9 = *(byte **)(param_1[1] + 0x20);

  iVar4 = *param_1;

  pbVar5 = *(byte **)(iVar4 + 0x20);

  pbVar12 = pbVar5 + *(int *)(iVar4 + 0x6c) * *(int *)(iVar4 + 0x60);

  for (; pbVar5 < pbVar12; pbVar5 = pbVar5 + *(int *)(iVar4 + 0x60) * 2) {

    iVar6 = *(int *)(iVar4 + 0x68);

    pbVar10 = pbVar5 + *(int *)(iVar4 + 0x60);

    pbVar7 = pbVar9;

    for (pbVar11 = pbVar5; pbVar11 < pbVar5 + iVar6; pbVar11 = pbVar11 + 2) {

      uVar8 = (uint)*pbVar10;

      bVar1 = pbVar10[1];

      bVar2 = pbVar11[1];

      bVar3 = *pbVar11;

      *pbVar7 = ((byte)((bVar1 & 0x1c) + (bVar3 & 0x1c) + (uVar8 & 0x1c) + 8 + (bVar2 & 0x1c) >> 2)

                ^ (byte)((uint)(bVar1 & 0xe3) + (uint)(bVar3 & 0xe3) + (uVar8 & 0xffff00e3) + 0x42 +

                         (uint)(bVar2 & 0xe3) >> 2)) & 0x1c ^

                (byte)((uint)(bVar1 & 0xe3) + (bVar3 & 0xffff00e3) + (uVar8 & 0xffff00e3) + 0x42 +

                       (uint)(bVar2 & 0xe3) >> 2);

      pbVar10 = pbVar10 + 2;

      pbVar7 = pbVar7 + 1;

    }

    pbVar9 = pbVar9 + *(int *)(param_1[1] + 0x60);

    iVar4 = *param_1;

  }

  return 0;

}





// --- FUN_005f0afb at 0x005F0AFB (size: 140) ---


undefined4 __fastcall FUN_005f0afb(int *param_1)



{

  byte *pbVar1;

  byte *pbVar2;

  byte bVar3;

  int iVar4;

  undefined1 *puVar5;

  int iVar6;

  byte *pbVar7;

  undefined1 *puVar8;

  byte *pbVar9;

  byte *pbVar10;

  

  puVar8 = *(undefined1 **)(param_1[1] + 0x20);

  iVar6 = *param_1;

  pbVar9 = *(byte **)(iVar6 + 0x20);

  pbVar10 = pbVar9 + *(int *)(iVar6 + 0x6c) * *(int *)(iVar6 + 0x60);

  for (; pbVar9 < pbVar10; pbVar9 = pbVar9 + *(int *)(iVar6 + 0x60) * 2) {

    iVar4 = *(int *)(iVar6 + 0x68);

    pbVar7 = pbVar9 + *(int *)(iVar6 + 0x60);

    puVar5 = puVar8;

    for (pbVar2 = pbVar9; pbVar2 < pbVar9 + iVar4; pbVar2 = pbVar2 + 2) {

      pbVar1 = pbVar7 + 1;

      bVar3 = *pbVar7;

      pbVar7 = pbVar7 + 2;

      *puVar5 = (char)((uint)*pbVar1 + (uint)pbVar2[1] + (uint)bVar3 + 2 + (uint)*pbVar2 >> 2);

      puVar5 = puVar5 + 1;

    }

    puVar8 = puVar8 + *(int *)(param_1[1] + 0x60);

    iVar6 = *param_1;

  }

  return 0;

}





// --- FUN_005f0b87 at 0x005F0B87 (size: 302) ---


undefined4 __fastcall FUN_005f0b87(int *param_1)



{

  ushort uVar1;

  ushort uVar2;

  ushort uVar3;

  int iVar4;

  ushort *puVar5;

  int iVar6;

  ushort *puVar7;

  uint uVar8;

  ushort *puVar9;

  ushort *puVar10;

  ushort *puVar11;

  ushort *puVar12;

  

  puVar9 = *(ushort **)(param_1[1] + 0x20);

  iVar4 = *param_1;

  puVar5 = *(ushort **)(iVar4 + 0x20);

  puVar12 = (ushort *)(*(int *)(iVar4 + 0x6c) * *(int *)(iVar4 + 0x60) + (int)puVar5);

  for (; puVar5 < puVar12; puVar5 = puVar5 + *(int *)(iVar4 + 0x60)) {

    iVar6 = *(int *)(iVar4 + 0x68);

    puVar10 = (ushort *)(*(int *)(iVar4 + 0x60) + (int)puVar5);

    puVar7 = puVar9;

    for (puVar11 = puVar5; puVar11 < puVar5 + iVar6; puVar11 = puVar11 + 2) {

      uVar1 = puVar10[1];

      uVar8 = (uint)*puVar10;

      uVar2 = *puVar11;

      uVar3 = puVar11[1];

      *puVar7 = (byte)((byte)((uint)(uVar1 & 0xe3) + (uint)(uVar2 & 0xe3) + (uVar8 & 0xffff00e3) +

                              0x42 + (uint)(uVar3 & 0xe3) >> 2) ^

                      (byte)((uint)(uVar1 & 0xff1c) + (uVar2 & 0xffffff1c) + (uVar8 & 0xffffff1c) +

                             0x208 + (uint)(uVar3 & 0xff1c) >> 2)) & 0xe3 ^

                (ushort)((uVar1 & 0xff1c) + (uVar2 & 0xff1c) + (uVar8 & 0xff1c) + 0x208 +

                         (uVar3 & 0xff1c) >> 2);

      puVar10 = puVar10 + 2;

      puVar7 = puVar7 + 1;

    }

    puVar9 = (ushort *)((int)puVar9 + *(int *)(param_1[1] + 0x60));

    iVar4 = *param_1;

  }

  return 0;

}





// --- FUN_005f0cb5 at 0x005F0CB5 (size: 265) ---


undefined4 __fastcall FUN_005f0cb5(int *param_1)



{

  ushort *puVar1;

  ushort uVar2;

  int iVar3;

  ushort *puVar4;

  int iVar5;

  ushort *puVar6;

  ushort *puVar7;

  ushort *puVar8;

  ushort *puVar9;

  ushort *puVar10;

  

  puVar10 = *(ushort **)(param_1[1] + 0x20);

  iVar3 = *param_1;

  puVar4 = *(ushort **)(iVar3 + 0x20);

  puVar7 = (ushort *)(*(int *)(iVar3 + 0x6c) * *(int *)(iVar3 + 0x60) + (int)puVar4);

  for (; puVar4 < puVar7; puVar4 = puVar4 + *(int *)(iVar3 + 0x60)) {

    iVar5 = *(int *)(iVar3 + 0x68);

    puVar9 = (ushort *)(*(int *)(iVar3 + 0x60) + (int)puVar4);

    puVar6 = puVar10;

    for (puVar8 = puVar4; puVar8 < puVar4 + iVar5; puVar8 = puVar8 + 2) {

      puVar1 = puVar9 + 1;

      uVar2 = *puVar9;

      puVar9 = puVar9 + 2;

      *puVar6 = (ushort)((*puVar1 & 0xffff00f0) + (*puVar8 & 0xffff00f0) + (uVar2 & 0xffff00f0) +

                         0x20 + (puVar8[1] & 0xffff00f0) >> 2) & 0xf0 |

                (ushort)((*puVar1 & 0xffff0f0f) + (*puVar8 & 0xffff0f0f) + (uint)(uVar2 & 0xf0f) +

                         0x202 + (uint)(puVar8[1] & 0xf0f) >> 2) & 0xf0f;

      puVar6 = puVar6 + 1;

    }

    puVar10 = (ushort *)((int)puVar10 + *(int *)(param_1[1] + 0x60));

    iVar3 = *param_1;

  }

  return 0;

}





// --- FUN_005f0dbe at 0x005F0DBE (size: 302) ---


undefined4 __fastcall FUN_005f0dbe(int *param_1)



{

  ushort uVar1;

  ushort uVar2;

  ushort uVar3;

  int iVar4;

  ushort *puVar5;

  int iVar6;

  ushort *puVar7;

  uint uVar8;

  ushort *puVar9;

  ushort *puVar10;

  ushort *puVar11;

  ushort *puVar12;

  

  puVar9 = *(ushort **)(param_1[1] + 0x20);

  iVar4 = *param_1;

  puVar5 = *(ushort **)(iVar4 + 0x20);

  puVar12 = (ushort *)(*(int *)(iVar4 + 0x6c) * *(int *)(iVar4 + 0x60) + (int)puVar5);

  for (; puVar5 < puVar12; puVar5 = puVar5 + *(int *)(iVar4 + 0x60)) {

    iVar6 = *(int *)(iVar4 + 0x68);

    puVar10 = (ushort *)(*(int *)(iVar4 + 0x60) + (int)puVar5);

    puVar7 = puVar9;

    for (puVar11 = puVar5; puVar11 < puVar5 + iVar6; puVar11 = puVar11 + 2) {

      uVar1 = puVar10[1];

      uVar8 = (uint)*puVar10;

      uVar2 = *puVar11;

      uVar3 = puVar11[1];

      *puVar7 = (ushort)(byte)((byte)((uint)(uVar1 & 0xff) + (uint)(uVar2 & 0xff) +

                                      (uVar8 & 0xffff00ff) + 2 + (uint)(uVar3 & 0xff) >> 2) ^

                              (byte)((uint)(uVar1 & 0xff00) + (uVar2 & 0xffffff00) +

                                     (uVar8 & 0xffffff00) + 0x200 + (uint)(uVar3 & 0xff00) >> 2)) ^

                (ushort)((uVar1 & 0xff00) + (uVar2 & 0xff00) + (uVar8 & 0xff00) + 0x200 +

                         (uVar3 & 0xff00) >> 2);

      puVar10 = puVar10 + 2;

      puVar7 = puVar7 + 1;

    }

    puVar9 = (ushort *)((int)puVar9 + *(int *)(param_1[1] + 0x60));

    iVar4 = *param_1;

  }

  return 0;

}





// --- FUN_005f0eec at 0x005F0EEC (size: 286) ---


undefined4 __fastcall FUN_005f0eec(int *param_1)



{

  byte bVar1;

  byte bVar2;

  byte bVar3;

  int iVar4;

  byte *pbVar5;

  int iVar6;

  byte *pbVar7;

  uint uVar8;

  byte *pbVar9;

  byte *pbVar10;

  byte *pbVar11;

  byte *pbVar12;

  

  pbVar9 = *(byte **)(param_1[1] + 0x20);

  iVar4 = *param_1;

  pbVar5 = *(byte **)(iVar4 + 0x20);

  pbVar12 = pbVar5 + *(int *)(iVar4 + 0x6c) * *(int *)(iVar4 + 0x60);

  for (; pbVar5 < pbVar12; pbVar5 = pbVar5 + *(int *)(iVar4 + 0x60) * 2) {

    iVar6 = *(int *)(iVar4 + 0x68);

    pbVar10 = pbVar5 + *(int *)(iVar4 + 0x60);

    pbVar7 = pbVar9;

    for (pbVar11 = pbVar5; pbVar11 < pbVar5 + iVar6; pbVar11 = pbVar11 + 2) {

      uVar8 = (uint)*pbVar10;

      bVar1 = pbVar10[1];

      bVar2 = pbVar11[1];

      bVar3 = *pbVar11;

      *pbVar7 = ((byte)((bVar1 & 0xf) + (bVar3 & 0xf) + (uVar8 & 0xf) + 2 + (bVar2 & 0xf) >> 2) ^

                (byte)((uint)(bVar1 & 0xf0) + (uint)(bVar3 & 0xf0) + (uVar8 & 0xffff00f0) + 0x20 +

                       (uint)(bVar2 & 0xf0) >> 2)) & 0xf ^

                (byte)((uint)(bVar1 & 0xf0) + (bVar3 & 0xffff00f0) + (uVar8 & 0xffff00f0) + 0x20 +

                       (uint)(bVar2 & 0xf0) >> 2);

      pbVar10 = pbVar10 + 2;

      pbVar7 = pbVar7 + 1;

    }

    pbVar9 = pbVar9 + *(int *)(param_1[1] + 0x60);

    iVar4 = *param_1;

  }

  return 0;

}





// --- FUN_005f100a at 0x005F100A (size: 266) ---


undefined4 __fastcall FUN_005f100a(int *param_1)



{

  undefined4 uVar1;

  undefined4 *puVar2;

  int iVar3;

  int iVar4;

  uint uVar5;

  uint uVar6;

  undefined4 *puVar7;

  int *piVar8;

  undefined4 *puVar9;

  int iVar10;

  int *piVar11;

  undefined4 *puVar12;

  bool bVar13;

  uint local_c;

  uint local_8;

  

  iVar4 = param_1[1];

  iVar10 = *param_1;

  if ((*(int *)(iVar4 + 4) != *(int *)(iVar10 + 4)) || (*(int *)(iVar10 + 0x18) != 0)) {

    return 0x80004005;

  }

  if ((((*(int *)(iVar4 + 0x68) == *(int *)(iVar10 + 0x68)) &&

       (*(int *)(iVar4 + 0x6c) == *(int *)(iVar10 + 0x6c))) &&

      (*(int *)(iVar4 + 0x70) == *(int *)(iVar10 + 0x70))) &&

     (*(int *)(iVar4 + 0x10) == *(int *)(iVar10 + 0x10))) {

    if (*(int *)(iVar4 + 0xc) == 0) {

      uVar1 = FUN_005f000d();

      return uVar1;

    }

    if (*(int *)(iVar4 + 0x1c) != 0) {

      if (*(int **)(iVar4 + 0x38) != *(int **)(iVar10 + 0x38)) {

        iVar3 = 0x100;

        bVar13 = true;

        piVar8 = *(int **)(iVar4 + 0x38);

        piVar11 = *(int **)(iVar10 + 0x38);

        do {

          if (iVar3 == 0) break;

          iVar3 = iVar3 + -1;

          bVar13 = *piVar8 == *piVar11;

          piVar8 = piVar8 + 1;

          piVar11 = piVar11 + 1;

        } while (bVar13);

        if (!bVar13) goto LAB_005f110a;

      }

    }

    *(undefined4 *)(iVar4 + 0x10) = 0;

    *(undefined4 *)(*param_1 + 0x10) = 0;

    iVar4 = param_1[1];

    local_8 = 0;

    if (*(int *)(iVar4 + 0x70) != 0) {

      iVar10 = *param_1;

      uVar6 = *(uint *)(iVar4 + 0x6c);

      do {

        puVar2 = (undefined4 *)(*(int *)(param_1[1] + 100) * local_8 + *(int *)(param_1[1] + 0x20));

        puVar7 = (undefined4 *)(*(int *)(iVar10 + 100) * local_8 + *(int *)(iVar10 + 0x20));

        local_c = 0;

        if (uVar6 != 0) {

          do {

            uVar6 = *(uint *)(iVar4 + 0x74);

            puVar9 = puVar7;

            puVar12 = puVar2;

            for (uVar5 = uVar6 >> 2; uVar5 != 0; uVar5 = uVar5 - 1) {

              *puVar12 = *puVar9;

              puVar9 = puVar9 + 1;

              puVar12 = puVar12 + 1;

            }

            for (uVar6 = uVar6 & 3; uVar6 != 0; uVar6 = uVar6 - 1) {

              *(undefined1 *)puVar12 = *(undefined1 *)puVar9;

              puVar9 = (undefined4 *)((int)puVar9 + 1);

              puVar12 = (undefined4 *)((int)puVar12 + 1);

            }

            iVar4 = param_1[1];

            iVar10 = *param_1;

            puVar2 = (undefined4 *)((int)puVar2 + *(int *)(iVar4 + 0x60));

            puVar7 = (undefined4 *)((int)puVar7 + *(int *)(iVar10 + 0x60));

            local_c = local_c + 1;

            uVar6 = *(uint *)(iVar4 + 0x6c);

          } while (local_c < uVar6);

        }

        local_8 = local_8 + 1;

        iVar4 = param_1[1];

      } while (local_8 < *(uint *)(iVar4 + 0x70));

    }

    uVar1 = 0;

  }

  else {

LAB_005f110a:

    uVar1 = 0x80004005;

  }

  return uVar1;

}





// --- FUN_005f1114 at 0x005F1114 (size: 211) ---


undefined4 __fastcall FUN_005f1114(int *param_1)



{

  int iVar1;

  int iVar2;

  int iVar3;

  uint uVar4;

  uint uVar5;

  uint uVar6;

  void *local_8;

  

  iVar1 = param_1[1];

  iVar2 = *param_1;

  iVar3 = *(int *)(iVar1 + 0x68);

  if (((iVar3 == *(int *)(iVar2 + 0x68)) && (*(int *)(iVar1 + 0x6c) == *(int *)(iVar2 + 0x6c))) &&

     (*(int *)(iVar1 + 0x70) == *(int *)(iVar2 + 0x70))) {

    local_8 = (void *)FUN_005df0f5(iVar3 << 4);

    if (local_8 == (void *)0x0) {

      local_8 = (void *)0x0;

    }

    else {

      FUN_00401000(local_8,0x10,iVar3,&LAB_005eda5e);

    }

    if (local_8 != (void *)0x0) {

      if ((*(int *)(param_1[1] + 0x10) != 0) && (*(int *)(*param_1 + 0x10) != 0)) {

        *(undefined4 *)(param_1[1] + 0x10) = 0;

        *(undefined4 *)(*param_1 + 0x10) = 0;

      }

      uVar5 = 0;

      if (*(int *)(param_1[1] + 0x70) != 0) {

        uVar4 = *(uint *)(param_1[1] + 0x6c);

        do {

          uVar6 = 0;

          if (uVar4 != 0) {

            do {

              (**(code **)(*(int *)*param_1 + 4))(uVar6,uVar5,local_8);

              (**(code **)(*(int *)param_1[1] + 8))(uVar6,uVar5,local_8);

              uVar4 = *(uint *)(param_1[1] + 0x6c);

              uVar6 = uVar6 + 1;

            } while (uVar6 < uVar4);

          }

          uVar5 = uVar5 + 1;

        } while (uVar5 < *(uint *)(param_1[1] + 0x70));

      }

      operator_delete(local_8);

      return 0;

    }

  }

  return 0x80004005;

}





// --- FUN_005f11e7 at 0x005F11E7 (size: 467) ---


undefined4 __fastcall FUN_005f11e7(int *param_1)



{

  int iVar1;

  undefined4 uVar2;

  int iVar3;

  uint uVar4;

  undefined4 *puVar5;

  uint uVar6;

  uint local_18;

  uint local_14;

  undefined4 *local_10;

  uint local_c;

  undefined4 *local_8;

  

  if ((char)param_1[2] == '\x01') {

    iVar3 = param_1[1];

    iVar1 = *param_1;

    local_10 = (undefined4 *)*(uint *)(iVar3 + 0x68);

    if (*(uint *)(iVar3 + 0x68) <= *(uint *)(iVar1 + 0x68)) {

      local_10 = (undefined4 *)*(uint *)(iVar1 + 0x68);

    }

    local_18 = *(uint *)(iVar3 + 0x6c);

    if (*(uint *)(iVar1 + 0x6c) <= *(uint *)(iVar3 + 0x6c)) {

      local_18 = *(uint *)(iVar1 + 0x6c);

    }

    local_14 = *(uint *)(iVar3 + 0x70);

    if (*(uint *)(iVar1 + 0x70) <= *(uint *)(iVar3 + 0x70)) {

      local_14 = *(uint *)(iVar1 + 0x70);

    }

    uVar4 = (int)local_10 << 4;

    local_8 = (undefined4 *)FUN_005df0f5(uVar4);

    if (local_8 == (undefined4 *)0x0) {

      local_8 = (undefined4 *)0x0;

    }

    else {

      FUN_00401000(local_8,0x10,local_10,&LAB_005eda5e);

    }

    if (local_8 == (undefined4 *)0x0) {

      uVar2 = 0x80004005;

    }

    else {

      iVar3 = *(int *)(param_1[1] + 0x68);

      local_10 = (undefined4 *)FUN_005df0f5(iVar3 << 4);

      if (local_10 == (undefined4 *)0x0) {

        local_10 = (undefined4 *)0x0;

      }

      else {

        FUN_00401000(local_10,0x10,iVar3,&LAB_005eda5e);

      }

      if (local_10 == (undefined4 *)0x0) {

        operator_delete(local_8);

        uVar2 = 0x80004005;

      }

      else {

        puVar5 = local_8;

        for (uVar4 = uVar4 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {

          *puVar5 = 0;

          puVar5 = puVar5 + 1;

        }

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

          *(undefined1 *)puVar5 = 0;

          puVar5 = (undefined4 *)((int)puVar5 + 1);

        }

        puVar5 = local_10;

        for (uVar4 = (uint)(*(int *)(param_1[1] + 0x68) << 4) >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {

          *puVar5 = 0;

          puVar5 = puVar5 + 1;

        }

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

          *(undefined1 *)puVar5 = 0;

          puVar5 = (undefined4 *)((int)puVar5 + 1);

        }

        if ((*(int *)(param_1[1] + 0x10) != 0) && (*(int *)(*param_1 + 0x10) != 0)) {

          *(undefined4 *)(param_1[1] + 0x10) = 0;

          *(undefined4 *)(*param_1 + 0x10) = 0;

        }

        local_c = 0;

        if (local_14 != 0) {

          do {

            uVar4 = 0;

            if (local_18 != 0) {

              do {

                (**(code **)(*(int *)*param_1 + 4))(uVar4,local_c,local_8);

                (**(code **)(*(int *)param_1[1] + 8))(uVar4,local_c,local_8);

                uVar4 = uVar4 + 1;

              } while (uVar4 < local_18);

            }

            uVar4 = local_18;

            if (local_18 < *(uint *)(param_1[1] + 0x6c)) {

              do {

                (**(code **)(*(int *)param_1[1] + 8))(uVar4,local_c,local_10);

                uVar4 = uVar4 + 1;

              } while (uVar4 < *(uint *)(param_1[1] + 0x6c));

            }

            local_c = local_c + 1;

          } while (local_c < local_14);

        }

        if (local_14 < *(uint *)(param_1[1] + 0x70)) {

          uVar4 = *(uint *)(param_1[1] + 0x6c);

          do {

            uVar6 = 0;

            if (uVar4 != 0) {

              do {

                (**(code **)(*(int *)param_1[1] + 8))(uVar6,local_14,local_10);

                uVar4 = *(uint *)(param_1[1] + 0x6c);

                uVar6 = uVar6 + 1;

              } while (uVar6 < uVar4);

            }

            local_14 = local_14 + 1;

          } while (local_14 < *(uint *)(param_1[1] + 0x70));

        }

        operator_delete(local_8);

        operator_delete(local_10);

        uVar2 = 0;

      }

    }

  }

  else {

    uVar2 = 0x80004005;

  }

  return uVar2;

}





// --- FUN_005f13ba at 0x005F13BA (size: 470) ---


undefined4 __fastcall FUN_005f13ba(int *param_1)



{

  int iVar1;

  int iVar2;

  uint uVar3;

  int iVar4;

  uint uVar5;

  uint uVar6;

  undefined4 uVar7;

  int iVar8;

  undefined4 *puVar9;

  undefined4 *puVar10;

  uint local_28;

  uint local_24;

  uint local_20;

  uint local_1c;

  uint local_18;

  uint local_14;

  uint local_10;

  undefined4 *local_c;

  void *local_8;

  

  if ((char)param_1[2] == '\x02') {

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

    local_8 = (void *)FUN_005df0f5(iVar1 << 4);

    if (local_8 == (void *)0x0) {

      local_8 = (void *)0x0;

    }

    else {

      FUN_00401000(local_8,0x10,iVar1,&LAB_005eda5e);

    }

    if (local_8 == (void *)0x0) {

      uVar7 = 0x8007000e;

    }

    else {

      iVar1 = *(int *)(param_1[1] + 0x68);

      local_c = (undefined4 *)FUN_005df0f5(iVar1 << 4);

      if (local_c == (undefined4 *)0x0) {

        local_c = (undefined4 *)0x0;

      }

      else {

        FUN_00401000(local_c,0x10,iVar1,&LAB_005eda5e);

      }

      if (local_c == (undefined4 *)0x0) {

        operator_delete(local_8);

        uVar7 = 0x8007000e;

      }

      else {

        if ((*(int *)(param_1[1] + 0x10) != 0) && (*(int *)(*param_1 + 0x10) != 0)) {

          *(undefined4 *)(param_1[1] + 0x10) = 0;

          *(undefined4 *)(*param_1 + 0x10) = 0;

        }

        iVar1 = *param_1;

        iVar8 = param_1[1];

        iVar2 = *(int *)(iVar1 + 0x68);

        uVar3 = *(uint *)(iVar8 + 0x68);

        local_20 = 0;

        local_14 = 0;

        iVar4 = *(int *)(iVar1 + 0x6c);

        uVar5 = *(uint *)(iVar8 + 0x6c);

        iVar1 = *(int *)(iVar1 + 0x70);

        uVar6 = *(uint *)(iVar8 + 0x70);

        if (*(int *)(iVar8 + 0x70) != 0) {

          do {

            local_24 = 0xffffffff;

            local_28 = 0;

            local_10 = 0;

            if (*(int *)(iVar8 + 0x6c) != 0) {

              do {

                local_18 = 0;

                local_1c = 0;

                if (((local_24 ^ local_28) & 0xffff0000) != 0) {

                  (**(code **)(*(int *)*param_1 + 4))(local_28 >> 0x10,local_20 >> 0x10,local_8);

                  local_24 = local_28;

                }

                puVar9 = local_c;

                if (*(int *)(param_1[1] + 0x68) != 0) {

                  do {

                    puVar10 = (undefined4 *)((local_18 >> 0x10) * 0x10 + (int)local_8);

                    local_1c = local_1c + 1;

                    *puVar9 = *puVar10;

                    puVar9[1] = puVar10[1];

                    puVar9[2] = puVar10[2];

                    puVar9[3] = puVar10[3];

                    puVar9 = puVar9 + 4;

                    local_18 = local_18 + (uint)(iVar2 << 0x10) / uVar3;

                  } while (local_1c < *(uint *)(param_1[1] + 0x68));

                }

                (**(code **)(*(int *)param_1[1] + 8))(local_10,local_14,local_c);

                local_28 = local_28 + (uint)(iVar4 << 0x10) / uVar5;

                local_10 = local_10 + 1;

              } while (local_10 < *(uint *)(param_1[1] + 0x6c));

            }

            local_20 = local_20 + (uint)(iVar1 << 0x10) / uVar6;

            local_14 = local_14 + 1;

            iVar8 = param_1[1];

          } while (local_14 < *(uint *)(iVar8 + 0x70));

        }

        operator_delete(local_8);

        operator_delete(local_c);

        uVar7 = 0;

      }

    }

  }

  else {

    uVar7 = 0x80004005;

  }

  return uVar7;

}





// --- FUN_005f1590 at 0x005F1590 (size: 932) ---


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



undefined4 __fastcall FUN_005f1590(int *param_1)



{

  int *piVar1;

  uint *puVar2;

  float fVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  float fVar9;

  float fVar10;

  float fVar11;

  float fVar12;

  float fVar13;

  float fVar14;

  int iVar15;

  float fVar16;

  undefined4 uVar17;

  void *pvVar18;

  void *pvVar19;

  float *pfVar20;

  float *pfVar21;

  float *pfVar22;

  float *pfVar23;

  uint uVar24;

  int iVar25;

  void *local_1c;

  float *local_18;

  float *local_14;

  uint local_10;

  void *local_8;

  

  if ((char)param_1[2] != '\x05') {

    return 0x80004005;

  }

  iVar25 = *param_1;

  uVar24 = *(uint *)(iVar25 + 0x68);

  iVar15 = param_1[1];

  if ((((*(uint *)(iVar15 + 0x68) != uVar24 >> 1) &&

       ((*(uint *)(iVar15 + 0x68) != 1 || (uVar24 != 1)))) ||

      ((*(uint *)(iVar15 + 0x6c) != *(uint *)(iVar25 + 0x6c) >> 1 &&

       ((*(uint *)(iVar15 + 0x6c) != 1 || (*(int *)(iVar25 + 0x6c) != 1)))))) ||

     ((*(int *)(iVar15 + 0x70) != 1 || (*(int *)(iVar25 + 0x70) != 1)))) {

    return 0x80004005;

  }

  if ((1 < uVar24) && ((uVar24 & 1) != 0)) {

    *(uint *)(iVar25 + 0x68) = *(uint *)(iVar25 + 0x68) & 0xfffffffe;

    piVar1 = (int *)(*param_1 + 0x74);

    *piVar1 = *piVar1 - *(int *)(*param_1 + 0x78);

  }

  if (1 < *(uint *)(*param_1 + 0x6c)) {

    puVar2 = (uint *)(*param_1 + 0x6c);

    *puVar2 = *puVar2 & 0xfffffffe;

  }

  if ((*(byte *)((int)param_1 + 10) & 8) != 0) goto switchD_005f167b_caseD_14;

  iVar25 = *param_1;

  iVar15 = *(int *)(iVar25 + 4);

  if ((((iVar15 != *(int *)(param_1[1] + 4)) || (*(uint *)(iVar25 + 0x68) < 2)) ||

      (*(uint *)(iVar25 + 0x6c) < 2)) ||

     ((*(int *)(param_1[1] + 0x10) != 0 || (*(int *)(iVar25 + 0x10) != 0))))

  goto switchD_005f167b_caseD_14;

  if (iVar15 < 0x1e) {

    if (iVar15 == 0x1d) {

      iVar25 = FUN_005f0b87();

    }

    else {

      switch(iVar15) {

      default:

        goto switchD_005f167b_caseD_14;

      case 0x15:

switchD_005f167b_caseD_15:

        iVar25 = FUN_005f028f();

        break;

      case 0x16:

switchD_005f167b_caseD_16:

        iVar25 = FUN_005f0522();

        break;

      case 0x17:

        iVar25 = FUN_005f0544();

        break;

      case 0x18:

        iVar25 = FUN_005f0678();

        break;

      case 0x19:

        iVar25 = FUN_005f077d();

        break;

      case 0x1a:

        iVar25 = FUN_005f08a6();

        break;

      case 0x1b:

        iVar25 = FUN_005f09dd();

        break;

      case 0x1c:

switchD_005f167b_caseD_1c:

        iVar25 = FUN_005f0afb();

      }

    }

  }

  else if (iVar15 < 0x2a) {

    if (iVar15 == 0x29) goto switchD_005f167b_caseD_14;

    if (iVar15 != 0x1e) {

      if (iVar15 != 0x20) {

        if (iVar15 != 0x21) goto switchD_005f167b_caseD_14;

        goto switchD_005f167b_caseD_16;

      }

      goto switchD_005f167b_caseD_15;

    }

    iVar25 = FUN_005f0cb5();

  }

  else {

    if (iVar15 == 0x32) goto switchD_005f167b_caseD_1c;

    if (iVar15 == 0x33) {

      iVar25 = FUN_005f0dbe();

    }

    else {

      if (iVar15 != 0x34) goto switchD_005f167b_caseD_14;

      iVar25 = FUN_005f0eec();

    }

  }

  if (-1 < iVar25) {

    return 0;

  }

switchD_005f167b_caseD_14:

  iVar25 = *(int *)(param_1[1] + 0x68);

  local_14 = (float *)FUN_005df0f5(iVar25 << 4);

  if (local_14 == (float *)0x0) {

    local_14 = (float *)0x0;

  }

  else {

    FUN_00401000(local_14,0x10,iVar25,&LAB_005eda5e);

  }

  if (local_14 == (float *)0x0) {

    uVar17 = 0x8007000e;

  }

  else {

    iVar25 = *(int *)(*param_1 + 0x68);

    if (*(int *)(*param_1 + 0x6c) == 1) {

      local_8 = (void *)FUN_005df0f5(iVar25 << 4);

      if (local_8 == (void *)0x0) {

        local_8 = (void *)0x0;

        pvVar18 = local_8;

      }

      else {

        FUN_00401000(local_8,0x10,iVar25,&LAB_005eda5e);

        pvVar18 = local_8;

      }

    }

    else {

      local_8 = (void *)FUN_005df0f5(iVar25 << 5);

      if (local_8 == (void *)0x0) {

        local_8 = (void *)0x0;

      }

      else {

        FUN_00401000(local_8,0x10,iVar25 << 1,&LAB_005eda5e);

      }

      pvVar18 = (void *)(*(int *)(*param_1 + 0x68) * 0x10 + (int)local_8);

    }

    if (local_8 == (void *)0x0) {

      uVar17 = 0x8007000e;

    }

    else {

      pvVar19 = pvVar18;

      local_1c = local_8;

      if (*(int *)(*param_1 + 0x68) != 1) {

        local_1c = (void *)((int)local_8 + 0x10);

        pvVar19 = (void *)((int)pvVar18 + 0x10);

      }

      local_10 = 0;

      if (*(int *)(param_1[1] + 0x6c) != 0) {

        do {

          (**(code **)(*(int *)*param_1 + 4))(local_10 * 2,0,local_8);

          if (pvVar18 != local_8) {

            (**(code **)(*(int *)*param_1 + 4))(local_10 * 2 + 1,0,pvVar18);

          }

          fVar16 = _DAT_007c97cc;

          uVar24 = 0;

          if (*(int *)(param_1[1] + 0x68) != 0) {

            local_18 = local_14;

            do {

              iVar25 = uVar24 * 0x20;

              pfVar20 = (float *)((int)local_1c + iVar25);

              pfVar23 = (float *)((int)local_8 + iVar25);

              fVar3 = pfVar20[1];

              fVar4 = pfVar23[1];

              fVar5 = pfVar20[2];

              fVar6 = pfVar23[2];

              fVar7 = pfVar20[3];

              fVar8 = pfVar23[3];

              pfVar21 = (float *)((int)pvVar18 + iVar25);

              fVar9 = pfVar21[1];

              fVar10 = pfVar21[2];

              fVar11 = pfVar21[3];

              pfVar22 = (float *)((int)pvVar19 + iVar25);

              uVar24 = uVar24 + 1;

              fVar12 = pfVar22[1];

              fVar13 = pfVar22[2];

              fVar14 = pfVar22[3];

              *local_18 = (*pfVar20 + *pfVar23 + *pfVar21 + *pfVar22) * fVar16;

              local_18[1] = (fVar3 + fVar4 + fVar9 + fVar12) * fVar16;

              local_18[2] = (fVar5 + fVar6 + fVar10 + fVar13) * fVar16;

              local_18[3] = (fVar7 + fVar8 + fVar11 + fVar14) * fVar16;

              local_18 = local_18 + 4;

            } while (uVar24 < *(uint *)(param_1[1] + 0x68));

          }

          (**(code **)(*(int *)param_1[1] + 8))(local_10,0,local_14);

          local_10 = local_10 + 1;

        } while (local_10 < *(uint *)(param_1[1] + 0x6c));

      }

      operator_delete(local_8);

      uVar17 = 0;

    }

    operator_delete(local_14);

  }

  return uVar17;

}





// --- FUN_005f1958 at 0x005F1958 (size: 1032) ---


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



undefined4 __fastcall FUN_005f1958(int *param_1)



{

  uint *puVar1;

  float *pfVar2;

  float fVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  float fVar9;

  float fVar10;

  float fVar11;

  float fVar12;

  float fVar13;

  float fVar14;

  float fVar15;

  float fVar16;

  float fVar17;

  float fVar18;

  float fVar19;

  float fVar20;

  float fVar21;

  float fVar22;

  float fVar23;

  float fVar24;

  float fVar25;

  float fVar26;

  uint uVar27;

  int iVar28;

  float fVar29;

  undefined4 uVar30;

  void *pvVar31;

  void *pvVar32;

  int iVar33;

  float *pfVar34;

  int *piVar35;

  float *pfVar36;

  float *pfVar37;

  float *pfVar38;

  float *pfVar39;

  float *pfVar40;

  void *pvVar41;

  float *pfVar42;

  void *pvVar43;

  void *local_34;

  void *local_30;

  float *local_2c;

  uint local_20;

  void *local_1c;

  uint local_18;

  float *local_14;

  uint local_c;

  void *local_8;

  

  if ((char)param_1[2] == '\x05') {

    iVar33 = *param_1;

    uVar27 = *(uint *)(iVar33 + 0x68);

    iVar28 = param_1[1];

    if ((((*(uint *)(iVar28 + 0x68) == uVar27 >> 1) ||

         ((*(uint *)(iVar28 + 0x68) == 1 && (uVar27 == 1)))) &&

        ((*(uint *)(iVar28 + 0x6c) == *(uint *)(iVar33 + 0x6c) >> 1 ||

         ((*(uint *)(iVar28 + 0x6c) == 1 && (*(int *)(iVar33 + 0x6c) == 1)))))) &&

       (*(uint *)(iVar28 + 0x70) == *(uint *)(iVar33 + 0x70) >> 1)) {

      if ((1 < uVar27) && ((uVar27 & 1) != 0)) {

        *(uint *)(iVar33 + 0x68) = *(uint *)(iVar33 + 0x68) & 0xfffffffe;

        piVar35 = (int *)(*param_1 + 0x74);

        *piVar35 = *piVar35 - *(int *)(*param_1 + 0x78);

      }

      if (1 < *(uint *)(*param_1 + 0x6c)) {

        puVar1 = (uint *)(*param_1 + 0x6c);

        *puVar1 = *puVar1 & 0xfffffffe;

      }

      if (1 < *(uint *)(*param_1 + 0x70)) {

        puVar1 = (uint *)(*param_1 + 0x70);

        *puVar1 = *puVar1 & 0xfffffffe;

      }

      iVar33 = *(int *)(param_1[1] + 0x68);

      local_14 = (float *)FUN_005df0f5(iVar33 << 4);

      if (local_14 == (float *)0x0) {

        local_14 = (float *)0x0;

      }

      else {

        FUN_00401000(local_14,0x10,iVar33,&LAB_005eda5e);

      }

      if (local_14 == (float *)0x0) {

        uVar30 = 0x8007000e;

      }

      else {

        iVar33 = *(int *)(*param_1 + 0x68);

        if (*(int *)(*param_1 + 0x6c) == 1) {

          local_8 = (void *)FUN_005df0f5(iVar33 << 5);

          if (local_8 == (void *)0x0) {

            local_8 = (void *)0x0;

          }

          else {

            FUN_00401000(local_8,0x10,iVar33 << 1,&LAB_005eda5e);

          }

          piVar35 = (int *)(*param_1 + 0x68);

          pvVar43 = (void *)(*piVar35 * 0x10 + (int)local_8);

          local_1c = local_8;

          pvVar31 = pvVar43;

        }

        else {

          local_8 = (void *)FUN_005df0f5(iVar33 << 6);

          if (local_8 == (void *)0x0) {

            local_8 = (void *)0x0;

          }

          else {

            FUN_00401000(local_8,0x10,iVar33 << 2,&LAB_005eda5e);

          }

          piVar35 = (int *)(*param_1 + 0x68);

          iVar33 = *piVar35;

          pvVar31 = (void *)(iVar33 * 0x10 + (int)local_8);

          local_1c = (void *)(iVar33 * 0x20 + (int)local_8);

          pvVar43 = (void *)(iVar33 * 0x30 + (int)local_8);

        }

        if (local_8 == (void *)0x0) {

          uVar30 = 0x8007000e;

        }

        else {

          if (*piVar35 == 1) {

            local_34 = local_8;

            pvVar32 = local_1c;

            pvVar41 = pvVar43;

            local_30 = pvVar31;

          }

          else {

            local_34 = (void *)((int)local_8 + 0x10);

            local_30 = (void *)((int)pvVar31 + 0x10);

            pvVar32 = (void *)((int)local_1c + 0x10);

            pvVar41 = (void *)((int)pvVar43 + 0x10);

          }

          local_18 = 0;

          iVar33 = param_1[1];

          if (*(int *)(iVar33 + 0x70) != 0) {

            do {

              local_c = 0;

              if (*(int *)(iVar33 + 0x6c) != 0) {

                do {

                  iVar33 = local_18 * 2;

                  (**(code **)(*(int *)*param_1 + 4))(local_c * 2,iVar33,local_8);

                  if (pvVar31 != local_8) {

                    (**(code **)(*(int *)*param_1 + 4))(local_c * 2,iVar33 + 1,pvVar31);

                  }

                  if (local_1c != local_8) {

                    (**(code **)(*(int *)*param_1 + 4))(local_c * 2 + 1,iVar33,local_1c);

                  }

                  if ((pvVar43 != pvVar31) && (pvVar43 != local_1c)) {

                    (**(code **)(*(int *)*param_1 + 4))(local_c * 2 + 1,iVar33 + 1,pvVar43);

                  }

                  fVar29 = _DAT_007c7624;

                  local_20 = 0;

                  if (*(int *)(param_1[1] + 0x68) != 0) {

                    local_2c = local_14;

                    do {

                      iVar33 = local_20 * 0x20;

                      pfVar36 = (float *)((int)local_34 + iVar33);

                      pfVar42 = (float *)((int)local_8 + iVar33);

                      fVar3 = pfVar36[1];

                      fVar4 = pfVar42[1];

                      fVar5 = pfVar36[2];

                      fVar6 = pfVar42[2];

                      fVar7 = pfVar36[3];

                      pfVar2 = (float *)(iVar33 + (int)pvVar31);

                      fVar8 = pfVar42[3];

                      fVar9 = pfVar2[1];

                      fVar10 = pfVar2[2];

                      fVar11 = pfVar2[3];

                      pfVar37 = (float *)((int)local_30 + iVar33);

                      fVar12 = pfVar37[1];

                      fVar13 = pfVar37[2];

                      fVar14 = pfVar37[3];

                      pfVar38 = (float *)((int)local_1c + iVar33);

                      fVar15 = pfVar38[1];

                      fVar16 = pfVar38[2];

                      fVar17 = pfVar38[3];

                      pfVar39 = (float *)((int)pvVar32 + iVar33);

                      fVar18 = pfVar39[1];

                      fVar19 = pfVar39[2];

                      fVar20 = pfVar39[3];

                      pfVar40 = (float *)((int)pvVar43 + iVar33);

                      fVar21 = pfVar40[1];

                      fVar22 = pfVar40[2];

                      fVar23 = pfVar40[3];

                      pfVar34 = (float *)(iVar33 + (int)pvVar41);

                      local_20 = local_20 + 1;

                      fVar24 = pfVar34[1];

                      fVar25 = pfVar34[2];

                      fVar26 = pfVar34[3];

                      *local_2c = (*pfVar36 + *pfVar42 + *pfVar2 + *pfVar37 + *pfVar38 + *pfVar39 +

                                   *pfVar40 + *pfVar34) * fVar29;

                      local_2c[1] = (fVar3 + fVar4 + fVar9 + fVar12 + fVar15 + fVar18 + fVar21 +

                                    fVar24) * fVar29;

                      local_2c[2] = (fVar5 + fVar6 + fVar10 + fVar13 + fVar16 + fVar19 + fVar22 +

                                    fVar25) * fVar29;

                      local_2c[3] = (fVar7 + fVar8 + fVar11 + fVar14 + fVar17 + fVar20 + fVar23 +

                                    fVar26) * fVar29;

                      local_2c = local_2c + 4;

                    } while (local_20 < *(uint *)(param_1[1] + 0x68));

                  }

                  (**(code **)(*(int *)param_1[1] + 8))(local_c,local_18,local_14);

                  local_c = local_c + 1;

                } while (local_c < *(uint *)(param_1[1] + 0x6c));

              }

              local_18 = local_18 + 1;

              iVar33 = param_1[1];

            } while (local_18 < *(uint *)(iVar33 + 0x70));

          }

          operator_delete(local_8);

          uVar30 = 0;

        }

        operator_delete(local_14);

      }

    }

    else {

      uVar30 = 0x80004005;

    }

  }

  else {

    uVar30 = 0x80004005;

  }

  return uVar30;

}





// --- FUN_005f1d60 at 0x005F1D60 (size: 236) ---


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



uint * FUN_005f1d60(int param_1)



{

  float fVar1;

  float fVar2;

  float fVar3;

  uint *puVar4;

  uint uVar5;

  uint *puVar6;

  uint uVar7;

  uint unaff_ESI;

  uint unaff_EDI;

  uint local_8;

  

  puVar4 = (uint *)FUN_005df0f5(unaff_EDI << 4);

  if (puVar4 != (uint *)0x0) {

    fVar1 = (float)(int)unaff_ESI;

    if ((int)unaff_ESI < 0) {

      fVar1 = fVar1 + _DAT_0079920c;

    }

    fVar2 = (float)(int)unaff_EDI;

    if ((int)unaff_EDI < 0) {

      fVar2 = fVar2 + _DAT_0079920c;

    }

    local_8 = 0;

    puVar6 = puVar4;

    if (unaff_EDI != 0) {

      do {

        fVar3 = (float)(int)local_8;

        if ((int)local_8 < 0) {

          fVar3 = fVar3 + _DAT_0079920c;

        }

        fVar3 = (fVar3 + _DAT_007938b8) * (fVar1 / fVar2) + _DAT_007938b8;

        uVar5 = (uint)ROUND(fVar3);

        uVar7 = uVar5 - 1;

        fVar3 = ((float)(int)uVar5 + _DAT_007938b0) - fVar3;

        if ((int)uVar7 < 0) {

          uVar7 = -(uint)(param_1 != 0) & unaff_ESI - 1;

        }

        if (unaff_ESI <= uVar5) {

          uVar5 = ~-(uint)(param_1 != 0) & unaff_ESI - 1;

        }

        puVar6[1] = (uint)fVar3;

        *puVar6 = uVar7;

        puVar6[2] = uVar5;

        local_8 = local_8 + 1;

        puVar6[3] = (uint)(1.0 - fVar3);

        puVar6 = puVar6 + 4;

      } while (local_8 < unaff_EDI);

    }

  }

  return puVar4;

}





// --- FUN_005f1e4c at 0x005F1E4C (size: 930) ---


undefined4 __fastcall FUN_005f1e4c(int *param_1)



{

  float *pfVar1;

  float *pfVar2;

  float fVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  float fVar9;

  float fVar10;

  float fVar11;

  float fVar12;

  float fVar13;

  float fVar14;

  float fVar15;

  float fVar16;

  float fVar17;

  float fVar18;

  float fVar19;

  float fVar20;

  uint uVar21;

  int iVar22;

  int iVar23;

  void *pvVar24;

  void *pvVar25;

  int *piVar26;

  float *pfVar27;

  int *piVar28;

  float *pfVar29;

  undefined4 uVar30;

  void *pvVar31;

  void *pvVar32;

  uint local_34;

  int local_30;

  float *local_2c;

  void *local_24;

  uint local_20;

  int local_1c;

  void *local_14;

  void *local_10;

  float *local_c;

  

  local_c = (float *)0x0;

  local_14 = (void *)0x0;

  uVar21 = param_1[2];

  if ((char)uVar21 != '\x03') {

    return 0x80004005;

  }

  if ((*(int *)(param_1[1] + 0x70) != 1) || (*(int *)(*param_1 + 0x70) != 1)) {

    return 0x80004005;

  }

  pvVar24 = (void *)FUN_005f1d60(~(uVar21 >> 0x10) & 1);

  pvVar25 = (void *)FUN_005f1d60(~(uVar21 >> 0x11) & 1);

  if ((pvVar24 != (void *)0x0) && (pvVar25 != (void *)0x0)) {

    iVar22 = *(int *)(param_1[1] + 0x68);

    local_c = (float *)FUN_005df0f5(iVar22 << 4);

    if (local_c == (float *)0x0) {

      local_c = (float *)0x0;

    }

    else {

      FUN_00401000(local_c,0x10,iVar22,&LAB_005eda5e);

    }

    if (local_c != (float *)0x0) {

      iVar22 = *(int *)(*param_1 + 0x68);

      local_14 = (void *)FUN_005df0f5(iVar22 << 5);

      if (local_14 == (void *)0x0) {

        local_14 = (void *)0x0;

      }

      else {

        FUN_00401000(local_14,0x10,iVar22 << 1,&LAB_005eda5e);

      }

      if (local_14 != (void *)0x0) {

        local_20 = 0;

        local_30 = -1;

        local_1c = -1;

        pvVar31 = (void *)(*(int *)(*param_1 + 0x68) * 0x10 + (int)local_14);

        local_24 = local_14;

        if (*(int *)(param_1[1] + 0x6c) != 0) {

          piVar28 = (int *)((int)pvVar25 + 8);

          local_10 = pvVar31;

          do {

            iVar23 = local_1c;

            iVar22 = piVar28[-2];

            local_34 = 0;

            pvVar32 = pvVar31;

            if (iVar22 != local_30) {

              if (iVar22 == local_1c) {

                local_1c = -1;

                local_30 = iVar23;

                local_10 = local_24;

                pvVar32 = local_24;

                local_24 = pvVar31;

              }

              else {

                (**(code **)(*(int *)*param_1 + 4))(iVar22,0,local_24);

                local_30 = iVar22;

              }

            }

            iVar22 = *piVar28;

            if (iVar22 != local_1c) {

              (**(code **)(*(int *)*param_1 + 4))(iVar22,0,pvVar32);

              local_1c = iVar22;

            }

            pvVar31 = pvVar32;

            if (*(int *)(param_1[1] + 0x68) != 0) {

              piVar26 = (int *)((int)pvVar24 + 8);

              local_2c = local_c;

              do {

                fVar3 = (float)piVar26[1];

                pfVar1 = (float *)(*piVar26 * 0x10 + (int)pvVar32);

                fVar4 = pfVar1[1];

                fVar5 = pfVar1[2];

                fVar6 = pfVar1[3];

                fVar7 = (float)piVar26[-1];

                pfVar2 = (float *)(piVar26[-2] * 0x10 + (int)pvVar32);

                pfVar27 = (float *)(*piVar26 * 0x10 + (int)local_24);

                fVar8 = pfVar2[1];

                pfVar29 = (float *)(piVar26[-2] * 0x10 + (int)local_24);

                fVar9 = pfVar2[2];

                fVar10 = pfVar2[3];

                fVar11 = (float)piVar28[1];

                fVar12 = (float)piVar26[1];

                fVar13 = pfVar27[1];

                fVar14 = pfVar27[2];

                fVar15 = pfVar27[3];

                fVar16 = (float)piVar26[-1];

                fVar17 = pfVar29[1];

                fVar18 = pfVar29[2];

                fVar19 = pfVar29[3];

                piVar26 = piVar26 + 4;

                local_34 = local_34 + 1;

                fVar20 = (float)piVar28[-1];

                *local_2c = (fVar16 * *pfVar29 + fVar12 * *pfVar27) * fVar20 +

                            (fVar7 * *pfVar2 + fVar3 * *pfVar1) * fVar11;

                local_2c[1] = (fVar16 * fVar17 + fVar12 * fVar13) * fVar20 +

                              (fVar7 * fVar8 + fVar3 * fVar4) * fVar11;

                local_2c[2] = (fVar16 * fVar18 + fVar12 * fVar14) * fVar20 +

                              (fVar7 * fVar9 + fVar3 * fVar5) * fVar11;

                local_2c[3] = (fVar12 * fVar15 + fVar16 * fVar19) * fVar20 +

                              (fVar3 * fVar6 + fVar7 * fVar10) * fVar11;

                pvVar32 = local_10;

                pvVar31 = local_10;

                local_2c = local_2c + 4;

              } while (local_34 < *(uint *)(param_1[1] + 0x68));

            }

            (**(code **)(*(int *)param_1[1] + 8))(local_20,0,local_c);

            piVar28 = piVar28 + 4;

            local_20 = local_20 + 1;

          } while (local_20 < *(uint *)(param_1[1] + 0x6c));

        }

        uVar30 = 0;

        goto LAB_005f21bd;

      }

    }

  }

  uVar30 = 0x8007000e;

LAB_005f21bd:

  operator_delete(pvVar24);

  operator_delete(pvVar25);

  operator_delete(local_c);

  operator_delete(local_14);

  return uVar30;

}





// --- FUN_005f21ee at 0x005F21EE (size: 1730) ---


undefined4 __fastcall FUN_005f21ee(int *param_1)



{

  float *pfVar1;

  float fVar2;

  float fVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  float fVar9;

  float fVar10;

  float fVar11;

  float fVar12;

  float fVar13;

  float fVar14;

  float fVar15;

  float fVar16;

  float fVar17;

  float fVar18;

  float fVar19;

  float fVar20;

  float fVar21;

  float fVar22;

  float fVar23;

  float fVar24;

  float fVar25;

  float fVar26;

  float fVar27;

  float fVar28;

  float fVar29;

  float fVar30;

  float fVar31;

  float fVar32;

  float fVar33;

  float fVar34;

  float fVar35;

  float fVar36;

  float fVar37;

  float fVar38;

  float fVar39;

  uint uVar40;

  void *pvVar41;

  void *pvVar42;

  void *pvVar43;

  void *pvVar44;

  int iVar45;

  int *piVar46;

  int iVar47;

  float *pfVar48;

  float *pfVar49;

  float *pfVar50;

  float *pfVar51;

  void *pvVar52;

  void *pvVar53;

  float *pfVar54;

  float *pfVar55;

  float *pfVar56;

  undefined4 uVar57;

  int *piVar58;

  uint local_48;

  float *local_3c;

  void *local_38;

  void *local_30;

  void *local_2c;

  void *local_28;

  uint local_24;

  uint local_20;

  int local_1c;

  void *local_18;

  int local_14;

  float *local_10;

  undefined4 *local_c;

  

  local_10 = (float *)0x0;

  local_28 = (void *)0x0;

  uVar40 = param_1[2];

  if ((char)uVar40 != '\x03') {

    return 0x80004005;

  }

  pvVar42 = (void *)FUN_005f1d60(~(uVar40 >> 0x10) & 1);

  pvVar43 = (void *)FUN_005f1d60(~(uVar40 >> 0x11) & 1);

  pvVar44 = (void *)FUN_005f1d60(~(uVar40 >> 0x12) & 1);

  if (((pvVar42 != (void *)0x0) && (pvVar43 != (void *)0x0)) && (pvVar44 != (void *)0x0)) {

    iVar47 = *(int *)(param_1[1] + 0x68);

    local_10 = (float *)FUN_005df0f5(iVar47 << 4);

    if (local_10 == (float *)0x0) {

      local_10 = (float *)0x0;

    }

    else {

      FUN_00401000(local_10,0x10,iVar47,&LAB_005eda5e);

    }

    if (local_10 != (float *)0x0) {

      iVar47 = *(int *)(*param_1 + 0x68);

      local_28 = (void *)FUN_005df0f5(iVar47 << 6);

      if (local_28 == (void *)0x0) {

        local_28 = (void *)0x0;

      }

      else {

        FUN_00401000(local_28,0x10,iVar47 << 2,&LAB_005eda5e);

      }

      if (local_28 != (void *)0x0) {

        iVar47 = *(int *)(*param_1 + 0x68);

        local_24 = 0;

        local_18 = (void *)(iVar47 * 0x10 + (int)local_28);

        iVar45 = param_1[1];

        local_2c = (void *)(iVar47 * 0x20 + (int)local_28);

        pvVar52 = (void *)(iVar47 * 0x30 + (int)local_28);

        local_38 = local_28;

        if (*(int *)(iVar45 + 0x70) != 0) {

          local_c = (undefined4 *)((int)pvVar44 + 8);

          local_30 = pvVar52;

          do {

            local_20 = 0;

            local_1c = -1;

            local_14 = -1;

            if (*(int *)(iVar45 + 0x6c) != 0) {

              piVar58 = (int *)((int)pvVar43 + 8);

              do {

                iVar45 = local_14;

                pvVar41 = local_18;

                iVar47 = piVar58[-2];

                local_48 = 0;

                pvVar53 = pvVar52;

                if (iVar47 != local_1c) {

                  if (iVar47 == local_14) {

                    local_14 = -1;

                    local_1c = iVar45;

                    local_18 = local_38;

                    local_38 = pvVar41;

                    local_30 = local_2c;

                    pvVar53 = local_2c;

                    local_2c = pvVar52;

                  }

                  else {

                    (**(code **)(*(int *)*param_1 + 4))(iVar47,local_c[-2],local_38);

                    (**(code **)(*(int *)*param_1 + 4))(iVar47,*local_c,local_2c);

                    local_1c = iVar47;

                  }

                }

                iVar47 = *piVar58;

                if (iVar47 != local_14) {

                  (**(code **)(*(int *)*param_1 + 4))(iVar47,local_c[-2],local_18);

                  (**(code **)(*(int *)*param_1 + 4))(iVar47,*local_c,pvVar53);

                  local_14 = iVar47;

                }

                pvVar52 = pvVar53;

                if (*(int *)(param_1[1] + 0x68) != 0) {

                  piVar46 = (int *)((int)pvVar42 + 8);

                  local_3c = local_10;

                  do {

                    fVar2 = (float)piVar46[1];

                    pfVar1 = (float *)(*piVar46 * 0x10 + (int)local_30);

                    fVar3 = pfVar1[1];

                    fVar4 = pfVar1[2];

                    fVar5 = pfVar1[3];

                    fVar6 = (float)piVar46[-1];

                    iVar47 = piVar46[-2] * 0x10;

                    pfVar49 = (float *)((int)local_30 + iVar47);

                    fVar7 = pfVar49[1];

                    fVar8 = pfVar49[2];

                    fVar9 = pfVar49[3];

                    pfVar54 = (float *)(*piVar46 * 0x10 + (int)local_2c);

                    pfVar50 = (float *)((int)local_2c + iVar47);

                    fVar10 = (float)piVar58[1];

                    fVar11 = (float)piVar46[1];

                    fVar12 = pfVar54[1];

                    fVar13 = pfVar54[2];

                    fVar14 = pfVar54[3];

                    fVar15 = (float)piVar46[-1];

                    fVar16 = pfVar50[1];

                    fVar17 = pfVar50[2];

                    fVar18 = pfVar50[3];

                    fVar19 = (float)piVar58[-1];

                    fVar20 = (float)local_c[1];

                    pfVar55 = (float *)((int)local_18 + *piVar46 * 0x10);

                    fVar21 = (float)piVar46[1];

                    fVar22 = pfVar55[1];

                    fVar23 = pfVar55[2];

                    fVar24 = pfVar55[3];

                    fVar25 = (float)piVar46[-1];

                    pfVar56 = (float *)((int)local_18 + iVar47);

                    fVar26 = pfVar56[1];

                    fVar27 = pfVar56[2];

                    fVar28 = pfVar56[3];

                    pfVar51 = (float *)(*piVar46 * 0x10 + (int)local_38);

                    pfVar48 = (float *)(iVar47 + (int)local_38);

                    fVar29 = (float)piVar58[1];

                    fVar30 = (float)piVar46[1];

                    fVar31 = pfVar51[1];

                    fVar32 = pfVar51[2];

                    fVar33 = pfVar51[3];

                    fVar34 = (float)piVar46[-1];

                    fVar35 = pfVar48[1];

                    fVar36 = pfVar48[2];

                    fVar37 = pfVar48[3];

                    fVar38 = (float)piVar58[-1];

                    fVar39 = (float)local_c[-1];

                    piVar46 = piVar46 + 4;

                    local_48 = local_48 + 1;

                    *local_3c = ((fVar34 * *pfVar48 + fVar30 * *pfVar51) * fVar38 +

                                (fVar25 * *pfVar56 + fVar21 * *pfVar55) * fVar29) * fVar39 +

                                ((fVar15 * *pfVar50 + fVar11 * *pfVar54) * fVar19 +

                                (fVar6 * *pfVar49 + fVar2 * *pfVar1) * fVar10) * fVar20;

                    local_3c[1] = ((fVar34 * fVar35 + fVar30 * fVar31) * fVar38 +

                                  (fVar25 * fVar26 + fVar21 * fVar22) * fVar29) * fVar39 +

                                  ((fVar15 * fVar16 + fVar11 * fVar12) * fVar19 +

                                  (fVar6 * fVar7 + fVar2 * fVar3) * fVar10) * fVar20;

                    local_3c[2] = ((fVar34 * fVar36 + fVar30 * fVar32) * fVar38 +

                                  (fVar25 * fVar27 + fVar21 * fVar23) * fVar29) * fVar39 +

                                  ((fVar15 * fVar17 + fVar11 * fVar13) * fVar19 +

                                  (fVar6 * fVar8 + fVar2 * fVar4) * fVar10) * fVar20;

                    local_3c[3] = ((fVar30 * fVar33 + fVar34 * fVar37) * fVar38 +

                                  (fVar21 * fVar24 + fVar25 * fVar28) * fVar29) * fVar39 +

                                  ((fVar11 * fVar14 + fVar15 * fVar18) * fVar19 +

                                  (fVar2 * fVar5 + fVar6 * fVar9) * fVar10) * fVar20;

                    pvVar52 = local_30;

                    local_3c = local_3c + 4;

                  } while (local_48 < *(uint *)(param_1[1] + 0x68));

                }

                (**(code **)(*(int *)param_1[1] + 8))(local_20,local_24,local_10);

                piVar58 = piVar58 + 4;

                local_20 = local_20 + 1;

              } while (local_20 < *(uint *)(param_1[1] + 0x6c));

            }

            local_c = local_c + 4;

            local_24 = local_24 + 1;

            iVar45 = param_1[1];

          } while (local_24 < *(uint *)(iVar45 + 0x70));

        }

        uVar57 = 0;

        goto LAB_005f287e;

      }

    }

  }

  uVar57 = 0x8007000e;

LAB_005f287e:

  operator_delete(pvVar42);

  operator_delete(pvVar43);

  operator_delete(pvVar44);

  operator_delete(local_10);

  operator_delete(local_28);

  return uVar57;

}





// --- FUN_005f28b0 at 0x005F28B0 (size: 79) ---


undefined4 * __thiscall FUN_005f28b0(undefined4 *param_1,byte param_2)



{

  undefined4 *puVar1;

  

  if ((param_2 & 2) == 0) {

    operator_delete((void *)*param_1);

    puVar1 = param_1;

    if ((param_2 & 1) != 0) {

      operator_delete(param_1);

    }

  }

  else {

    puVar1 = param_1 + -1;

    FUN_00401030(param_1,0xc,*puVar1,&LAB_005efd46);

    if ((param_2 & 1) != 0) {

      operator_delete(puVar1);

    }

  }

  return puVar1;

}





// --- FUN_005f28ff at 0x005F28FF (size: 1670) ---


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



undefined4 __fastcall FUN_005f28ff(int *param_1)



{

  float fVar1;

  float fVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  int *piVar6;

  int *piVar7;

  int iVar8;

  int iVar9;

  int *piVar10;

  uint uVar11;

  int iVar12;

  int *piVar13;

  int *piVar14;

  float *pfVar15;

  int *piVar16;

  int *piVar17;

  undefined4 uVar18;

  undefined4 *puVar19;

  float *pfVar20;

  int local_38;

  int local_2c;

  int *local_28;

  int *local_20;

  int *local_1c;

  int *local_18;

  void *local_10;

  int *local_c;

  int *local_8;

  

  uVar11 = param_1[2];

  local_20 = (int *)0x0;

  local_1c = (int *)0x0;

  local_c = (int *)0x0;

  local_18 = (int *)0x0;

  local_10 = (void *)0x0;

  piVar6 = (int *)FUN_005efd4f(*(undefined4 *)(*param_1 + 0x68),*(undefined4 *)(param_1[1] + 0x68),

                               ~(uVar11 >> 0x10) & 1);

  if (((piVar6 == (int *)0x0) ||

      (local_20 = (int *)FUN_005efd4f(*(undefined4 *)(*param_1 + 0x6c),

                                      *(undefined4 *)(param_1[1] + 0x6c),~(uVar11 >> 0x11) & 1),

      local_20 == (int *)0x0)) ||

     (local_1c = (int *)FUN_005efd4f(*(undefined4 *)(*param_1 + 0x70),

                                     *(undefined4 *)(param_1[1] + 0x70),~(uVar11 >> 0x12) & 1),

     local_1c == (int *)0x0)) {

    uVar18 = 0x80004005;

  }

  else {

    iVar3 = *piVar6;

    iVar4 = *local_20;

    iVar5 = *local_1c;

    iVar12 = *(int *)(param_1[1] + 0x70);

    local_c = (int *)FUN_005df0f5(iVar12 * 0xc + 4);

    if (local_c == (int *)0x0) {

      local_c = (int *)0x0;

    }

    else {

      *local_c = iVar12;

      local_c = local_c + 1;

      FUN_00401000(local_c,0xc,iVar12,&LAB_005efd39);

    }

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

      iVar12 = *(int *)(*param_1 + 0x68);

      local_10 = (void *)FUN_005df0f5(iVar12 << 4);

      if (local_10 == (void *)0x0) {

        local_10 = (void *)0x0;

      }

      else {

        FUN_00401000(local_10,0x10,iVar12,&LAB_005eda5e);

      }

      if (local_10 != (void *)0x0) {

        piVar17 = local_1c + 1;

        while (piVar17 < (int *)(iVar5 + (int)local_1c)) {

          piVar14 = (int *)(*piVar17 + (int)piVar17);

          for (piVar10 = piVar17 + 1; piVar17 = piVar14, piVar10 < piVar14; piVar10 = piVar10 + 2) {

            local_c[*piVar10 * 3 + 2] = local_c[*piVar10 * 3 + 2] + 1;

          }

        }

        local_38 = 0;

        piVar17 = local_1c + 1;

        fVar2 = _DAT_0079a1a0;

        while (piVar17 < (int *)(iVar5 + (int)local_1c)) {

          piVar14 = (int *)(*piVar17 + (int)piVar17);

          piVar17 = piVar17 + 1;

          for (piVar10 = piVar17; piVar10 < piVar14; piVar10 = piVar10 + 2) {

            piVar7 = local_c + *piVar10 * 3;

            if (*piVar7 == 0) {

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

                iVar8 = *(int *)(param_1[1] + 0x6c) * *(int *)(param_1[1] + 0x68);

                iVar12 = FUN_005df0f5(iVar8 * 0x10);

                if (iVar12 == 0) {

                  iVar12 = 0;

                }

                else {

                  FUN_00401000(iVar12,0x10,iVar8,&LAB_005eda5e);

                }

                *piVar7 = iVar12;

                fVar2 = _DAT_0079a1a0;

                if (iVar12 == 0) goto LAB_005f2f3a;

              }

              else {

                *piVar7 = *local_18;

                *local_18 = 0;

                local_18 = (int *)local_18[1];

              }

              puVar19 = (undefined4 *)*piVar7;

              for (uVar11 = (uint)(*(int *)(param_1[1] + 0x6c) * *(int *)(param_1[1] + 0x68) * 0x10)

                            >> 2; uVar11 != 0; uVar11 = uVar11 - 1) {

                *puVar19 = 0;

                puVar19 = puVar19 + 1;

              }

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

                *(undefined1 *)puVar19 = 0;

                puVar19 = (undefined4 *)((int)puVar19 + 1);

              }

            }

          }

          local_2c = 0;

          piVar10 = local_20 + 1;

          while (piVar10 < (int *)(iVar4 + (int)local_20)) {

            iVar12 = *piVar10;

            (**(code **)(*(int *)*param_1 + 4))(local_2c,local_38,local_10);

            if (piVar6 + 1 < (int *)(iVar3 + (int)piVar6)) {

              pfVar15 = (float *)((int)local_10 + 8);

              local_28 = piVar6 + 1;

              do {

                piVar7 = (int *)(*local_28 + (int)local_28);

                for (local_8 = piVar17; local_8 < piVar14; local_8 = local_8 + 2) {

                  for (piVar16 = piVar10 + 1; piVar16 < (int *)(iVar12 + (int)piVar10);

                      piVar16 = piVar16 + 2) {

                    iVar8 = *(int *)(param_1[1] + 0x68) * *piVar16 * 0x10 + local_c[*local_8 * 3];

                    for (piVar13 = local_28 + 1; piVar13 < piVar7; piVar13 = piVar13 + 2) {

                      pfVar20 = (float *)(*piVar13 * 0x10 + iVar8);

                      fVar2 = (float)piVar13[1] * (float)local_8[1] * (float)piVar16[1];

                      *pfVar20 = fVar2 * pfVar15[-2] + *pfVar20;

                      pfVar20 = (float *)(*piVar13 * 0x10 + 4 + iVar8);

                      *pfVar20 = fVar2 * pfVar15[-1] + *pfVar20;

                      pfVar20 = (float *)(*piVar13 * 0x10 + 8 + iVar8);

                      *pfVar20 = fVar2 * *pfVar15 + *pfVar20;

                      pfVar20 = (float *)(*piVar13 * 0x10 + 0xc + iVar8);

                      *pfVar20 = fVar2 * pfVar15[1] + *pfVar20;

                    }

                  }

                }

                pfVar15 = pfVar15 + 4;

                local_28 = piVar7;

              } while (piVar7 < (int *)(iVar3 + (int)piVar6));

            }

            local_2c = local_2c + 1;

            piVar10 = (int *)(iVar12 + (int)piVar10);

            fVar2 = _DAT_0079a1a0;

          }

          for (; piVar17 < piVar14; piVar17 = piVar17 + 2) {

            piVar7 = local_c + *piVar17 * 3;

            piVar10 = piVar7 + 2;

            *piVar10 = *piVar10 + -1;

            if (*piVar10 == 0) {

              iVar12 = param_1[1];

              local_8 = (int *)0x0;

              if (*(int *)(iVar12 + 0x6c) != 0) {

                do {

                  fVar1 = _DAT_007938b0;

                  iVar12 = *(int *)(iVar12 + 0x68);

                  iVar8 = *(int *)(*param_1 + 8);

                  iVar9 = iVar12 * (int)local_8 * 0x10 + *piVar7;

                  if (iVar8 == 1) {

                    uVar11 = 0;

                    if (iVar12 != 0) {

                      pfVar15 = (float *)(iVar9 + 8);

                      do {

                        if (0.0 <= pfVar15[-2]) {

                          if (fVar1 <= pfVar15[-2]) {

                            fVar2 = 1.0;

                          }

                          else {

                            fVar2 = pfVar15[-2];

                          }

                        }

                        else {

                          fVar2 = 0.0;

                        }

                        pfVar15[-2] = fVar2;

                        if (0.0 <= pfVar15[-1]) {

                          if (fVar1 <= pfVar15[-1]) {

                            fVar2 = 1.0;

                          }

                          else {

                            fVar2 = pfVar15[-1];

                          }

                        }

                        else {

                          fVar2 = 0.0;

                        }

                        pfVar15[-1] = fVar2;

                        if (0.0 <= *pfVar15) {

                          if (fVar1 <= *pfVar15) {

                            fVar2 = 1.0;

                          }

                          else {

                            fVar2 = *pfVar15;

                          }

                        }

                        else {

                          fVar2 = 0.0;

                        }

                        *pfVar15 = fVar2;

                        if (0.0 <= pfVar15[1]) {

                          if (fVar1 <= pfVar15[1]) {

                            fVar2 = 1.0;

                          }

                          else {

                            fVar2 = pfVar15[1];

                          }

                        }

                        else {

                          fVar2 = 0.0;

                        }

                        pfVar15[1] = fVar2;

                        uVar11 = uVar11 + 1;

                        pfVar15 = pfVar15 + 4;

                      } while (uVar11 < *(uint *)(param_1[1] + 0x68));

                    }

                  }

                  else if (iVar8 == 2) {

                    uVar11 = 0;

                    if (iVar12 != 0) {

                      pfVar15 = (float *)(iVar9 + 8);

                      do {

                        fVar1 = fVar2;

                        if (fVar2 <= pfVar15[-2]) {

                          if (_DAT_007938b0 <= pfVar15[-2]) {

                            fVar1 = 1.0;

                          }

                          else {

                            fVar1 = pfVar15[-2];

                          }

                        }

                        pfVar15[-2] = fVar1;

                        fVar1 = fVar2;

                        if (fVar2 <= pfVar15[-1]) {

                          if (_DAT_007938b0 <= pfVar15[-1]) {

                            fVar1 = 1.0;

                          }

                          else {

                            fVar1 = pfVar15[-1];

                          }

                        }

                        pfVar15[-1] = fVar1;

                        fVar1 = fVar2;

                        if (fVar2 <= *pfVar15) {

                          if (_DAT_007938b0 <= *pfVar15) {

                            fVar1 = 1.0;

                          }

                          else {

                            fVar1 = *pfVar15;

                          }

                        }

                        *pfVar15 = fVar1;

                        if (0.0 <= pfVar15[1]) {

                          if (_DAT_007938b0 <= pfVar15[1]) {

                            fVar1 = 1.0;

                          }

                          else {

                            fVar1 = pfVar15[1];

                          }

                        }

                        else {

                          fVar1 = 0.0;

                        }

                        pfVar15[1] = fVar1;

                        uVar11 = uVar11 + 1;

                        pfVar15 = pfVar15 + 4;

                      } while (uVar11 < *(uint *)(param_1[1] + 0x68));

                    }

                  }

                  else if ((iVar8 == 3) && (uVar11 = 0, iVar12 != 0)) {

                    pfVar15 = (float *)(iVar9 + 8);

                    do {

                      fVar1 = fVar2;

                      if (fVar2 <= pfVar15[-2]) {

                        if (_DAT_007938b0 <= pfVar15[-2]) {

                          fVar1 = 1.0;

                        }

                        else {

                          fVar1 = pfVar15[-2];

                        }

                      }

                      pfVar15[-2] = fVar1;

                      fVar1 = fVar2;

                      if (fVar2 <= pfVar15[-1]) {

                        if (_DAT_007938b0 <= pfVar15[-1]) {

                          fVar1 = 1.0;

                        }

                        else {

                          fVar1 = pfVar15[-1];

                        }

                      }

                      pfVar15[-1] = fVar1;

                      fVar1 = fVar2;

                      if (fVar2 <= *pfVar15) {

                        if (_DAT_007938b0 <= *pfVar15) {

                          fVar1 = 1.0;

                        }

                        else {

                          fVar1 = *pfVar15;

                        }

                      }

                      *pfVar15 = fVar1;

                      fVar1 = fVar2;

                      if (fVar2 <= pfVar15[1]) {

                        if (_DAT_007938b0 <= pfVar15[1]) {

                          fVar1 = 1.0;

                        }

                        else {

                          fVar1 = pfVar15[1];

                        }

                      }

                      pfVar15[1] = fVar1;

                      uVar11 = uVar11 + 1;

                      pfVar15 = pfVar15 + 4;

                    } while (uVar11 < *(uint *)(param_1[1] + 0x68));

                  }

                  (**(code **)(*(int *)param_1[1] + 8))

                            (local_8,*piVar17,

                             ((int *)param_1[1])[0x1a] * (int)local_8 * 0x10 + *piVar7);

                  local_8 = (int *)((int)local_8 + 1);

                  iVar12 = param_1[1];

                  fVar2 = _DAT_0079a1a0;

                } while (local_8 < *(uint *)(iVar12 + 0x6c));

              }

              piVar7[1] = (int)local_18;

              local_18 = piVar7;

            }

          }

          local_38 = local_38 + 1;

          piVar17 = piVar14;

        }

        uVar18 = 0;

        goto LAB_005f2f46;

      }

    }

LAB_005f2f3a:

    uVar18 = 0x8007000e;

  }

LAB_005f2f46:

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

    FUN_005f28b0(3);

  }

  operator_delete(local_1c);

  operator_delete(local_20);

  operator_delete(piVar6);

  operator_delete(local_10);

  operator_delete((void *)0x0);

  return uVar18;

}





// --- FUN_005f2f85 at 0x005F2F85 (size: 1472) ---


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



undefined4 __fastcall FUN_005f2f85(int *param_1)



{

  float fVar1;

  float fVar2;

  int iVar3;

  int iVar4;

  float fVar5;

  int *piVar6;

  int iVar7;

  int *piVar8;

  int *piVar9;

  uint uVar10;

  int iVar11;

  int *piVar12;

  float *pfVar13;

  float *pfVar14;

  undefined4 uVar15;

  undefined4 *puVar16;

  int *piVar17;

  int *piVar18;

  int local_20;

  int *local_1c;

  int *local_18;

  void *local_10;

  int *local_c;

  int *local_8;

  

  local_1c = (int *)0x0;

  local_c = (int *)0x0;

  local_18 = (int *)0x0;

  local_10 = (void *)0x0;

  if ((*(int *)(param_1[1] + 0x70) != 1) || (*(int *)(*param_1 + 0x70) != 1)) {

    return 0x80004005;

  }

  uVar10 = param_1[2];

  piVar6 = (int *)FUN_005efd4f(*(undefined4 *)(*param_1 + 0x68),*(undefined4 *)(param_1[1] + 0x68),

                               ~(uVar10 >> 0x10) & 1);

  if ((piVar6 == (int *)0x0) ||

     (local_1c = (int *)FUN_005efd4f(*(undefined4 *)(*param_1 + 0x6c),

                                     *(undefined4 *)(param_1[1] + 0x6c),~(uVar10 >> 0x11) & 1),

     local_1c == (int *)0x0)) {

    uVar15 = 0x80004005;

  }

  else {

    iVar3 = *piVar6;

    iVar4 = *local_1c;

    iVar11 = *(int *)(param_1[1] + 0x6c);

    local_c = (int *)FUN_005df0f5(iVar11 * 0xc + 4);

    if (local_c == (int *)0x0) {

      local_c = (int *)0x0;

    }

    else {

      *local_c = iVar11;

      local_c = local_c + 1;

      FUN_00401000(local_c,0xc,iVar11,&LAB_005efd39);

    }

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

      iVar11 = *(int *)(*param_1 + 0x68);

      local_10 = (void *)FUN_005df0f5(iVar11 << 4);

      if (local_10 == (void *)0x0) {

        local_10 = (void *)0x0;

      }

      else {

        FUN_00401000(local_10,0x10,iVar11,&LAB_005eda5e);

      }

      if (local_10 != (void *)0x0) {

        piVar18 = local_1c + 1;

        while (piVar18 < (int *)(iVar4 + (int)local_1c)) {

          piVar12 = (int *)(*piVar18 + (int)piVar18);

          for (piVar8 = piVar18 + 1; piVar18 = piVar12, piVar8 < piVar12; piVar8 = piVar8 + 2) {

            local_c[*piVar8 * 3 + 2] = local_c[*piVar8 * 3 + 2] + 1;

          }

        }

        local_20 = 0;

        piVar18 = local_1c + 1;

        while (piVar18 < (int *)(iVar4 + (int)local_1c)) {

          piVar12 = (int *)(*piVar18 + (int)piVar18);

          piVar18 = piVar18 + 1;

          for (piVar8 = piVar18; piVar8 < piVar12; piVar8 = piVar8 + 2) {

            piVar17 = local_c + *piVar8 * 3;

            if (*piVar17 == 0) {

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

                iVar11 = *(int *)(param_1[1] + 0x68);

                iVar7 = FUN_005df0f5(iVar11 << 4);

                if (iVar7 == 0) {

                  iVar7 = 0;

                }

                else {

                  FUN_00401000(iVar7,0x10,iVar11,&LAB_005eda5e);

                }

                *piVar17 = iVar7;

                if (iVar7 == 0) goto LAB_005f34fb;

              }

              else {

                *piVar17 = *local_18;

                *local_18 = 0;

                local_18 = (int *)local_18[1];

              }

              puVar16 = (undefined4 *)*piVar17;

              for (uVar10 = (uint)(*(int *)(param_1[1] + 0x68) << 4) >> 2; uVar10 != 0;

                  uVar10 = uVar10 - 1) {

                *puVar16 = 0;

                puVar16 = puVar16 + 1;

              }

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

                *(undefined1 *)puVar16 = 0;

                puVar16 = (undefined4 *)((int)puVar16 + 1);

              }

            }

          }

          (**(code **)(*(int *)*param_1 + 4))(local_20,0,local_10);

          if (piVar6 + 1 < (int *)(iVar3 + (int)piVar6)) {

            pfVar13 = (float *)((int)local_10 + 8);

            piVar8 = piVar6 + 1;

            do {

              piVar17 = (int *)(*piVar8 + (int)piVar8);

              if (piVar18 < piVar12) {

                local_8 = piVar18;

                do {

                  iVar11 = local_c[*local_8 * 3];

                  for (piVar9 = piVar8 + 1; piVar9 < piVar17; piVar9 = piVar9 + 2) {

                    fVar5 = (float)piVar9[1] * (float)local_8[1];

                    pfVar14 = (float *)(*piVar9 * 0x10 + iVar11);

                    *pfVar14 = fVar5 * pfVar13[-2] + *pfVar14;

                    pfVar14 = (float *)(*piVar9 * 0x10 + 4 + iVar11);

                    *pfVar14 = fVar5 * pfVar13[-1] + *pfVar14;

                    pfVar14 = (float *)(*piVar9 * 0x10 + 8 + iVar11);

                    *pfVar14 = fVar5 * *pfVar13 + *pfVar14;

                    pfVar14 = (float *)(*piVar9 * 0x10 + 0xc + iVar11);

                    *pfVar14 = fVar5 * pfVar13[1] + *pfVar14;

                  }

                  local_8 = local_8 + 2;

                } while (local_8 < piVar12);

              }

              pfVar13 = pfVar13 + 4;

              piVar8 = piVar17;

            } while (piVar17 < (int *)(iVar3 + (int)piVar6));

          }

          for (; piVar18 < piVar12; piVar18 = piVar18 + 2) {

            piVar17 = local_c + *piVar18 * 3;

            piVar8 = piVar17 + 2;

            *piVar8 = *piVar8 + -1;

            fVar2 = _DAT_0079a1a0;

            fVar5 = _DAT_007938b0;

            if (*piVar8 == 0) {

              iVar11 = *(int *)(*param_1 + 8);

              if (iVar11 == 1) {

                iVar11 = 0;

                uVar10 = 0;

                if (*(int *)(param_1[1] + 0x68) != 0) {

                  do {

                    pfVar13 = (float *)(*piVar17 + iVar11);

                    if (0.0 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar2 = 1.0;

                      }

                      else {

                        fVar2 = *pfVar13;

                      }

                    }

                    else {

                      fVar2 = 0.0;

                    }

                    *pfVar13 = fVar2;

                    pfVar13 = (float *)(*piVar17 + 4 + iVar11);

                    if (0.0 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar2 = 1.0;

                      }

                      else {

                        fVar2 = *pfVar13;

                      }

                    }

                    else {

                      fVar2 = 0.0;

                    }

                    *pfVar13 = fVar2;

                    pfVar13 = (float *)(*piVar17 + 8 + iVar11);

                    if (0.0 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar2 = 1.0;

                      }

                      else {

                        fVar2 = *pfVar13;

                      }

                    }

                    else {

                      fVar2 = 0.0;

                    }

                    *pfVar13 = fVar2;

                    pfVar13 = (float *)(*piVar17 + 0xc + iVar11);

                    if (0.0 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar2 = 1.0;

                      }

                      else {

                        fVar2 = *pfVar13;

                      }

                    }

                    else {

                      fVar2 = 0.0;

                    }

                    *pfVar13 = fVar2;

                    uVar10 = uVar10 + 1;

                    iVar11 = iVar11 + 0x10;

                  } while (uVar10 < *(uint *)(param_1[1] + 0x68));

                }

              }

              else if (iVar11 == 2) {

                iVar11 = 0;

                uVar10 = 0;

                if (*(int *)(param_1[1] + 0x68) != 0) {

                  do {

                    pfVar13 = (float *)(*piVar17 + iVar11);

                    fVar1 = fVar2;

                    if (fVar2 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar1 = 1.0;

                      }

                      else {

                        fVar1 = *pfVar13;

                      }

                    }

                    *pfVar13 = fVar1;

                    pfVar13 = (float *)(*piVar17 + 4 + iVar11);

                    fVar1 = fVar2;

                    if (fVar2 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar1 = 1.0;

                      }

                      else {

                        fVar1 = *pfVar13;

                      }

                    }

                    *pfVar13 = fVar1;

                    pfVar13 = (float *)(*piVar17 + 8 + iVar11);

                    fVar1 = fVar2;

                    if (fVar2 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar1 = 1.0;

                      }

                      else {

                        fVar1 = *pfVar13;

                      }

                    }

                    *pfVar13 = fVar1;

                    pfVar13 = (float *)(*piVar17 + 0xc + iVar11);

                    if (0.0 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar1 = 1.0;

                      }

                      else {

                        fVar1 = *pfVar13;

                      }

                    }

                    else {

                      fVar1 = 0.0;

                    }

                    *pfVar13 = fVar1;

                    uVar10 = uVar10 + 1;

                    iVar11 = iVar11 + 0x10;

                  } while (uVar10 < *(uint *)(param_1[1] + 0x68));

                }

              }

              else if (iVar11 == 3) {

                iVar11 = 0;

                uVar10 = 0;

                if (*(int *)(param_1[1] + 0x68) != 0) {

                  do {

                    pfVar13 = (float *)(*piVar17 + iVar11);

                    fVar1 = fVar2;

                    if (fVar2 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar1 = 1.0;

                      }

                      else {

                        fVar1 = *pfVar13;

                      }

                    }

                    *pfVar13 = fVar1;

                    pfVar13 = (float *)(*piVar17 + 4 + iVar11);

                    fVar1 = fVar2;

                    if (fVar2 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar1 = 1.0;

                      }

                      else {

                        fVar1 = *pfVar13;

                      }

                    }

                    *pfVar13 = fVar1;

                    pfVar13 = (float *)(*piVar17 + 8 + iVar11);

                    fVar1 = fVar2;

                    if (fVar2 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar1 = 1.0;

                      }

                      else {

                        fVar1 = *pfVar13;

                      }

                    }

                    *pfVar13 = fVar1;

                    pfVar13 = (float *)(*piVar17 + 0xc + iVar11);

                    fVar1 = fVar2;

                    if (fVar2 <= *pfVar13) {

                      if (fVar5 <= *pfVar13) {

                        fVar1 = 1.0;

                      }

                      else {

                        fVar1 = *pfVar13;

                      }

                    }

                    *pfVar13 = fVar1;

                    uVar10 = uVar10 + 1;

                    iVar11 = iVar11 + 0x10;

                  } while (uVar10 < *(uint *)(param_1[1] + 0x68));

                }

              }

              (**(code **)(*(int *)param_1[1] + 8))(*piVar18,0,*piVar17);

              piVar17[1] = (int)local_18;

              local_18 = piVar17;

            }

          }

          local_20 = local_20 + 1;

          piVar18 = piVar12;

        }

        uVar15 = 0;

        goto LAB_005f3507;

      }

    }

LAB_005f34fb:

    uVar15 = 0x8007000e;

  }

LAB_005f3507:

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

    FUN_005f28b0(3);

  }

  operator_delete(local_1c);

  operator_delete(piVar6);

  operator_delete(local_10);

  operator_delete((void *)0x0);

  return uVar15;

}





// --- FUN_005f3545 at 0x005F3545 (size: 317) ---


int __thiscall FUN_005f3545(int *param_1,int param_2,int param_3,uint param_4)



{

  int iVar1;

  

  param_1[1] = 0;

  *param_1 = 0;

  param_1[2] = param_4;

  if ((((param_4 & 0xffff) == 0) || (5 < (param_4 & 0xffff))) || ((param_4 & 0xff800000) != 0)) {

    return -0x7789f794;

  }

  *(uint *)(param_3 + 0x48) = param_4 & 0x200000;

  *(uint *)(param_2 + 0x48) = param_4 & 0x400000;

  *(uint *)(param_2 + 0x40) = param_4 & 0x80000;

  *(uint *)(param_2 + 0x44) = param_4 & 0x100000;

  iVar1 = FUN_005fe6c1(param_2);

  param_1[1] = iVar1;

  if (iVar1 != 0) {

    iVar1 = FUN_005fe6c1(param_3);

    *param_1 = iVar1;

    if (iVar1 != 0) {

      iVar1 = FUN_005f535b(iVar1);

      if (iVar1 < 0) goto LAB_005f3653;

      iVar1 = FUN_005f100a();

      if ((((-1 < iVar1) || (iVar1 = FUN_005f1114(), -1 < iVar1)) ||

          ((iVar1 = FUN_005f11e7(), -1 < iVar1 ||

           ((iVar1 = FUN_005f13ba(), -1 < iVar1 || (iVar1 = FUN_005f1590(), -1 < iVar1)))))) ||

         ((iVar1 = FUN_005f1958(), -1 < iVar1 ||

          ((((iVar1 = FUN_005f1e4c(), -1 < iVar1 || (iVar1 = FUN_005f21ee(), -1 < iVar1)) ||

            (iVar1 = FUN_005f2f85(), -1 < iVar1)) || (iVar1 = FUN_005f28ff(), -1 < iVar1)))))) {

        iVar1 = 0;

        goto LAB_005f3653;

      }

    }

  }

  iVar1 = -0x7fffbffb;

LAB_005f3653:

  if ((undefined4 *)param_1[1] != (undefined4 *)0x0) {

    (*(code *)**(undefined4 **)param_1[1])(1);

    param_1[1] = 0;

  }

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

    (*(code *)**(undefined4 **)*param_1)(1);

    *param_1 = 0;

  }

  return iVar1;

}





// --- FUN_005f3682 at 0x005F3682 (size: 19) ---


void __fastcall FUN_005f3682(undefined4 *param_1)



{

  *param_1 = 0;

  param_1[1] = 0;

  param_1[2] = 0;

  param_1[3] = 0;

  param_1[4] = 0;

  return;

}





// --- FUN_005f3695 at 0x005F3695 (size: 223) ---


int FUN_005f3695(int *param_1,int *param_2)



{

  int iVar1;

  uint uVar2;

  undefined4 *puVar3;

  undefined4 *puVar4;

  int local_3c [7];

  uint local_20;

  uint local_1c;

  undefined4 *local_18;

  uint local_14;

  undefined4 *local_10;

  uint local_c;

  uint local_8;

  

  (**(code **)(*param_1 + 0x30))(param_1,local_3c);

  iVar1 = (**(code **)(*param_1 + 0x34))(param_1,&local_14,0,0);

  if (-1 < iVar1) {

    iVar1 = (**(code **)(*param_2 + 0x34))(param_2,&local_1c,0,0);

    if (-1 < iVar1) {

      if ((((local_3c[0] == 0x31545844) || (local_3c[0] == 0x32545844)) ||

          (local_3c[0] == 0x33545844)) ||

         ((local_3c[0] == 0x34545844 || (local_3c[0] == 0x35545844)))) {

        local_20 = local_20 + 3 >> 2;

      }

      local_c = local_1c;

      if ((int)local_14 <= (int)local_1c) {

        local_c = local_14;

      }

      local_8 = 0;

      if (local_20 != 0) {

        do {

          puVar3 = local_10;

          puVar4 = local_18;

          for (uVar2 = local_c >> 2; uVar2 != 0; uVar2 = uVar2 - 1) {

            *puVar4 = *puVar3;

            puVar3 = puVar3 + 1;

            puVar4 = puVar4 + 1;

          }

          for (uVar2 = local_c & 3; uVar2 != 0; uVar2 = uVar2 - 1) {

            *(undefined1 *)puVar4 = *(undefined1 *)puVar3;

            puVar3 = (undefined4 *)((int)puVar3 + 1);

            puVar4 = (undefined4 *)((int)puVar4 + 1);

          }

          local_10 = (undefined4 *)((int)local_10 + local_14);

          local_18 = (undefined4 *)((int)local_18 + local_1c);

          local_8 = local_8 + 1;

        } while (local_8 < local_20);

      }

      iVar1 = 0;

      (**(code **)(*param_2 + 0x38))(param_2);

    }

    (**(code **)(*param_1 + 0x38))(param_1);

  }

  return iVar1;

}





// --- FUN_005f3774 at 0x005F3774 (size: 179) ---


undefined4 __fastcall FUN_005f3774(byte *param_1)



{

  int *piVar1;

  int iVar2;

  

  piVar1 = *(int **)(param_1 + 8);

  if ((piVar1 != (int *)0x0) || (piVar1 = *(int **)(param_1 + 4), piVar1 != (int *)0x0)) {

    (**(code **)(*piVar1 + 0x38))(piVar1);

  }

  if ((((*(int *)(param_1 + 4) != 0) && (*(int *)(param_1 + 8) != 0)) &&

      (*(int *)(param_1 + 0x10) != 0)) && ((*param_1 & 1) == 0)) {

    FUN_005efb7f(1);

    iVar2 = (**(code **)(**(int **)(param_1 + 0x10) + 0x78))

                      (*(int **)(param_1 + 0x10),*(undefined4 *)(param_1 + 8),0,

                       *(undefined4 *)(param_1 + 4),0);

    FUN_005efb7f(0);

    if (iVar2 < 0) {

      FUN_005efb7f(1);

      FUN_005f3695(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 4));

      FUN_005efb7f(0);

    }

  }

  piVar1 = *(int **)(param_1 + 8);

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

    (**(code **)(*piVar1 + 8))(piVar1);

    param_1[8] = 0;

    param_1[9] = 0;

    param_1[10] = 0;

    param_1[0xb] = 0;

  }

  piVar1 = *(int **)(param_1 + 0xc);

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

    (**(code **)(*piVar1 + 8))(piVar1);

    param_1[0xc] = 0;

    param_1[0xd] = 0;

    param_1[0xe] = 0;

    param_1[0xf] = 0;

  }

  piVar1 = *(int **)(param_1 + 0x10);

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

    (**(code **)(*piVar1 + 8))(piVar1);

    param_1[0x10] = 0;

    param_1[0x11] = 0;

    param_1[0x12] = 0;

    param_1[0x13] = 0;

  }

  piVar1 = *(int **)(param_1 + 4);

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

    (**(code **)(*piVar1 + 8))(piVar1);

    param_1[4] = 0;

    param_1[5] = 0;

    param_1[6] = 0;

    param_1[7] = 0;

  }

  return 0;

}





// --- FUN_005f3827 at 0x005F3827 (size: 6) ---


void __fastcall FUN_005f3827(undefined4 *param_1)



{

  *param_1 = 0;

  return;

}





// --- FUN_005f382d at 0x005F382D (size: 36) ---


undefined4 __fastcall FUN_005f382d(int *param_1)



{

  int *piVar1;

  

  piVar1 = (int *)*param_1;

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

    (**(code **)(*piVar1 + 0x28))(piVar1);

    piVar1 = (int *)*param_1;

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

      (**(code **)(*piVar1 + 8))(piVar1);

      *param_1 = 0;

    }

  }

  return 0;

}





// --- thunk_FUN_005f3774 at 0x005F3851 (size: 5) ---


undefined4 __fastcall thunk_FUN_005f3774(byte *param_1)



{

  int *piVar1;

  int iVar2;

  

  piVar1 = *(int **)(param_1 + 8);

  if ((piVar1 != (int *)0x0) || (piVar1 = *(int **)(param_1 + 4), piVar1 != (int *)0x0)) {

    (**(code **)(*piVar1 + 0x38))(piVar1);

  }

  if ((((*(int *)(param_1 + 4) != 0) && (*(int *)(param_1 + 8) != 0)) &&

      (*(int *)(param_1 + 0x10) != 0)) && ((*param_1 & 1) == 0)) {

    FUN_005efb7f(1);

    iVar2 = (**(code **)(**(int **)(param_1 + 0x10) + 0x78))

                      (*(int **)(param_1 + 0x10),*(undefined4 *)(param_1 + 8),0,

                       *(undefined4 *)(param_1 + 4),0);

    FUN_005efb7f(0);

    if (iVar2 < 0) {

      FUN_005efb7f(1);

      FUN_005f3695(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 4));

      FUN_005efb7f(0);

    }

  }

  piVar1 = *(int **)(param_1 + 8);

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

    (**(code **)(*piVar1 + 8))(piVar1);

    param_1[8] = 0;

    param_1[9] = 0;

    param_1[10] = 0;

    param_1[0xb] = 0;

  }

  piVar1 = *(int **)(param_1 + 0xc);

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

    (**(code **)(*piVar1 + 8))(piVar1);

    param_1[0xc] = 0;

    param_1[0xd] = 0;

    param_1[0xe] = 0;

    param_1[0xf] = 0;

  }

  piVar1 = *(int **)(param_1 + 0x10);

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

    (**(code **)(*piVar1 + 8))(piVar1);

    param_1[0x10] = 0;

    param_1[0x11] = 0;

    param_1[0x12] = 0;

    param_1[0x13] = 0;

  }

  piVar1 = *(int **)(param_1 + 4);

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

    (**(code **)(*piVar1 + 8))(piVar1);

    param_1[4] = 0;

    param_1[5] = 0;

    param_1[6] = 0;

    param_1[7] = 0;

  }

  return 0;

}





// --- FUN_005f3856 at 0x005F3856 (size: 1263) ---


int FUN_005f3856(undefined4 *param_1,int *param_2,undefined4 param_3,uint *param_4,

                undefined4 param_5,uint param_6)



{

  uint *puVar1;

  int *piVar2;

  int iVar3;

  uint uVar4;

  uint *puVar5;

  uint *puVar6;

  int local_74 [2];

  byte local_6b;

  int local_68;

  uint local_5c;

  uint local_58;

  uint local_54;

  uint local_50;

  uint local_4c;

  uint local_48;

  uint local_44;

  uint local_40;

  uint local_3c;

  uint local_38;

  undefined4 local_34;

  undefined4 local_30;

  uint local_2c;

  uint local_28;

  uint local_24;

  int *local_20;

  uint local_1c;

  uint *local_18;

  int *local_14;

  int local_10;

  int local_c;

  int local_8;

  

  FUN_005f3774();

  (**(code **)(*param_2 + 0x30))(param_2,local_74);

  puVar5 = local_18;

  if (param_4 == (uint *)0x0) {

    local_3c = local_5c;

    local_38 = local_58;

    local_44 = 0;

    local_40 = 0;

    local_8 = 0;

    local_1c = ~param_6 & 1;

  }

  else {

    local_44 = *param_4;

    local_40 = param_4[1];

    local_3c = param_4[2];

    local_38 = param_4[3];

    if (((((int)local_44 < 0) || (local_5c < local_3c)) || ((int)local_3c < (int)local_44)) ||

       ((((int)local_40 < 0 || (local_58 < local_38)) || ((int)local_38 < (int)local_40)))) {

      return -0x7789f794;

    }

    local_1c = 1;

    if (((local_44 != 0) || (local_3c != local_5c)) ||

       ((local_40 != 0 || (local_8 = 0, local_38 != local_58)))) {

      local_8 = 1;

    }

    if (((param_6 & 1) != 0) || (local_8 != 0)) {

      local_1c = 0;

    }

  }

  local_2c = param_6 & 0x10000;

  if (local_2c != 0) {

    local_28 = local_5c;

    local_24 = local_58;

    local_10 = 0;

    if ((((local_74[0] == 0x31545844) || (local_74[0] == 0x32545844)) || (local_74[0] == 0x33545844)

        ) || ((local_74[0] == 0x34545844 || (local_74[0] == 0x35545844)))) {

      uVar4 = local_58 | local_5c;

      while ((uVar4 & 3) != 0) {

        local_10 = local_10 + 1;

        uVar4 = (local_58 | local_5c) << ((byte)local_10 & 0x1f);

      }

    }

    puVar1 = local_18 + 4;

    (**(code **)(*param_2 + 0xc))(param_2,puVar1);

    puVar5 = puVar5 + 3;

    local_c = (**(code **)(*(int *)*puVar1 + 0x5c))

                        ((int *)*puVar1,local_28 << ((byte)local_10 & 0x1f),

                         local_24 << ((byte)local_10 & 0x1f),local_10 + 1,0,local_74[0],

                         (local_68 == 3) + '\x02',puVar5,0);

    if (-1 < local_c) {

      puVar6 = local_18 + 2;

      local_c = (**(code **)(*(int *)*puVar5 + 0x48))((int *)*puVar5,local_10,puVar6);

      if (-1 < local_c) {

        if (local_1c == 0) {

          local_14 = (int *)0x0;

          FUN_005efb7f(1);

          local_c = FUN_005f3695(param_2,*puVar6);

          FUN_005efb7f(0);

          if (local_c < 0) {

            if ((local_10 == 0) &&

               (local_c = (**(code **)(*(int *)*puVar1 + 0x70))

                                    ((int *)*puVar1,local_28,local_24,local_74[0],0,0,1,&local_14,0)

               , -1 < local_c)) {

              local_c = (**(code **)(*(int *)*puVar1 + 0x88))((int *)*puVar1,param_2,0,local_14,0,0)

              ;

              if (local_c < 0) {

                (**(code **)(*local_14 + 8))(local_14);

              }

              else {

                local_c = FUN_005f3695(local_14,*puVar6);

                (**(code **)(*local_14 + 8))(local_14);

                if (-1 < local_c) goto LAB_005f3a9e;

              }

            }

            piVar2 = (int *)*puVar6;

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

              (**(code **)(*piVar2 + 8))(piVar2);

              *puVar6 = 0;

            }

            goto LAB_005f3a78;

          }

        }

LAB_005f3a9e:

        local_14 = (int *)*puVar6;

        goto LAB_005f3abe;

      }

    }

    piVar2 = (int *)local_18[2];

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

      (**(code **)(*piVar2 + 8))(piVar2);

      local_18[2] = 0;

    }

LAB_005f3a78:

    piVar2 = (int *)*puVar5;

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

      (**(code **)(*piVar2 + 8))(piVar2);

      *puVar5 = 0;

    }

    piVar2 = (int *)*puVar1;

    if (piVar2 == (int *)0x0) {

      return local_c;

    }

    (**(code **)(*piVar2 + 8))(piVar2);

    *puVar1 = 0;

    return local_c;

  }

  local_14 = param_2;

LAB_005f3abe:

  uVar4 = (param_6 & 1 | 0x80) << 4;

  if (((local_1c == 0) || (local_2c != 0)) || ((local_6b & 2) == 0)) {

LAB_005f3b41:

    if (local_8 != 0) {

      if (local_74[0] < 0x34545845) {

        if (((local_74[0] == 0x34545844) || (local_74[0] == 0x31545844)) ||

           (local_74[0] == 0x32545844)) {

LAB_005f3b79:

          local_4c = local_3c + 3 & 0xfffffffc;

          local_54 = local_44 & 0xfffffffc;

          local_50 = local_40 & 0xfffffffc;

          local_48 = local_38 + 3 & 0xfffffffc;

          if (local_5c < local_4c) {

            local_4c = local_5c;

          }

          if (local_58 < local_48) {

            local_48 = local_58;

          }

        }

        else {

          if (local_74[0] != 0x32595559) {

            if (local_74[0] != 0x33545844) goto LAB_005f3bec;

            goto LAB_005f3b79;

          }

LAB_005f3bf8:

          local_54 = local_44 & 0xfffffffe;

          local_4c = local_3c + 1 & 0xfffffffe;

          local_50 = local_40;

          local_48 = local_38;

          if (local_5c < local_4c) {

            local_4c = local_5c;

          }

        }

        if ((((local_54 == 0) && (local_4c == local_5c)) && (local_50 == 0)) &&

           (local_48 == local_58)) {

          local_8 = 0;

        }

        else {

          local_8 = 1;

        }

      }

      else {

        if (local_74[0] == 0x35545844) goto LAB_005f3b79;

        if (((local_74[0] == 0x42475247) || (local_74[0] == 0x47424752)) ||

           (local_74[0] == 0x59565955)) goto LAB_005f3bf8;

LAB_005f3bec:

        local_54 = local_44;

        local_50 = local_40;

        local_4c = local_3c;

        local_48 = local_38;

      }

    }

    if (local_2c != 0) {

      iVar3 = (**(code **)(*local_14 + 0x34))

                        (local_14,&local_34,-(uint)(local_8 != 0) & (uint)&local_54,uVar4);

      if (iVar3 < 0) {

        return iVar3;

      }

      goto LAB_005f3cb8;

    }

  }

  else {

    if ((param_6 & 0x20000) == 0) {

      FUN_005efb7f(1);

      iVar3 = (**(code **)(*param_2 + 0x2c))(param_2,&DAT_007f14f8,&local_20);

      if (-1 < iVar3) {

        iVar3 = (**(code **)(*local_20 + 0x34))(local_20);

        if (iVar3 == 1) {

          uVar4 = uVar4 | 0x2000;

          local_8 = 0;

        }

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

          (**(code **)(*local_20 + 8))(local_20);

          local_20 = (int *)0x0;

        }

      }

      FUN_005efb7f(0);

      goto LAB_005f3b41;

    }

    uVar4 = uVar4 | 0x2000;

    local_8 = 0;

  }

  FUN_005efb7f(1);

  iVar3 = (**(code **)(*local_14 + 0x34))

                    (local_14,&local_34,-(uint)(local_8 != 0) & (uint)&local_54,uVar4);

  FUN_005efb7f(0);

  if (iVar3 < 0) {

    iVar3 = FUN_005f3856(param_1,param_2,param_3,param_4,param_5,param_6 | 0x10000);

    return iVar3;

  }

LAB_005f3cb8:

  if (local_8 != 0) {

    local_44 = local_44 - local_54;

    local_3c = local_3c - local_54;

    local_40 = local_40 - local_50;

    local_38 = local_38 - local_50;

  }

  *param_1 = local_30;

  param_1[1] = local_74[0];

  param_1[2] = local_34;

  param_1[6] = local_5c;

  param_1[7] = local_58;

  param_1[10] = local_44;

  param_1[9] = 1;

  param_1[0xb] = local_40;

  param_1[0xf] = 1;

  param_1[0x10] = 1;

  param_1[0x13] = param_5;

  param_1[0xc] = local_3c;

  param_1[3] = 0;

  param_1[4] = 0;

  param_1[5] = 0;

  param_1[8] = 0;

  param_1[0xe] = 0;

  param_1[0x11] = 0;

  param_1[0x12] = 0;

  param_1[0x14] = param_3;

  param_1[0xd] = local_38;

  local_18[1] = (uint)param_2;

  *local_18 = param_6;

  (**(code **)(*param_2 + 4))(param_2);

  return 0;

}





// --- thunk_FUN_005f382d at 0x005F3D45 (size: 5) ---


undefined4 __fastcall thunk_FUN_005f382d(int *param_1)



{

  int *piVar1;

  

  piVar1 = (int *)*param_1;

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

    (**(code **)(*piVar1 + 0x28))(piVar1);

    piVar1 = (int *)*param_1;

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

      (**(code **)(*piVar1 + 8))(piVar1);

      *param_1 = 0;

    }

  }

  return 0;

}





// --- FUN_005f3d4a at 0x005F3D4A (size: 885) ---


int __thiscall

FUN_005f3d4a(int *param_1,undefined4 *param_2,int *param_3,undefined4 param_4,uint *param_5,

            undefined4 param_6,uint param_7)



{

  bool bVar1;

  uint uVar2;

  uint uVar3;

  int iVar4;

  uint uVar5;

  uint *puVar6;

  uint *puVar7;

  int local_68 [2];

  uint local_60;

  int local_5c;

  uint local_58;

  uint local_54;

  uint local_50;

  uint local_4c [4];

  uint local_3c;

  uint local_38;

  uint local_34 [4];

  uint local_24;

  uint local_20;

  undefined4 local_1c;

  undefined4 local_18;

  undefined4 local_14;

  int *local_10;

  uint local_c;

  int *local_8;

  

  local_10 = param_1;

  if (*param_1 != 0) {

    FUN_005f382d();

  }

  (**(code **)(*param_3 + 0x20))(param_3,local_68);

  if (param_5 == (uint *)0x0) {

    bVar1 = false;

    local_34[2] = local_58;

    local_34[3] = local_54;

    uVar3 = ~param_7 & 1;

    local_34[0] = 0;

    local_34[1] = 0;

    local_24 = 0;

    local_20 = local_50;

  }

  else {

    puVar6 = local_34;

    for (iVar4 = 6; iVar4 != 0; iVar4 = iVar4 + -1) {

      *puVar6 = *param_5;

      param_5 = param_5 + 1;

      puVar6 = puVar6 + 1;

    }

    if (local_58 < local_34[2]) {

      return -0x7789f794;

    }

    if (local_34[2] < local_34[0]) {

      return -0x7789f794;

    }

    if (local_54 < local_34[3]) {

      return -0x7789f794;

    }

    if (local_34[3] < local_34[1]) {

      return -0x7789f794;

    }

    if (local_50 < local_20) {

      return -0x7789f794;

    }

    if (local_20 < local_24) {

      return -0x7789f794;

    }

    if (((((local_34[0] != 0) || (local_34[2] != local_58)) || (local_34[1] != 0)) ||

        ((local_34[3] != local_54 || (local_24 != 0)))) || (bVar1 = false, local_20 != local_50)) {

      bVar1 = true;

    }

    if (((param_7 & 1) != 0) || (bVar1)) {

      uVar3 = 0;

    }

    else {

      uVar3 = 1;

    }

  }

  uVar2 = local_20;

  if ((local_5c == 0) && ((local_60 & 0x200) == 0)) {

    return -0x7789f794;

  }

  uVar5 = (param_7 & 1 | 0x80) << 4;

  local_c = uVar5;

  if ((uVar3 == 0) || ((local_60 & 0x200) == 0)) {

LAB_005f3eb2:

    if (bVar1) {

      if (local_68[0] < 0x34545845) {

        if (((local_68[0] != 0x34545844) && (local_68[0] != 0x31545844)) &&

           (local_68[0] != 0x32545844)) {

          if (local_68[0] == 0x32595559) {

LAB_005f3fba:

            local_4c[3] = local_34[3];

            local_4c[1] = local_34[1];

            local_4c[0] = local_34[0] & 0xfffffffe;

            local_4c[2] = local_34[2] + 1 & 0xfffffffe;

            local_3c = local_24;

            if (local_58 < local_4c[2]) {

              local_4c[2] = local_58;

            }

            local_38 = uVar2;

            if (((local_4c[0] != 0) || (local_4c[2] != local_58)) ||

               ((local_34[1] != 0 ||

                (((local_34[3] != local_54 || (local_24 != 0)) || (uVar2 != local_50))))))

            goto LAB_005f4014;

            goto LAB_005f3f6c;

          }

          if (local_68[0] != 0x33545844) goto LAB_005f3fad;

        }

LAB_005f3ef5:

        local_4c[0] = local_34[0] & 0xfffffffc;

        local_4c[2] = local_34[2] + 3 & 0xfffffffc;

        local_4c[1] = local_34[1] & 0xfffffffc;

        local_4c[3] = local_34[3] + 3 & 0xfffffffc;

        local_3c = local_24;

        if (local_58 < local_4c[2]) {

          local_4c[2] = local_58;

        }

        if (local_54 < local_4c[3]) {

          local_4c[3] = local_54;

        }

        uVar5 = local_c;

        local_38 = uVar2;

        if (((local_4c[0] == 0) && (local_4c[2] == local_58)) &&

           (((local_4c[1] == 0 && ((local_4c[3] == local_54 && (local_24 == 0)))) &&

            (uVar2 == local_50)))) goto LAB_005f3f6c;

      }

      else {

        if (local_68[0] == 0x35545844) goto LAB_005f3ef5;

        if (((local_68[0] == 0x42475247) || (local_68[0] == 0x47424752)) ||

           (local_68[0] == 0x59565955)) goto LAB_005f3fba;

LAB_005f3fad:

        puVar6 = local_34;

        puVar7 = local_4c;

        for (iVar4 = 6; uVar5 = local_c, iVar4 != 0; iVar4 = iVar4 + -1) {

          *puVar7 = *puVar6;

          puVar6 = puVar6 + 1;

          puVar7 = puVar7 + 1;

        }

      }

LAB_005f4014:

      iVar4 = (**(code **)(*param_3 + 0x24))(param_3,&local_1c,local_4c,uVar5);

      if (iVar4 < 0) {

        return iVar4;

      }

      local_34[0] = local_34[0] - local_4c[0];

      local_34[2] = local_34[2] - local_4c[0];

      local_34[1] = local_34[1] - local_4c[1];

      local_34[3] = local_34[3] - local_4c[1];

      local_24 = local_24 - local_3c;

      local_20 = uVar2 - local_3c;

      goto LAB_005f404b;

    }

  }

  else {

    if ((param_7 & 0x20000) == 0) {

      FUN_005efb7f(1);

      iVar4 = (**(code **)(*param_3 + 0x1c))(param_3,&DAT_007f14e8,&local_8);

      if (-1 < iVar4) {

        iVar4 = (**(code **)(*local_8 + 0x34))(local_8);

        if (iVar4 == 1) {

          uVar5 = uVar5 | 0x2000;

          bVar1 = false;

          local_c = uVar5;

        }

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

          (**(code **)(*local_8 + 8))(local_8);

          local_8 = (int *)0x0;

        }

      }

      FUN_005efb7f(0);

      goto LAB_005f3eb2;

    }

    uVar5 = uVar5 | 0x2000;

  }

LAB_005f3f6c:

  iVar4 = (**(code **)(*param_3 + 0x24))(param_3,&local_1c,0,uVar5);

  if (iVar4 < 0) {

    return iVar4;

  }

LAB_005f404b:

  *param_2 = local_14;

  param_2[0x11] = 0;

  param_2[0x12] = 0;

  param_2[1] = local_68[0];

  param_2[2] = local_1c;

  param_2[3] = local_18;

  param_2[4] = 0;

  param_2[5] = 0;

  param_2[8] = 0;

  param_2[9] = local_50;

  puVar6 = local_34;

  puVar7 = param_2 + 10;

  for (iVar4 = 6; iVar4 != 0; iVar4 = iVar4 + -1) {

    *puVar7 = *puVar6;

    puVar6 = puVar6 + 1;

    puVar7 = puVar7 + 1;

  }

  param_2[0x13] = param_6;

  param_2[6] = local_58;

  param_2[0x14] = param_4;

  param_2[7] = local_54;

  param_2[0x10] = 1;

  *local_10 = (int)param_3;

  (**(code **)(*param_3 + 4))(param_3);

  return 0;

}





// --- FUN_005f40bf at 0x005F40BF (size: 40) ---


void __fastcall FUN_005f40bf(undefined4 *param_1)



{

  *param_1 = &PTR_FUN_007ede98;

  operator_delete((void *)param_1[0xe]);

  operator_delete((void *)param_1[0x16]);

  operator_delete((void *)param_1[0x17]);

  return;

}





// --- FUN_005f40ea at 0x005F40EA (size: 1304) ---


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



undefined4 __thiscall FUN_005f40ea(int param_1,int param_2)



{

  float fVar1;

  float fVar2;

  float fVar3;

  float fVar4;

  undefined4 *puVar5;

  float *pfVar6;

  int iVar7;

  uint uVar8;

  

  fVar4 = _DAT_007c6bc4;

  fVar3 = _DAT_0079a1a0;

  fVar1 = _DAT_007938b8;

  fVar2 = _DAT_007938b0;

  iVar7 = *(int *)(param_1 + 8);

  if (iVar7 == 1) {

    iVar7 = *(int *)(param_1 + 0x54);

    if (iVar7 == 2) {

      uVar8 = 0;

      if (*(int *)(param_1 + 0x68) != 0) {

        pfVar6 = (float *)(param_2 + 8);

        iVar7 = 0;

        do {

          uVar8 = uVar8 + 1;

          *(float *)(iVar7 + *(int *)(param_1 + 0x58)) = (pfVar6[-2] + fVar2) * fVar1;

          *(float *)(iVar7 + 4 + *(int *)(param_1 + 0x58)) = (pfVar6[-1] + fVar2) * fVar1;

          *(float *)(iVar7 + 8 + *(int *)(param_1 + 0x58)) = (*pfVar6 + fVar2) * fVar1;

          *(float *)(iVar7 + 0xc + *(int *)(param_1 + 0x58)) = pfVar6[1];

          pfVar6 = pfVar6 + 4;

          iVar7 = iVar7 + 0x10;

        } while (uVar8 < *(uint *)(param_1 + 0x68));

      }

    }

    else if (iVar7 == 3) {

      uVar8 = 0;

      if (*(int *)(param_1 + 0x68) != 0) {

        pfVar6 = (float *)(param_2 + 8);

        iVar7 = 0;

        do {

          uVar8 = uVar8 + 1;

          *(float *)(iVar7 + *(int *)(param_1 + 0x58)) = (pfVar6[-2] + fVar2) * fVar1;

          *(float *)(iVar7 + 4 + *(int *)(param_1 + 0x58)) = (pfVar6[-1] + fVar2) * fVar1;

          *(float *)(iVar7 + 8 + *(int *)(param_1 + 0x58)) = (*pfVar6 + fVar2) * fVar1;

          *(float *)(iVar7 + 0xc + *(int *)(param_1 + 0x58)) = (pfVar6[1] + fVar2) * fVar1;

          pfVar6 = pfVar6 + 4;

          iVar7 = iVar7 + 0x10;

        } while (uVar8 < *(uint *)(param_1 + 0x68));

      }

    }

    else if ((iVar7 == 4) && (uVar8 = 0, *(int *)(param_1 + 0x68) != 0)) {

      pfVar6 = (float *)(param_2 + 8);

      param_2 = -param_2;

      do {

        if (0.0 <= pfVar6[-2]) {

          if (fVar2 <= pfVar6[-2]) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = pfVar6[-2];

          }

        }

        else {

          fVar1 = 0.0;

        }

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2 + -8) = fVar1;

        if (0.0 <= pfVar6[-1]) {

          if (fVar2 <= pfVar6[-1]) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = pfVar6[-1];

          }

        }

        else {

          fVar1 = 0.0;

        }

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2 + -4) = fVar1;

        if (0.0 <= *pfVar6) {

          if (fVar2 <= *pfVar6) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = *pfVar6;

          }

        }

        else {

          fVar1 = 0.0;

        }

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2) = fVar1;

        if (0.0 <= pfVar6[1]) {

          if (fVar2 <= pfVar6[1]) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = pfVar6[1];

          }

        }

        else {

          fVar1 = 0.0;

        }

        uVar8 = uVar8 + 1;

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2 + 4) = fVar1;

        pfVar6 = pfVar6 + 4;

      } while (uVar8 < *(uint *)(param_1 + 0x68));

    }

  }

  else if (iVar7 == 2) {

    iVar7 = *(int *)(param_1 + 0x54);

    if (iVar7 == 1) {

      uVar8 = 0;

      if (*(int *)(param_1 + 0x68) != 0) {

        pfVar6 = (float *)(param_2 + 8);

        iVar7 = 0;

        do {

          uVar8 = uVar8 + 1;

          *(float *)(iVar7 + *(int *)(param_1 + 0x58)) = pfVar6[-2] * fVar4 - fVar2;

          *(float *)(iVar7 + 4 + *(int *)(param_1 + 0x58)) = pfVar6[-1] * fVar4 - fVar2;

          *(float *)(iVar7 + 8 + *(int *)(param_1 + 0x58)) = *pfVar6 * fVar4 - fVar2;

          *(float *)(iVar7 + 0xc + *(int *)(param_1 + 0x58)) = pfVar6[1];

          pfVar6 = pfVar6 + 4;

          iVar7 = iVar7 + 0x10;

        } while (uVar8 < *(uint *)(param_1 + 0x68));

      }

    }

    else if (iVar7 == 3) {

      uVar8 = 0;

      if (*(int *)(param_1 + 0x68) != 0) {

        puVar5 = (undefined4 *)(param_2 + 8);

        iVar7 = 0;

        do {

          *(undefined4 *)(iVar7 + *(int *)(param_1 + 0x58)) = puVar5[-2];

          uVar8 = uVar8 + 1;

          *(undefined4 *)(iVar7 + 4 + *(int *)(param_1 + 0x58)) = puVar5[-1];

          *(undefined4 *)(iVar7 + 8 + *(int *)(param_1 + 0x58)) = *puVar5;

          pfVar6 = (float *)(puVar5 + 1);

          puVar5 = puVar5 + 4;

          *(float *)(iVar7 + 0xc + *(int *)(param_1 + 0x58)) =

               (*pfVar6 + _DAT_007938b0) * _DAT_007938b8;

          iVar7 = iVar7 + 0x10;

        } while (uVar8 < *(uint *)(param_1 + 0x68));

      }

    }

    else if ((iVar7 == 4) && (uVar8 = 0, *(int *)(param_1 + 0x68) != 0)) {

      pfVar6 = (float *)(param_2 + 8);

      param_2 = -param_2;

      do {

        fVar1 = fVar3;

        if (fVar3 <= pfVar6[-2]) {

          if (fVar2 <= pfVar6[-2]) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = pfVar6[-2];

          }

        }

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2 + -8) = fVar1;

        fVar1 = fVar3;

        if (fVar3 <= pfVar6[-1]) {

          if (fVar2 <= pfVar6[-1]) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = pfVar6[-1];

          }

        }

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2 + -4) = fVar1;

        fVar1 = fVar3;

        if (fVar3 <= *pfVar6) {

          if (fVar2 <= *pfVar6) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = *pfVar6;

          }

        }

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2) = fVar1;

        if (0.0 <= pfVar6[1]) {

          if (fVar2 <= pfVar6[1]) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = pfVar6[1];

          }

        }

        else {

          fVar1 = 0.0;

        }

        uVar8 = uVar8 + 1;

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2 + 4) = fVar1;

        pfVar6 = pfVar6 + 4;

      } while (uVar8 < *(uint *)(param_1 + 0x68));

    }

  }

  else if (iVar7 == 3) {

    iVar7 = *(int *)(param_1 + 0x54);

    if (iVar7 == 1) {

      uVar8 = 0;

      if (*(int *)(param_1 + 0x68) != 0) {

        pfVar6 = (float *)(param_2 + 8);

        iVar7 = 0;

        do {

          uVar8 = uVar8 + 1;

          *(float *)(iVar7 + *(int *)(param_1 + 0x58)) = pfVar6[-2] * fVar4 - fVar2;

          *(float *)(iVar7 + 4 + *(int *)(param_1 + 0x58)) = pfVar6[-1] * fVar4 - fVar2;

          *(float *)(iVar7 + 8 + *(int *)(param_1 + 0x58)) = *pfVar6 * fVar4 - fVar2;

          *(float *)(iVar7 + 0xc + *(int *)(param_1 + 0x58)) = pfVar6[1] * fVar4 - fVar2;

          pfVar6 = pfVar6 + 4;

          iVar7 = iVar7 + 0x10;

        } while (uVar8 < *(uint *)(param_1 + 0x68));

      }

    }

    else if (iVar7 == 2) {

      uVar8 = 0;

      if (*(int *)(param_1 + 0x68) != 0) {

        puVar5 = (undefined4 *)(param_2 + 8);

        iVar7 = 0;

        do {

          *(undefined4 *)(iVar7 + *(int *)(param_1 + 0x58)) = puVar5[-2];

          uVar8 = uVar8 + 1;

          *(undefined4 *)(iVar7 + 4 + *(int *)(param_1 + 0x58)) = puVar5[-1];

          *(undefined4 *)(iVar7 + 8 + *(int *)(param_1 + 0x58)) = *puVar5;

          pfVar6 = (float *)(puVar5 + 1);

          puVar5 = puVar5 + 4;

          *(float *)(iVar7 + 0xc + *(int *)(param_1 + 0x58)) = (*pfVar6 + *pfVar6) - _DAT_007938b0;

          iVar7 = iVar7 + 0x10;

        } while (uVar8 < *(uint *)(param_1 + 0x68));

      }

    }

    else if ((iVar7 == 4) && (uVar8 = 0, *(int *)(param_1 + 0x68) != 0)) {

      pfVar6 = (float *)(param_2 + 8);

      param_2 = -param_2;

      do {

        fVar1 = fVar3;

        if (fVar3 <= pfVar6[-2]) {

          if (fVar2 <= pfVar6[-2]) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = pfVar6[-2];

          }

        }

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2 + -8) = fVar1;

        fVar1 = fVar3;

        if (fVar3 <= pfVar6[-1]) {

          if (fVar2 <= pfVar6[-1]) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = pfVar6[-1];

          }

        }

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2 + -4) = fVar1;

        fVar1 = fVar3;

        if (fVar3 <= *pfVar6) {

          if (fVar2 <= *pfVar6) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = *pfVar6;

          }

        }

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2) = fVar1;

        fVar1 = fVar3;

        if (fVar3 <= pfVar6[1]) {

          if (fVar2 <= pfVar6[1]) {

            fVar1 = 1.0;

          }

          else {

            fVar1 = pfVar6[1];

          }

        }

        uVar8 = uVar8 + 1;

        *(float *)((int)pfVar6 + *(int *)(param_1 + 0x58) + param_2 + 4) = fVar1;

        pfVar6 = pfVar6 + 4;

      } while (uVar8 < *(uint *)(param_1 + 0x68));

    }

  }

  return *(undefined4 *)(param_1 + 0x58);

}





// --- FUN_005f4603 at 0x005F4603 (size: 771) ---


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



undefined4 __fastcall FUN_005f4603(int param_1)



{

  float *pfVar1;

  float *pfVar2;

  int iVar3;

  uint uVar4;

  float *pfVar5;

  int iVar6;

  ushort *puVar7;

  undefined2 in_FPUControlWord;

  undefined4 local_10;

  int local_c;

  int local_8;

  

  if (*(int *)(param_1 + 0xa0) == 0) {

    return 0;

  }

  if (*(int *)(param_1 + 0xa4) == 0) {

    return 0;

  }

  pfVar5 = *(float **)(param_1 + 0x80);

  puVar7 = (ushort *)

           (*(int *)(param_1 + 0x94) * *(int *)(param_1 + 100) +

            *(int *)(param_1 + 0x88) * *(int *)(param_1 + 0x60) + *(int *)(param_1 + 0x84) * 2 +

           *(int *)(param_1 + 0x20));

  local_10 = CONCAT22(local_10._2_2_,in_FPUControlWord);

  *(undefined4 *)(param_1 + 0x7c) = local_10;

  iVar3 = *(int *)(param_1 + 4);

  if (iVar3 != 0x32595559) {

    if ((iVar3 == 0x42475247) || (iVar3 == 0x47424752)) {

      for (uVar4 = *(uint *)(param_1 + 0x84); uVar4 < *(uint *)(param_1 + 0x8c); uVar4 = uVar4 + 2)

      {

        *puVar7 = (ushort)((int)ROUND(pfVar5[1] * _DAT_00797188 + _DAT_007938b8) <<

                          ((byte)*(undefined4 *)(param_1 + 0xa8) & 0x1f)) |

                  (ushort)((int)ROUND(*pfVar5 * _DAT_00797188 + _DAT_007938b8) <<

                          ((byte)*(undefined4 *)(param_1 + 0xac) & 0x1f));

        pfVar1 = pfVar5 + 5;

        pfVar2 = pfVar5 + 2;

        pfVar5 = pfVar5 + 8;

        puVar7[1] = (ushort)((int)ROUND(*pfVar1 * _DAT_00797188 + _DAT_007938b8) <<

                            ((byte)*(undefined4 *)(param_1 + 0xa8) & 0x1f)) |

                    (ushort)((int)ROUND(*pfVar2 * _DAT_00797188 + _DAT_007938b8) <<

                            ((byte)*(undefined4 *)(param_1 + 0xac) & 0x1f));

        puVar7 = puVar7 + 2;

      }

      goto LAB_005f48ef;

    }

    if (iVar3 != 0x59565955) goto LAB_005f48ef;

  }

  for (uVar4 = *(uint *)(param_1 + 0x84); uVar4 < *(uint *)(param_1 + 0x8c); uVar4 = uVar4 + 2) {

    iVar3 = (int)ROUND(pfVar5[2] * _DAT_007edec0 +

                       pfVar5[1] * _DAT_007edebc + *pfVar5 * _DAT_007edec4 + _DAT_007938b8) + 0x10;

    local_8 = (int)ROUND(pfVar5[5] * _DAT_007edebc +

                         pfVar5[6] * _DAT_007edec0 + pfVar5[4] * _DAT_007edec4 + _DAT_007938b8) +

              0x10;

    iVar6 = (int)ROUND(((pfVar5[2] * _DAT_007edeb8 - pfVar5[1] * _DAT_007edeb4) -

                       *pfVar5 * _DAT_007edeb0) + _DAT_007938b8) + 0x80;

    local_c = (int)ROUND((*pfVar5 * _DAT_007edeb8 -

                         (pfVar5[2] * _DAT_007edea8 + pfVar5[1] * _DAT_007edeac)) + _DAT_007938b8) +

              0x80;

    if (iVar3 < 0) {

      iVar3 = 0;

    }

    else if (0xff < iVar3) {

      iVar3 = 0xff;

    }

    if (local_8 < 0) {

      local_8 = 0;

    }

    else if (0xff < local_8) {

      local_8 = 0xff;

    }

    if (iVar6 < 0) {

      iVar6 = 0;

    }

    else if (0xff < iVar6) {

      iVar6 = 0xff;

    }

    if (local_c < 0) {

      local_c = 0;

    }

    else if (0xff < local_c) {

      local_c = 0xff;

    }

    pfVar5 = pfVar5 + 8;

    *puVar7 = (ushort)(iVar3 << ((byte)*(undefined4 *)(param_1 + 0xa8) & 0x1f)) |

              (ushort)(iVar6 << ((byte)*(undefined4 *)(param_1 + 0xac) & 0x1f));

    puVar7[1] = (ushort)(local_8 << ((byte)*(undefined4 *)(param_1 + 0xa8) & 0x1f)) |

                (ushort)(local_c << ((byte)*(undefined4 *)(param_1 + 0xac) & 0x1f));

    puVar7 = puVar7 + 2;

  }

LAB_005f48ef:

  *(undefined4 *)(param_1 + 0xa0) = 0;

  return 0;

}





// --- FUN_005f4906 at 0x005F4906 (size: 1671) ---


/* WARNING: Removing unreachable block (ram,0x005f4c57) */

/* WARNING: Removing unreachable block (ram,0x005f4ced) */

/* WARNING: Removing unreachable block (ram,0x005f4e45) */

/* WARNING: Removing unreachable block (ram,0x005f4d95) */

/* WARNING: Removing unreachable block (ram,0x005f4bc0) */

/* WARNING: Removing unreachable block (ram,0x005f4ea5) */

/* WARNING: Removing unreachable block (ram,0x005f4c0b) */

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



int __thiscall FUN_005f4906(int param_1,uint param_2,uint param_3,uint param_4)



{

  ushort uVar1;

  undefined2 uVar2;

  ushort uVar3;

  undefined2 uVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  float fVar9;

  float fVar10;

  float fVar11;

  byte bVar12;

  int iVar13;

  uint uVar14;

  float *pfVar15;

  ushort *puVar16;

  

  if (*(int *)(param_1 + 0xa4) == 0) {

    return -0x7ff8fff2;

  }

  if ((((param_2 < *(uint *)(param_1 + 0x88)) || (*(uint *)(param_1 + 0x90) <= param_2)) ||

      (param_3 < *(uint *)(param_1 + 0x94))) || (*(uint *)(param_1 + 0x98) <= param_3)) {

    iVar13 = FUN_005f4603();

    if (iVar13 < 0) {

      return iVar13;

    }

    *(uint *)(param_1 + 0x90) = param_2 + 1;

    *(uint *)(param_1 + 0x88) = param_2;

    *(uint *)(param_1 + 0x94) = param_3;

    *(uint *)(param_1 + 0x98) = param_3 + 1;

    fVar11 = _DAT_007e6488;

    fVar7 = _DAT_00799208;

    fVar10 = DAT_00796344;

    fVar9 = _DAT_007938b0;

    if (param_4 != 0) {

      param_4 = *(uint *)(param_1 + 0x84);

      pfVar15 = *(float **)(param_1 + 0x80);

      uVar14 = *(uint *)(param_1 + 0x68);

      puVar16 = (ushort *)

                (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                 param_4 * 2 + *(int *)(param_1 + 0x20));

      if ((uVar14 & 1) != 0) {

        uVar14 = uVar14 + 1;

      }

      iVar13 = *(int *)(param_1 + 4);

      if (iVar13 != 0x32595559) {

        if ((iVar13 == 0x42475247) || (iVar13 == 0x47424752)) {

          param_3 = param_4;

          if (*(uint *)(param_1 + 0x8c) <= param_4) {

            return 0;

          }

          do {

            uVar2 = *(undefined2 *)(param_1 + 0xa8);

            uVar1 = *puVar16;

            param_3 = param_3 + 2;

            uVar3 = puVar16[1];

            fVar9 = (float)(uVar1 >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff) * fVar7;

            uVar4 = *(undefined2 *)(param_1 + 0xac);

            pfVar15[5] = (float)(uVar3 >> ((byte)*(undefined2 *)(param_1 + 0xa8) & 0x1f) & 0xff) *

                         fVar7;

            fVar10 = (float)(uVar3 >> ((byte)uVar4 & 0x1f) & 0xff) * fVar7;

            *pfVar15 = fVar9;

            pfVar15[1] = (float)(uVar1 >> ((byte)uVar2 & 0x1f) & 0xff) * fVar7;

            pfVar15[2] = fVar10;

            pfVar15[3] = 1.0;

            pfVar15[4] = fVar9;

            pfVar15[6] = fVar10;

            pfVar15[7] = 1.0;

            pfVar15 = pfVar15 + 8;

            puVar16 = puVar16 + 2;

          } while (param_3 < *(uint *)(param_1 + 0x8c));

          return 0;

        }

        if (iVar13 != 0x59565955) {

          return 0;

        }

      }

      if (param_4 < *(uint *)(param_1 + 0x8c)) {

        do {

          uVar1 = *puVar16;

          if ((param_4 & 1) == 0) {

            bVar12 = (byte)*(undefined2 *)(param_1 + 0xac);

            fVar7 = (float)(uVar1 >> (bVar12 & 0x1f) & 0xff) - fVar11;

            fVar6 = (float)(puVar16[1] >> (bVar12 & 0x1f) & 0xff);

          }

          else if (((param_4 & 1) == 1) && (uVar14 == 2)) {

            bVar12 = (byte)*(undefined2 *)(param_1 + 0xac);

            fVar7 = (float)(puVar16[-1] >> (bVar12 & 0x1f) & 0xff) - fVar11;

            fVar6 = (float)(uVar1 >> (bVar12 & 0x1f) & 0xff);

          }

          else if ((param_4 == 1) && (uVar14 == 4)) {

            fVar7 = (float)((puVar16[1] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff) *

                            8 + (puVar16[-1] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) &

                                0xff) * 8 + 8 >> 4) - fVar11;

            fVar6 = (float)((uVar1 >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff) * 8 +

                            (puVar16[2] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff) *

                            8 + 8 >> 4);

          }

          else if (param_4 == uVar14 - 1) {

            bVar12 = (byte)*(undefined2 *)(param_1 + 0xac);

            fVar7 = (float)(((puVar16[-1] >> (bVar12 & 0x1f) & 0xff) * 0x11 -

                            (puVar16[-3] >> (bVar12 & 0x1f) & 0xff)) + 8 >> 4) - fVar11;

            bVar12 = (byte)*(undefined2 *)(param_1 + 0xac);

            fVar6 = (float)(((uVar1 >> (bVar12 & 0x1f) & 0xff) * 0x11 -

                            (puVar16[-2] >> (bVar12 & 0x1f) & 0xff)) + 8 >> 4);

          }

          else if (param_4 == 1) {

            fVar7 = (float)((((puVar16[1] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff)

                              * 9 + (puVar16[-1] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) &

                                    0xff) * 8) -

                            (puVar16[3] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff)) +

                            8 >> 4) - fVar11;

            fVar6 = (float)((((puVar16[2] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff)

                              * 9 + (uVar1 >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff)

                                    * 8) -

                            (puVar16[4] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff)) +

                            8 >> 4);

          }

          else if (param_4 == uVar14 - 3) {

            fVar7 = (float)((((puVar16[-1] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff)

                              * 9 + (puVar16[1] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) &

                                    0xff) * 8) -

                            (puVar16[-3] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff))

                            + 8 >> 4) - fVar11;

            bVar12 = (byte)*(undefined2 *)(param_1 + 0xac);

            fVar6 = (float)((((puVar16[2] >> (bVar12 & 0x1f) & 0xff) * 8 + 8) -

                            (puVar16[-2] >> (bVar12 & 0x1f) & 0xff)) +

                            (uVar1 >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff) * 9 >>

                           4);

          }

          else {

            bVar12 = (byte)*(undefined2 *)(param_1 + 0xac);

            fVar7 = (float)(((((puVar16[-1] >> (bVar12 & 0x1f) & 0xff) +

                              (puVar16[1] >> (bVar12 & 0x1f) & 0xff)) * 9 -

                             (puVar16[-3] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff))

                            - (puVar16[3] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff))

                            + 8 >> 4) - fVar11;

            bVar12 = (byte)*(undefined2 *)(param_1 + 0xac);

            fVar6 = (float)(((((puVar16[2] >> (bVar12 & 0x1f) & 0xff) +

                              (uVar1 >> (bVar12 & 0x1f) & 0xff)) * 9 -

                             (puVar16[4] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff))

                            - (puVar16[-2] >> ((byte)*(undefined2 *)(param_1 + 0xac) & 0x1f) & 0xff)

                            ) + 8 >> 4);

          }

          fVar8 = ((float)(uVar1 >> ((byte)*(undefined2 *)(param_1 + 0xa8) & 0x1f) & 0xff) -

                  _DAT_007ededc) * _DAT_007eded8;

          fVar5 = (fVar6 - fVar11) * _DAT_007eded4 + fVar8;

          *pfVar15 = fVar5;

          fVar6 = (fVar8 - fVar7 * _DAT_007eded0) - (fVar6 - fVar11) * _DAT_007edecc;

          pfVar15[1] = fVar6;

          fVar8 = fVar7 * _DAT_007edec8 + fVar8;

          pfVar15[2] = fVar8;

          pfVar15[3] = 1.0;

          if (fVar10 <= fVar5) {

            if (fVar9 < fVar5) {

              fVar5 = 1.0;

            }

          }

          else {

            fVar5 = 0.0;

          }

          *pfVar15 = fVar5;

          if (fVar10 <= fVar6) {

            if (fVar9 < fVar6) {

              fVar6 = 1.0;

            }

          }

          else {

            fVar6 = 0.0;

          }

          pfVar15[1] = fVar6;

          if (fVar10 <= fVar8) {

            if (fVar9 < fVar8) {

              fVar8 = 1.0;

            }

          }

          else {

            fVar8 = 0.0;

          }

          pfVar15[2] = fVar8;

          puVar16 = puVar16 + 1;

          param_4 = param_4 + 1;

          pfVar15 = pfVar15 + 4;

        } while (param_4 < *(uint *)(param_1 + 0x8c));

      }

    }

  }

  return 0;

}





// --- FUN_005f4f8d at 0x005F4F8D (size: 133) ---


void __fastcall FUN_005f4f8d(undefined4 *param_1)



{

  uint uVar1;

  uint uVar2;

  int local_8;

  

  *param_1 = &PTR_FUN_007ee1b4;

  if (((param_1[0x3d] != 0) && (local_8 = param_1[0x3e], local_8 != 0)) &&

     (uVar2 = param_1[0x35], uVar2 < (uint)param_1[0x36])) {

    do {

      for (uVar1 = param_1[0x32]; uVar1 < (uint)param_1[0x34]; uVar1 = uVar1 + 4) {

        operator_delete(*(void **)(local_8 + 4));

        local_8 = local_8 + 8;

      }

      uVar2 = uVar2 + 1;

    } while (uVar2 < (uint)param_1[0x36]);

  }

  operator_delete((void *)param_1[0x3c]);

  operator_delete((void *)param_1[0x3e]);

  FUN_005f40bf();

  return;

}





// --- FUN_005f5012 at 0x005F5012 (size: 226) ---


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



void __fastcall FUN_005f5012(int param_1)



{

  float fVar1;

  

  fVar1 = _DAT_0079c6d8;

  if ((*(int *)(param_1 + 4) != 0x32545844) && (*(int *)(param_1 + 4) != 0x33545844)) {

    fVar1 = _DAT_00797188;

  }

  *(float *)(param_1 + 0x80) = fVar1;

  *(float *)(param_1 + 0x84) = 1.0 / fVar1;

  *(float *)(param_1 + 0x24) =

       (float)(int)ROUND(*(float *)(param_1 + 0x24) * _DAT_007edeec + _DAT_007938b8) * _DAT_007edee8

  ;

  *(float *)(param_1 + 0x28) =

       (float)(int)ROUND(*(float *)(param_1 + 0x28) * _DAT_007edee4 + _DAT_007938b8) * _DAT_007edee0

  ;

  *(float *)(param_1 + 0x2c) =

       (float)(int)ROUND(*(float *)(param_1 + 0x2c) * _DAT_007edeec + _DAT_007938b8) * _DAT_007edee8

  ;

  *(float *)(param_1 + 0x30) =

       (float)(int)ROUND(*(float *)(param_1 + 0x80) * *(float *)(param_1 + 0x30) + _DAT_007938b8) *

       *(float *)(param_1 + 0x84);

  return;

}





// --- FUN_005f50f4 at 0x005F50F4 (size: 82) ---


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



float10 FUN_005f50f4(float param_1)



{

  int iVar1;

  float fVar2;

  float10 fVar3;

  

  fVar3 = (float10)FUN_006005ca(param_1);

  fVar2 = (float)(fVar3 * (float10)param_1 * (float10)_DAT_007edef0);

  iVar1 = (int)ROUND(fVar2);

  fVar3 = (float10)iVar1;

  if (iVar1 < 0) {

    fVar3 = fVar3 + (float10)_DAT_0079920c;

  }

  return ((float10)fVar2 - fVar3) *

         ((float10)*(float *)(&DAT_007ed69c + iVar1 * 4) -

         (float10)*(float *)(&DAT_007ed698 + iVar1 * 4)) +

         (float10)*(float *)(&DAT_007ed698 + iVar1 * 4);

}





// --- FUN_005f5146 at 0x005F5146 (size: 73) ---


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



float10 FUN_005f5146(float param_1)



{

  int iVar1;

  float fVar2;

  float10 fVar3;

  

  fVar2 = param_1 * param_1 * _DAT_007edef0;

  iVar1 = (int)ROUND(fVar2);

  fVar3 = (float10)iVar1;

  if (iVar1 < 0) {

    fVar3 = fVar3 + (float10)_DAT_0079920c;

  }

  return ((float10)fVar2 - fVar3) *

         ((float10)*(float *)(&DAT_007eda9c + iVar1 * 4) -

         (float10)*(float *)(&DAT_007eda98 + iVar1 * 4)) +

         (float10)*(float *)(&DAT_007eda98 + iVar1 * 4);

}





// --- FUN_005f518f at 0x005F518F (size: 460) ---


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



undefined4 * __thiscall

FUN_005f518f(undefined4 *param_1,undefined4 *param_2,uint param_3,int param_4)



{

  uint uVar1;

  float fVar2;

  float fVar3;

  float fVar4;

  undefined *puVar5;

  uint uVar6;

  undefined4 uVar7;

  undefined4 *puVar8;

  int iVar9;

  undefined4 *puVar10;

  

  *param_1 = &PTR_FUN_007ede98;

  param_1[8] = *param_2;

  param_1[1] = param_2[1];

  param_1[0x18] = param_2[2];

  param_1[0x19] = param_2[3];

  puVar8 = param_2 + 10;

  puVar10 = param_1 + 0xf;

  for (iVar9 = 6; iVar9 != 0; iVar9 = iVar9 + -1) {

    *puVar10 = *puVar8;

    puVar8 = puVar8 + 1;

    puVar10 = puVar10 + 1;

  }

  puVar5 = &DAT_00825cf8;

  if (param_2[0x10] == 0) {

    puVar5 = &DAT_00825c78;

  }

  param_1[0xd] = puVar5;

  uVar6 = param_3 >> 3;

  param_1[0x1e] = uVar6;

  param_1[0x15] = 0;

  param_1[0x16] = 0;

  param_1[3] = (uint)(param_3 != 0);

  param_1[2] = param_4;

  param_1[6] = param_2[0x13];

  if ((param_1[1] == 0x29) || (param_1[1] == 0x28)) {

    uVar7 = 1;

  }

  else {

    uVar7 = 0;

  }

  param_1[7] = uVar7;

  param_1[0xe] = 0;

  param_1[4] = param_2[0x12];

  param_1[5] = 0;

  param_1[0x17] = 0;

  if (param_1[6] != 0) {

    uVar1 = param_2[0x13];

    fVar2 = (float)(uVar1 >> 8 & 0xff) * _DAT_00799208;

    fVar3 = (float)(uVar1 & 0xff) * _DAT_00799208;

    fVar4 = (float)(uVar1 >> 0x18) * _DAT_00799208;

    param_1[9] = (float)(uVar1 >> 0x10 & 0xff) * _DAT_00799208;

    param_1[10] = fVar2;

    param_1[0xb] = fVar3;

    param_1[0xc] = fVar4;

  }

  if (param_4 == 2) {

    if (param_1[1] == 0x3d) goto LAB_005f52a3;

    param_1[4] = 0;

  }

  if (param_4 == 3) {

    param_1[4] = 0;

  }

LAB_005f52a3:

  iVar9 = param_1[0x11] - param_1[0xf];

  param_1[0x1a] = iVar9;

  param_1[0x1b] = param_1[0x12] - param_1[0x10];

  param_1[0x1d] = iVar9 * uVar6;

  param_1[0x1c] = param_1[0x14] - param_1[0x13];

  if ((param_3 != 0) != 0) {

    param_1[8] = param_1[8] +

                 param_1[0xf] * uVar6 + param_1[0x18] * param_1[0x10] +

                 param_1[0x19] * param_1[0x13];

    param_1[0x11] = param_1[0x1a];

    param_1[0x12] = param_1[0x1b];

    param_1[0xf] = 0;

    param_1[0x10] = 0;

    param_1[0x13] = 0;

    param_1[0x14] = param_1[0x1c];

  }

  if (param_2[0x11] != 0) {

    iVar9 = param_1[0x1a];

    puVar8 = (undefined4 *)FUN_005df0f5((iVar9 + 2) * 0x10);

    if (puVar8 == (undefined4 *)0x0) {

      puVar8 = (undefined4 *)0x0;

    }

    else {

      FUN_00401000(puVar8,0x10,iVar9 + 2,&LAB_005eda5e);

    }

    param_1[0x17] = puVar8;

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

      for (uVar6 = (uint)((param_1[0x1a] + 2) * 0x10) >> 2; uVar6 != 0; uVar6 = uVar6 - 1) {

        *puVar8 = 0;

        puVar8 = puVar8 + 1;

      }

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

        *(undefined1 *)puVar8 = 0;

        puVar8 = (undefined4 *)((int)puVar8 + 1);

      }

    }

  }

  return param_1;

}





// --- FUN_005f535b at 0x005F535B (size: 131) ---


undefined4 __thiscall FUN_005f535b(int param_1,int param_2)



{

  int iVar1;

  int iVar2;

  

  if ((*(int *)(param_1 + 8) != *(int *)(param_2 + 8)) && (*(int *)(param_1 + 8) != 4)) {

    *(int *)(param_1 + 0x54) = *(int *)(param_2 + 8);

  }

  if ((*(int *)(param_1 + 0x54) != 0) || (*(int *)(param_1 + 0x10) != 0)) {

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

    iVar2 = FUN_005df0f5(iVar1 << 4);

    if (iVar2 == 0) {

      iVar2 = 0;

    }

    else {

      FUN_00401000(iVar2,0x10,iVar1,&LAB_005eda5e);

    }

    *(int *)(param_1 + 0x58) = iVar2;

    if (iVar2 == 0) {

      return 0x8007000e;

    }

    if ((*(int *)(param_1 + 0x10) != 0) && (*(int *)(param_2 + 0x10) != 0)) {

      *(undefined4 *)(param_2 + 0x14) = 1;

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

    }

  }

  return 0;

}





// --- FUN_005f53de at 0x005F53DE (size: 245) ---


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



undefined4 __thiscall FUN_005f53de(int param_1,int param_2)



{

  float fVar1;

  int iVar2;

  undefined4 uVar3;

  uint uVar4;

  uint uVar5;

  int iVar6;

  

  iVar2 = FUN_005df0f5(0x1000);

  if (iVar2 == 0) {

    iVar2 = 0;

  }

  else {

    FUN_00401000(iVar2,0x10,0x100,&LAB_005eda5e);

  }

  iVar6 = 0;

  *(int *)(param_1 + 0x38) = iVar2;

  fVar1 = _DAT_00799208;

  if (iVar2 == 0) {

    uVar3 = 0x8007000e;

  }

  else {

    uVar4 = 0;

    if (*(int *)(param_2 + 0x50) == 0) {

      do {

        *(undefined4 *)(uVar4 + 0xc + *(int *)(param_1 + 0x38)) = 0x3f800000;

        *(undefined4 *)(uVar4 + 8 + *(int *)(param_1 + 0x38)) = 0x3f800000;

        *(undefined4 *)(uVar4 + 4 + *(int *)(param_1 + 0x38)) = 0x3f800000;

        *(undefined4 *)(uVar4 + *(int *)(param_1 + 0x38)) = 0x3f800000;

        uVar4 = uVar4 + 0x10;

      } while (uVar4 < 0x1000);

    }

    else {

      do {

        uVar5 = uVar4 + 4;

        *(float *)(iVar6 + *(int *)(param_1 + 0x38)) =

             (float)*(byte *)(uVar4 + *(int *)(param_2 + 0x50)) * fVar1;

        *(float *)(iVar6 + 4 + *(int *)(param_1 + 0x38)) =

             (float)*(byte *)(uVar4 + 1 + *(int *)(param_2 + 0x50)) * fVar1;

        *(float *)(iVar6 + 8 + *(int *)(param_1 + 0x38)) =

             (float)*(byte *)(uVar4 + 2 + *(int *)(param_2 + 0x50)) * fVar1;

        *(float *)(iVar6 + 0xc + *(int *)(param_1 + 0x38)) =

             (float)*(byte *)(uVar4 + 3 + *(int *)(param_2 + 0x50)) * fVar1;

        uVar4 = uVar5;

        iVar6 = iVar6 + 0x10;

      } while (uVar5 < 0x400);

    }

    uVar3 = 0;

  }

  return uVar3;

}





// --- FUN_005f54d3 at 0x005F54D3 (size: 194) ---


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



void __fastcall FUN_005f54d3(int *param_1)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  undefined1 local_18 [16];

  undefined4 local_8;

  

  local_8 = DAT_00836f40;

  iVar1 = param_1[8];

  iVar2 = param_1[0x1d];

  iVar3 = param_1[0xd];

  iVar4 = param_1[6];

  param_1[6] = 0;

  param_1[0x1d] = param_1[0x1e];

  param_1[8] = (int)local_18;

  iVar5 = param_1[0x1a];

  param_1[0x1a] = 1;

  param_1[0xd] = (int)&DAT_00825c78;

  if ((param_1[2] != 1) && (param_1[2] != 4)) {

    iVar6 = param_1[0x15];

    iVar7 = param_1[0x16];

    param_1[0x15] = 1;

    param_1[0x16] = (int)(param_1 + 9);

    FUN_005f40ea(param_1 + 9);

    param_1[0x15] = iVar6;

    param_1[0x16] = iVar7;

  }

  (**(code **)(*param_1 + 8))(0,0,param_1 + 9);

  (**(code **)(*param_1 + 4))(0,0,param_1 + 9);

  param_1[8] = iVar1;

  param_1[0xd] = iVar3;

  param_1[0x1a] = iVar5;

  param_1[0x1d] = iVar2;

  param_1[6] = iVar4;

  return;

}





// --- FUN_005f5595 at 0x005F5595 (size: 122) ---


void __thiscall FUN_005f5595(int param_1,uint param_2)



{

  uint uVar1;

  int iVar2;

  float *pfVar3;

  

  uVar1 = *(int *)(param_1 + 0x68) * 0x10 + param_2;

  if (param_2 < uVar1) {

    iVar2 = ((uVar1 - param_2) - 1 >> 4) + 1;

    pfVar3 = (float *)(param_2 + 8);

    do {

      if ((((pfVar3[-2] == *(float *)(param_1 + 0x24)) && (pfVar3[-1] == *(float *)(param_1 + 0x28))

           ) && (*pfVar3 == *(float *)(param_1 + 0x2c))) &&

         (pfVar3[1] == *(float *)(param_1 + 0x30))) {

        pfVar3[1] = 0.0;

        *pfVar3 = 0.0;

        pfVar3[-1] = 0.0;

        pfVar3[-2] = 0.0;

      }

      pfVar3 = pfVar3 + 4;

      iVar2 = iVar2 + -1;

    } while (iVar2 != 0);

  }

  return;

}





// --- FUN_005f560f at 0x005F560F (size: 499) ---


undefined4 __thiscall FUN_005f560f(int param_1,int param_2)



{

  int iVar1;

  float *pfVar2;

  undefined4 *puVar3;

  undefined2 in_FPUControlWord;

  float10 fVar4;

  undefined4 local_8;

  

  iVar1 = 0;

  if (*(int *)(param_1 + 0x14) == 0) {

    local_8 = CONCAT22((short)((uint)param_1 >> 0x10),in_FPUControlWord);

    *(uint *)(param_1 + 0x7c) = local_8;

    if ((*(int *)(param_1 + 8) == 1) || (*(int *)(param_1 + 8) == 4)) {

      local_8 = 0;

      if (*(int *)(param_1 + 0x68) != 0) {

        puVar3 = (undefined4 *)(param_2 + 8);

        do {

          fVar4 = (float10)FUN_005f50f4(puVar3[-2]);

          *(float *)(iVar1 + *(int *)(param_1 + 0x58)) = (float)fVar4;

          fVar4 = (float10)FUN_005f50f4(puVar3[-1]);

          *(float *)(iVar1 + 4 + *(int *)(param_1 + 0x58)) = (float)fVar4;

          fVar4 = (float10)FUN_005f50f4(*puVar3);

          local_8 = local_8 + 1;

          *(float *)(iVar1 + 8 + *(int *)(param_1 + 0x58)) = (float)fVar4;

          *(undefined4 *)(iVar1 + 0xc + *(int *)(param_1 + 0x58)) = puVar3[1];

          iVar1 = iVar1 + 0x10;

          puVar3 = puVar3 + 4;

        } while (local_8 < *(uint *)(param_1 + 0x68));

      }

    }

    else {

      local_8 = 0;

      if (*(int *)(param_1 + 0x68) != 0) {

        puVar3 = (undefined4 *)(param_2 + 8);

        do {

          *(undefined4 *)(iVar1 + *(int *)(param_1 + 0x58)) = puVar3[-2];

          *(undefined4 *)(iVar1 + 4 + *(int *)(param_1 + 0x58)) = puVar3[-1];

          *(undefined4 *)(iVar1 + 8 + *(int *)(param_1 + 0x58)) = *puVar3;

          fVar4 = (float10)FUN_005f50f4(puVar3[1]);

          local_8 = local_8 + 1;

          *(float *)(iVar1 + 0xc + *(int *)(param_1 + 0x58)) = (float)fVar4;

          iVar1 = iVar1 + 0x10;

          puVar3 = puVar3 + 4;

        } while (local_8 < *(uint *)(param_1 + 0x68));

      }

    }

  }

  else if ((*(int *)(param_1 + 8) == 1) || (*(int *)(param_1 + 8) == 4)) {

    local_8 = 0;

    if (*(int *)(param_1 + 0x68) != 0) {

      iVar1 = -param_2;

      pfVar2 = (float *)(param_2 + 8);

      do {

        fVar4 = (float10)FUN_006005ca(pfVar2[-2]);

        *(float *)((int)pfVar2 + *(int *)(param_1 + 0x58) + iVar1 + -8) =

             (float)(fVar4 * (float10)pfVar2[-2]);

        fVar4 = (float10)FUN_006005ca(pfVar2[-1]);

        *(float *)((int)pfVar2 + *(int *)(param_1 + 0x58) + iVar1 + -4) =

             (float)(fVar4 * (float10)pfVar2[-1]);

        fVar4 = (float10)FUN_006005ca(*pfVar2);

        local_8 = local_8 + 1;

        *(float *)((int)pfVar2 + *(int *)(param_1 + 0x58) + iVar1) =

             (float)(fVar4 * (float10)*pfVar2);

        *(float *)((int)pfVar2 + *(int *)(param_1 + 0x58) + iVar1 + 4) = pfVar2[1];

        pfVar2 = pfVar2 + 4;

      } while (local_8 < *(uint *)(param_1 + 0x68));

    }

  }

  else {

    local_8 = 0;

    if (*(int *)(param_1 + 0x68) != 0) {

      iVar1 = -0xc - param_2;

      pfVar2 = (float *)(param_2 + 0xc);

      do {

        *(float *)((int)pfVar2 + *(int *)(param_1 + 0x58) + iVar1) = pfVar2[-3];

        *(float *)((int)pfVar2 + *(int *)(param_1 + 0x58) + 4 + iVar1) = pfVar2[-2];

        *(float *)((int)pfVar2 + *(int *)(param_1 + 0x58) + 8 + iVar1) = pfVar2[-1];

        fVar4 = (float10)FUN_006005ca(*pfVar2);

        local_8 = local_8 + 1;

        *(float *)((int)pfVar2 + *(int *)(param_1 + 0x58) + 0xc + iVar1) =

             (float)(fVar4 * (float10)*pfVar2);

        pfVar2 = pfVar2 + 4;

      } while (local_8 < *(uint *)(param_1 + 0x68));

    }

  }

  return *(undefined4 *)(param_1 + 0x58);

}





// --- FUN_005f5802 at 0x005F5802 (size: 297) ---


void __thiscall FUN_005f5802(int param_1,uint param_2)



{

  uint uVar1;

  float *pfVar2;

  uint uVar3;

  int iVar4;

  undefined2 in_FPUControlWord;

  float10 fVar5;

  

  uVar1 = param_2;

  uVar3 = *(int *)(param_1 + 0x68) * 0x10 + param_2;

  if (*(int *)(param_1 + 0x14) == 0) {

    param_2 = CONCAT22(param_2._2_2_,in_FPUControlWord);

    *(uint *)(param_1 + 0x7c) = param_2;

    if ((*(int *)(param_1 + 8) == 1) || (*(int *)(param_1 + 8) == 4)) {

      if (uVar1 < uVar3) {

        iVar4 = ((uVar3 - uVar1) - 1 >> 4) + 1;

        pfVar2 = (float *)(uVar1 + 8);

        do {

          fVar5 = (float10)FUN_005f5146(pfVar2[-2]);

          pfVar2[-2] = (float)fVar5;

          fVar5 = (float10)FUN_005f5146(pfVar2[-1]);

          pfVar2[-1] = (float)fVar5;

          fVar5 = (float10)FUN_005f5146(*pfVar2);

          *pfVar2 = (float)fVar5;

          pfVar2 = pfVar2 + 4;

          iVar4 = iVar4 + -1;

        } while (iVar4 != 0);

      }

    }

    else if (uVar1 < uVar3) {

      iVar4 = ((uVar3 - uVar1) - 1 >> 4) + 1;

      pfVar2 = (float *)(uVar1 + 0xc);

      do {

        fVar5 = (float10)FUN_005f5146(*pfVar2);

        *pfVar2 = (float)fVar5;

        pfVar2 = pfVar2 + 4;

        iVar4 = iVar4 + -1;

      } while (iVar4 != 0);

    }

  }

  else if ((*(int *)(param_1 + 8) == 1) || (*(int *)(param_1 + 8) == 4)) {

    if (param_2 < uVar3) {

      pfVar2 = (float *)(param_2 + 8);

      iVar4 = ((uVar3 - param_2) - 1 >> 4) + 1;

      do {

        pfVar2[-2] = pfVar2[-2] * pfVar2[-2];

        pfVar2[-1] = pfVar2[-1] * pfVar2[-1];

        *pfVar2 = *pfVar2 * *pfVar2;

        pfVar2 = pfVar2 + 4;

        iVar4 = iVar4 + -1;

      } while (iVar4 != 0);

    }

  }

  else if (param_2 < uVar3) {

    pfVar2 = (float *)(param_2 + 0xc);

    iVar4 = ((uVar3 - param_2) - 1 >> 4) + 1;

    do {

      *pfVar2 = *pfVar2 * *pfVar2;

      pfVar2 = pfVar2 + 4;

      iVar4 = iVar4 + -1;

    } while (iVar4 != 0);

  }

  return;

}





// --- FUN_005f592b at 0x005F592B (size: 114) ---


void __thiscall FUN_005f592b(int param_1,int param_2)



{

  float *pfVar1;

  float *pfVar2;

  int iVar3;

  uint uVar4;

  undefined4 *puVar5;

  

  uVar4 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    pfVar2 = (float *)(param_2 + 8);

    do {

      pfVar1 = (float *)((int)pfVar2 + *(int *)(param_1 + 0x5c) + (8 - param_2));

      uVar4 = uVar4 + 1;

      pfVar2[-2] = *pfVar1 + pfVar2[-2];

      pfVar2[-1] = pfVar1[1] + pfVar2[-1];

      *pfVar2 = pfVar1[2] + *pfVar2;

      pfVar2[1] = pfVar1[3] + pfVar2[1];

      pfVar2 = pfVar2 + 4;

    } while (uVar4 < *(uint *)(param_1 + 0x68));

  }

  puVar5 = *(undefined4 **)(param_1 + 0x5c);

  for (uVar4 = (uint)((*(int *)(param_1 + 0x68) + 2) * 0x10) >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {

    *puVar5 = 0;

    puVar5 = puVar5 + 1;

  }

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

    *(undefined1 *)puVar5 = 0;

    puVar5 = (undefined4 *)((int)puVar5 + 1);

  }

  return;

}





// --- FUN_005f599d at 0x005F599D (size: 765) ---


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



void __thiscall FUN_005f599d(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  uint uVar8;

  int iVar9;

  uint uVar10;

  int iVar11;

  int iVar12;

  undefined1 uVar13;

  int iVar14;

  int iVar15;

  int iVar16;

  undefined1 *puVar17;

  undefined2 in_FPUControlWord;

  float local_54;

  float local_50;

  float local_4c;

  int local_34;

  int local_30;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  uVar10 = param_2 & 3;

  uVar8 = param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  puVar17 = (undefined1 *)

            ((*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 3 +

             *(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

            *(int *)(param_1 + 0x20));

  if ((param_2 & 1) == 0) {

    iVar15 = 0;

    iVar14 = 1;

    param_2 = 1;

  }

  else {

    iVar15 = *(int *)(param_1 + 0x68) + -1;

    param_2 = -1;

    iVar14 = -1;

  }

  param_3 = CONCAT22(param_3._2_2_,in_FPUControlWord);

  *(uint *)(param_1 + 0x7c) = param_3;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

    iVar14 = param_2;

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar14 * 0x10;

    iVar9 = iVar15 * 0x10;

    iVar12 = (iVar14 + iVar15) * 0x10;

    param_3 = (iVar15 - iVar14) * 0x10;

    param_4 = (float *)(iVar9 + 8 + (int)param_4);

    do {

      fVar7 = _DAT_00799208;

      fVar2 = *(float *)(iVar3 + (uVar8 + uVar10 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_54 + param_4[-2]) * _DAT_00797188;

      fVar5 = (local_50 + param_4[-1]) * _DAT_00797188;

      fVar6 = (local_4c + *param_4) * _DAT_00797188;

      local_34 = (int)ROUND(fVar4 + fVar2);

      local_30 = (int)ROUND(fVar5 + fVar2);

      iVar15 = (int)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + param_3);

        local_54 = (fVar4 - (float)local_34) * _DAT_00799208;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + param_3);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar5 - (float)local_30) * fVar7;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + param_3);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar7 = (fVar6 - (float)iVar15) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar9);

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        local_4c = fVar7 * (float)_DAT_007edef8;

      }

      uVar13 = 0xff;

      iVar16 = local_34;

      if (0xfe < local_34) {

        iVar16 = 0xff;

      }

      if (iVar16 < 1) {

        local_34 = 0;

      }

      else if (0xfe < local_34) {

        local_34 = 0xff;

      }

      iVar16 = local_30;

      if (0xfe < local_30) {

        iVar16 = 0xff;

      }

      if (iVar16 < 1) {

        local_30 = 0;

      }

      else if (0xfe < local_30) {

        local_30 = 0xff;

      }

      iVar16 = iVar15;

      if (0xfe < iVar15) {

        iVar16 = 0xff;

      }

      if (iVar16 < 1) {

        uVar13 = 0;

      }

      else if (iVar15 < 0xff) {

        uVar13 = (undefined1)iVar15;

      }

      *puVar17 = uVar13;

      puVar17[1] = (undefined1)local_30;

      puVar17[2] = (undefined1)local_34;

      param_4 = param_4 + iVar14 * 4;

      param_3 = param_3 + iVar11;

      puVar17 = puVar17 + iVar14 * 3;

      iVar9 = iVar9 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f5c9a at 0x005F5C9A (size: 943) ---


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



void __thiscall FUN_005f5c9a(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  uint uVar13;

  int iVar14;

  int iVar15;

  uint uVar16;

  int iVar17;

  int iVar18;

  ushort in_FPUControlWord;

  float local_58;

  float local_54;

  float local_50;

  float local_4c;

  uint local_38;

  uint local_34;

  uint local_30;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar13 = (uint)param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar18 = 0;

    iVar15 = 1;

  }

  else {

    iVar18 = *(int *)(param_1 + 0x68) + -1;

    iVar15 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar15 * 0x10;

    iVar10 = iVar18 * 0x10;

    param_3 = (float *)(iVar10 + 8 + param_4);

    iVar12 = (iVar15 + iVar18) * 0x10;

    iVar18 = (iVar18 - iVar15) * 0x10;

    do {

      fVar8 = _DAT_00799208;

      fVar2 = *(float *)(iVar3 + (uVar13 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_58 + param_3[-2]) * _DAT_00797188;

      fVar5 = (local_54 + param_3[-1]) * _DAT_00797188;

      fVar6 = (local_50 + *param_3) * _DAT_00797188;

      fVar7 = (local_4c + param_3[1]) * _DAT_00797188;

      local_38 = (uint)ROUND(fVar4 + fVar2);

      local_34 = (uint)ROUND(fVar5 + fVar2);

      local_30 = (uint)ROUND(fVar6 + fVar2);

      iVar14 = (int)ROUND(fVar7 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar18);

        local_58 = (fVar4 - (float)(int)local_38) * _DAT_00799208;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar18);

        local_58 = local_58 * (float)_DAT_007edef8;

        local_54 = (fVar5 - (float)(int)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar18);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar6 - (float)(int)local_30) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar18);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar8 = (fVar7 - (float)iVar14) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar10);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        local_4c = fVar8 * (float)_DAT_007edef8;

      }

      uVar16 = local_38;

      if (0xfe < (int)local_38) {

        uVar16 = 0xff;

      }

      if ((int)uVar16 < 1) {

        local_38 = 0;

      }

      else if (0xfe < (int)local_38) {

        local_38 = 0xff;

      }

      uVar16 = local_34;

      if (0xfe < (int)local_34) {

        uVar16 = 0xff;

      }

      if ((int)uVar16 < 1) {

        local_34 = 0;

      }

      else if (0xfe < (int)local_34) {

        local_34 = 0xff;

      }

      uVar16 = local_30;

      if (0xfe < (int)local_30) {

        uVar16 = 0xff;

      }

      if ((int)uVar16 < 1) {

        local_30 = 0;

      }

      else if (0xfe < (int)local_30) {

        local_30 = 0xff;

      }

      iVar17 = iVar14;

      if (0xfe < iVar14) {

        iVar17 = 0xff;

      }

      if (iVar17 < 1) {

        iVar14 = 0;

      }

      else if (0xfe < iVar14) {

        iVar14 = 0xff;

      }

      *local_8 = ((iVar14 << 8 | local_38) << 8 | local_34) << 8 | local_30;

      local_8 = local_8 + iVar15;

      param_3 = param_3 + iVar15 * 4;

      iVar10 = iVar10 + iVar11;

      iVar18 = iVar18 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f6049 at 0x005F6049 (size: 790) ---


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



void __thiscall FUN_005f6049(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  uint uVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  int iVar14;

  int iVar15;

  uint uVar16;

  ushort in_FPUControlWord;

  float local_54;

  float local_50;

  float local_4c;

  uint local_30;

  uint local_2c;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  uVar8 = param_2 & 3;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * param_3 + *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar14 = 0;

    iVar13 = 1;

  }

  else {

    iVar14 = *(int *)(param_1 + 0x68) + -1;

    iVar13 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = iVar13 * 0x10;

    iVar9 = iVar14 * 0x10;

    iVar11 = (iVar13 + iVar14) * 0x10;

    iVar14 = (iVar14 - iVar13) * 0x10;

    param_4 = (float *)(iVar9 + 8 + (int)param_4);

    do {

      fVar7 = _DAT_00799208;

      fVar2 = *(float *)(iVar3 + ((param_3 & 3) + uVar8 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_54 + param_4[-2]) * _DAT_00797188;

      fVar5 = (local_50 + param_4[-1]) * _DAT_00797188;

      fVar6 = (local_4c + *param_4) * _DAT_00797188;

      iVar12 = (int)ROUND(fVar4 + fVar2);

      local_30 = (uint)ROUND(fVar5 + fVar2);

      local_2c = (uint)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar14);

        local_54 = (fVar4 - (float)iVar12) * _DAT_00799208;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar11);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar14);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar5 - (float)(int)local_30) * fVar7;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar11);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar14);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar7 = (fVar6 - (float)(int)local_2c) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar9);

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar11);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        local_4c = fVar7 * (float)_DAT_007edef8;

      }

      iVar15 = iVar12;

      if (0xfe < iVar12) {

        iVar15 = 0xff;

      }

      if (iVar15 < 1) {

        iVar12 = 0;

      }

      else if (0xfe < iVar12) {

        iVar12 = 0xff;

      }

      uVar16 = local_30;

      if (0xfe < (int)local_30) {

        uVar16 = 0xff;

      }

      if ((int)uVar16 < 1) {

        local_30 = 0;

      }

      else if (0xfe < (int)local_30) {

        local_30 = 0xff;

      }

      uVar16 = local_2c;

      if (0xfe < (int)local_2c) {

        uVar16 = 0xff;

      }

      if ((int)uVar16 < 1) {

        local_2c = 0;

      }

      else if (0xfe < (int)local_2c) {

        local_2c = 0xff;

      }

      *local_8 = (iVar12 << 8 | local_30) << 8 | local_2c;

      local_8 = local_8 + iVar13;

      param_4 = param_4 + iVar13 * 4;

      iVar9 = iVar9 + iVar10;

      iVar14 = iVar14 + iVar10;

      iVar11 = iVar11 + iVar10;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f635f at 0x005F635F (size: 771) ---


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



void __thiscall FUN_005f635f(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  uint uVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  int iVar14;

  uint uVar15;

  int iVar16;

  ushort in_FPUControlWord;

  float local_54;

  float local_50;

  float local_4c;

  uint local_30;

  int local_2c;

  ushort *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  uVar8 = param_2 & 3;

  local_8 = (ushort *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 + *(int *)(param_1 + 100) * param_3

            + *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar14 = 0;

    iVar13 = 1;

  }

  else {

    iVar14 = *(int *)(param_1 + 0x68) + -1;

    iVar13 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = iVar13 * 0x10;

    iVar9 = iVar14 * 0x10;

    iVar11 = (iVar13 + iVar14) * 0x10;

    iVar14 = (iVar14 - iVar13) * 0x10;

    param_4 = (float *)(iVar9 + 8 + (int)param_4);

    do {

      fVar7 = _DAT_007edee8;

      fVar2 = *(float *)(iVar3 + ((param_3 & 3) + uVar8 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_54 + param_4[-2]) * _DAT_007edeec;

      fVar5 = (local_50 + param_4[-1]) * _DAT_007edee4;

      fVar6 = (local_4c + *param_4) * _DAT_007edeec;

      iVar12 = (int)ROUND(fVar4 + fVar2);

      local_30 = (uint)ROUND(fVar5 + fVar2);

      local_2c = (int)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar14);

        local_54 = (fVar4 - (float)iVar12) * _DAT_007edee8;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar11);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar14);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar5 - (float)(int)local_30) * _DAT_007edee0;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar11);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar14);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar7 = (fVar6 - (float)local_2c) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar9);

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar11);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        local_4c = fVar7 * (float)_DAT_007edef8;

      }

      iVar16 = iVar12;

      if (0x1e < iVar12) {

        iVar16 = 0x1f;

      }

      if (iVar16 < 1) {

        iVar12 = 0;

      }

      else if (0x1e < iVar12) {

        iVar12 = 0x1f;

      }

      uVar15 = local_30;

      if (0x3e < (int)local_30) {

        uVar15 = 0x3f;

      }

      if ((int)uVar15 < 1) {

        local_30 = 0;

      }

      else if (0x3e < (int)local_30) {

        local_30 = 0x3f;

      }

      iVar16 = local_2c;

      if (0x1e < local_2c) {

        iVar16 = 0x1f;

      }

      if (iVar16 < 1) {

        local_2c = 0;

      }

      else if (0x1e < local_2c) {

        local_2c = 0x1f;

      }

      *local_8 = (ushort)((iVar12 << 6 | local_30) << 5) | (ushort)local_2c;

      local_8 = local_8 + iVar13;

      param_4 = param_4 + iVar13 * 4;

      iVar9 = iVar9 + iVar10;

      iVar14 = iVar14 + iVar10;

      iVar11 = iVar11 + iVar10;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f6662 at 0x005F6662 (size: 767) ---


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



void __thiscall FUN_005f6662(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  uint uVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  int iVar14;

  uint uVar15;

  int iVar16;

  ushort in_FPUControlWord;

  float local_54;

  float local_50;

  float local_4c;

  uint local_30;

  int local_2c;

  ushort *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  uVar8 = param_2 & 3;

  local_8 = (ushort *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 + *(int *)(param_1 + 100) * param_3

            + *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar14 = 0;

    iVar13 = 1;

  }

  else {

    iVar14 = *(int *)(param_1 + 0x68) + -1;

    iVar13 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = iVar13 * 0x10;

    iVar9 = iVar14 * 0x10;

    iVar11 = (iVar13 + iVar14) * 0x10;

    iVar14 = (iVar14 - iVar13) * 0x10;

    param_4 = (float *)(iVar9 + 8 + (int)param_4);

    do {

      fVar7 = _DAT_007edee8;

      fVar2 = *(float *)(iVar3 + ((param_3 & 3) + uVar8 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_54 + param_4[-2]) * _DAT_007edeec;

      fVar5 = (local_50 + param_4[-1]) * _DAT_007edeec;

      fVar6 = (local_4c + *param_4) * _DAT_007edeec;

      iVar12 = (int)ROUND(fVar4 + fVar2);

      local_30 = (uint)ROUND(fVar5 + fVar2);

      local_2c = (int)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar14);

        local_54 = (fVar4 - (float)iVar12) * _DAT_007edee8;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar11);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar14);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar5 - (float)(int)local_30) * fVar7;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar11);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar14);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar7 = (fVar6 - (float)local_2c) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar9);

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar11);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        local_4c = fVar7 * (float)_DAT_007edef8;

      }

      iVar16 = iVar12;

      if (0x1e < iVar12) {

        iVar16 = 0x1f;

      }

      if (iVar16 < 1) {

        iVar12 = 0;

      }

      else if (0x1e < iVar12) {

        iVar12 = 0x1f;

      }

      uVar15 = local_30;

      if (0x1e < (int)local_30) {

        uVar15 = 0x1f;

      }

      if ((int)uVar15 < 1) {

        local_30 = 0;

      }

      else if (0x1e < (int)local_30) {

        local_30 = 0x1f;

      }

      iVar16 = local_2c;

      if (0x1e < local_2c) {

        iVar16 = 0x1f;

      }

      if (iVar16 < 1) {

        local_2c = 0;

      }

      else if (0x1e < local_2c) {

        local_2c = 0x1f;

      }

      *local_8 = (ushort)((iVar12 << 5 | local_30) << 5) | (ushort)local_2c;

      local_8 = local_8 + iVar13;

      param_4 = param_4 + iVar13 * 4;

      iVar9 = iVar9 + iVar10;

      iVar14 = iVar14 + iVar10;

      iVar11 = iVar11 + iVar10;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f6961 at 0x005F6961 (size: 912) ---


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



void __thiscall FUN_005f6961(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  float fVar3;

  int iVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  uint uVar13;

  int iVar14;

  int iVar15;

  uint uVar16;

  int iVar17;

  int iVar18;

  ushort in_FPUControlWord;

  float local_58;

  float local_54;

  float local_50;

  float local_4c;

  uint local_38;

  uint local_34;

  int local_30;

  ushort *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  local_8 = (ushort *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 +

             *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar13 = (uint)param_3 & 3;

  iVar4 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar18 = 0;

    iVar15 = 1;

  }

  else {

    iVar18 = *(int *)(param_1 + 0x68) + -1;

    iVar15 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar15 * 0x10;

    iVar10 = iVar18 * 0x10;

    param_3 = (float *)(iVar10 + 8 + param_4);

    iVar12 = (iVar15 + iVar18) * 0x10;

    iVar18 = (iVar18 - iVar15) * 0x10;

    do {

      fVar8 = _DAT_007edee8;

      fVar2 = *(float *)(iVar4 + (uVar13 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar5 = (local_58 + param_3[-2]) * _DAT_007edeec;

      fVar6 = (local_54 + param_3[-1]) * _DAT_007edeec;

      fVar7 = (local_50 + *param_3) * _DAT_007edeec;

      fVar3 = param_3[1];

      local_38 = (uint)ROUND(fVar5 + fVar2);

      local_34 = (uint)ROUND(fVar6 + fVar2);

      local_30 = (int)ROUND(fVar7 + fVar2);

      iVar14 = (int)ROUND(local_4c + fVar3 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar18);

        local_58 = (fVar5 - (float)(int)local_38) * _DAT_007edee8;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar18);

        local_58 = local_58 * (float)_DAT_007edef8;

        local_54 = (fVar6 - (float)(int)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar18);

        local_54 = local_54 * (float)_DAT_007edef8;

        fVar8 = (fVar7 - (float)local_30) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar10);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar18);

        local_50 = fVar8 * (float)_DAT_007edef8;

        local_4c = (local_4c + fVar3) - (float)iVar14;

        *pfVar1 = _DAT_007edf08 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar10);

        *pfVar1 = _DAT_007edf04 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar12);

        *pfVar1 = _DAT_007edf00 * local_4c + *pfVar1;

        local_4c = local_4c * (float)_DAT_007edef8;

      }

      uVar16 = local_38;

      if (0x1e < (int)local_38) {

        uVar16 = 0x1f;

      }

      if ((int)uVar16 < 1) {

        local_38 = 0;

      }

      else if (0x1e < (int)local_38) {

        local_38 = 0x1f;

      }

      uVar16 = local_34;

      if (0x1e < (int)local_34) {

        uVar16 = 0x1f;

      }

      if ((int)uVar16 < 1) {

        local_34 = 0;

      }

      else if (0x1e < (int)local_34) {

        local_34 = 0x1f;

      }

      iVar17 = local_30;

      if (0x1e < local_30) {

        iVar17 = 0x1f;

      }

      if (iVar17 < 1) {

        local_30 = 0;

      }

      else if (0x1e < local_30) {

        local_30 = 0x1f;

      }

      iVar17 = iVar14;

      if (0 < iVar14) {

        iVar17 = 1;

      }

      if (iVar17 < 1) {

        iVar14 = 0;

      }

      else if (0 < iVar14) {

        iVar14 = 1;

      }

      *local_8 = (ushort)(((iVar14 << 5 | local_38) << 5 | local_34) << 5) | (ushort)local_30;

      local_8 = local_8 + iVar15;

      param_3 = param_3 + iVar15 * 4;

      iVar10 = iVar10 + iVar11;

      iVar18 = iVar18 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f6cf1 at 0x005F6CF1 (size: 912) ---


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



void __thiscall FUN_005f6cf1(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  uint uVar13;

  int iVar14;

  int iVar15;

  uint uVar16;

  int iVar17;

  int iVar18;

  ushort in_FPUControlWord;

  float local_58;

  float local_54;

  float local_50;

  float local_4c;

  uint local_38;

  uint local_34;

  int local_30;

  ushort *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  local_8 = (ushort *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 +

             *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar13 = (uint)param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar18 = 0;

    iVar15 = 1;

  }

  else {

    iVar18 = *(int *)(param_1 + 0x68) + -1;

    iVar15 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar15 * 0x10;

    iVar10 = iVar18 * 0x10;

    param_3 = (float *)(iVar10 + 8 + param_4);

    iVar12 = (iVar15 + iVar18) * 0x10;

    iVar18 = (iVar18 - iVar15) * 0x10;

    do {

      fVar8 = _DAT_0079cc80;

      fVar2 = *(float *)(iVar3 + (uVar13 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_58 + param_3[-2]) * _DAT_0079c6d8;

      fVar5 = (local_54 + param_3[-1]) * _DAT_0079c6d8;

      fVar6 = (local_50 + *param_3) * _DAT_0079c6d8;

      fVar7 = (local_4c + param_3[1]) * _DAT_0079c6d8;

      local_38 = (uint)ROUND(fVar4 + fVar2);

      local_34 = (uint)ROUND(fVar5 + fVar2);

      local_30 = (int)ROUND(fVar6 + fVar2);

      iVar14 = (int)ROUND(fVar7 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar18);

        local_58 = (fVar4 - (float)(int)local_38) * _DAT_0079cc80;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar18);

        local_58 = local_58 * (float)_DAT_007edef8;

        local_54 = (fVar5 - (float)(int)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar18);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar6 - (float)local_30) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar18);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar8 = (fVar7 - (float)iVar14) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar10);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        local_4c = fVar8 * (float)_DAT_007edef8;

      }

      uVar16 = local_38;

      if (0xe < (int)local_38) {

        uVar16 = 0xf;

      }

      if ((int)uVar16 < 1) {

        local_38 = 0;

      }

      else if (0xe < (int)local_38) {

        local_38 = 0xf;

      }

      uVar16 = local_34;

      if (0xe < (int)local_34) {

        uVar16 = 0xf;

      }

      if ((int)uVar16 < 1) {

        local_34 = 0;

      }

      else if (0xe < (int)local_34) {

        local_34 = 0xf;

      }

      iVar17 = local_30;

      if (0xe < local_30) {

        iVar17 = 0xf;

      }

      if (iVar17 < 1) {

        local_30 = 0;

      }

      else if (0xe < local_30) {

        local_30 = 0xf;

      }

      iVar17 = iVar14;

      if (0xe < iVar14) {

        iVar17 = 0xf;

      }

      if (iVar17 < 1) {

        iVar14 = 0;

      }

      else if (0xe < iVar14) {

        iVar14 = 0xf;

      }

      *local_8 = (ushort)(((iVar14 << 4 | local_38) << 4 | local_34) << 4) | (ushort)local_30;

      local_8 = local_8 + iVar15;

      param_3 = param_3 + iVar15 * 4;

      iVar10 = iVar10 + iVar11;

      iVar18 = iVar18 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f7081 at 0x005F7081 (size: 789) ---


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



void __thiscall FUN_005f7081(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  uint uVar8;

  int iVar9;

  uint uVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  byte *pbVar14;

  int iVar15;

  undefined2 in_FPUControlWord;

  float local_58;

  float local_54;

  float local_50;

  int local_34;

  int local_30;

  int local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_50 = 0.0;

  uVar8 = param_2 & 3;

  uVar10 = param_3 & 3;

  pbVar14 = (byte *)((*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) +

                     *(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                    *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    local_8 = 0;

    param_2 = 1;

  }

  else {

    local_8 = *(int *)(param_1 + 0x68) + -1;

    param_2 = -1;

  }

  param_3 = CONCAT22(param_3._2_2_,in_FPUControlWord);

  *(uint *)(param_1 + 0x7c) = param_3;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_3 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = param_2 * 0x10;

    iVar9 = local_8 * 0x10;

    iVar15 = (param_2 + local_8) * 0x10;

    local_8 = (local_8 - param_2) * 0x10;

    param_4 = (float *)(iVar9 + 8 + (int)param_4);

    do {

      fVar7 = _DAT_007edf0c;

      fVar2 = *(float *)(iVar3 + (uVar10 + uVar8 * 8) * 4 + (param_3 & 3) * 4);

      fVar4 = (local_58 + param_4[-2]) * _DAT_007cb7b4;

      fVar5 = (local_54 + param_4[-1]) * _DAT_007cb7b4;

      fVar6 = (local_50 + *param_4) * _DAT_007938bc;

      iVar12 = (int)ROUND(fVar4 + fVar2);

      local_34 = (int)ROUND(fVar5 + fVar2);

      local_30 = (int)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + local_8);

        local_58 = (fVar4 - (float)iVar12) * _DAT_007edf0c;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar15);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + local_8);

        local_58 = local_58 * (float)_DAT_007edef8;

        fVar7 = (fVar5 - (float)local_34) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar9);

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar15);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + local_8);

        local_54 = fVar7 * (float)_DAT_007edef8;

        local_50 = (fVar6 - (float)local_30) * _DAT_007e75f0;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar15);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        local_50 = local_50 * (float)_DAT_007edef8;

      }

      iVar13 = iVar12;

      if (6 < iVar12) {

        iVar13 = 7;

      }

      if (iVar13 < 1) {

        iVar12 = 0;

      }

      else if (6 < iVar12) {

        iVar12 = 7;

      }

      iVar13 = local_34;

      if (6 < local_34) {

        iVar13 = 7;

      }

      if (iVar13 < 1) {

        local_34 = 0;

      }

      else if (6 < local_34) {

        local_34 = 7;

      }

      iVar13 = local_30;

      if (2 < local_30) {

        iVar13 = 3;

      }

      if (iVar13 < 1) {

        local_30 = 0;

      }

      else if (2 < local_30) {

        local_30 = 3;

      }

      *pbVar14 = ((char)iVar12 << 3 | (byte)local_34) << 2 | (byte)local_30;

      pbVar14 = pbVar14 + param_2;

      param_4 = param_4 + param_2 * 4;

      local_8 = local_8 + iVar11;

      iVar9 = iVar9 + iVar11;

      iVar15 = iVar15 + iVar11;

      param_3 = param_3 + 1;

    } while (param_3 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f7396 at 0x005F7396 (size: 449) ---


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



void __thiscall FUN_005f7396(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  int iVar2;

  float fVar3;

  uint uVar4;

  int iVar5;

  uint uVar6;

  int iVar7;

  int iVar8;

  int iVar9;

  int iVar10;

  undefined1 *puVar11;

  undefined2 in_FPUControlWord;

  float local_2c;

  int local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_2c = 0.0;

  uVar4 = param_2 & 3;

  uVar6 = param_3 & 3;

  iVar2 = *(int *)(param_1 + 0x34);

  puVar11 = (undefined1 *)

            ((*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) + *(int *)(param_1 + 0x60) * param_2 +

             *(int *)(param_1 + 100) * param_3 + *(int *)(param_1 + 0x20));

  if ((param_2 & 1) == 0) {

    iVar9 = 0;

    param_2 = 1;

  }

  else {

    iVar9 = *(int *)(param_1 + 0x68) + -1;

    param_2 = -1;

  }

  param_3 = CONCAT22(param_3._2_2_,in_FPUControlWord);

  *(uint *)(param_1 + 0x7c) = param_3;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_3 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar7 = param_2 * 0x10;

    iVar5 = iVar9 * 0x10;

    iVar8 = (param_2 + iVar9) * 0x10;

    local_8 = (iVar9 - param_2) * 0x10;

    param_4 = (float *)(iVar5 + 0xc + (int)param_4);

    do {

      fVar3 = (local_2c + *param_4) * _DAT_00797188;

      iVar9 = (int)ROUND(fVar3 + *(float *)(iVar2 + (uVar6 + uVar4 * 8) * 4 + (param_3 & 3) * 4));

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(local_8 + 0x1c + *(int *)(param_1 + 0x5c));

        local_2c = (fVar3 - (float)iVar9) * _DAT_00799208;

        *pfVar1 = _DAT_007edf08 * local_2c + *pfVar1;

        pfVar1 = (float *)(iVar5 + 0x1c + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf04 * local_2c + *pfVar1;

        pfVar1 = (float *)(iVar8 + 0x1c + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf00 * local_2c + *pfVar1;

        local_2c = local_2c * (float)_DAT_007edef8;

      }

      iVar10 = iVar9;

      if (0xfe < iVar9) {

        iVar10 = 0xff;

      }

      if (iVar10 < 1) {

        iVar9 = 0;

      }

      else if (0xfe < iVar9) {

        iVar9 = 0xff;

      }

      *puVar11 = (char)iVar9;

      param_4 = param_4 + param_2 * 4;

      local_8 = local_8 + iVar7;

      puVar11 = puVar11 + param_2;

      iVar5 = iVar5 + iVar7;

      iVar8 = iVar8 + iVar7;

      param_3 = param_3 + 1;

    } while (param_3 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f7557 at 0x005F7557 (size: 920) ---


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



void __thiscall FUN_005f7557(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  uint uVar13;

  int iVar14;

  uint uVar15;

  int iVar16;

  int iVar17;

  int iVar18;

  ushort in_FPUControlWord;

  float local_58;

  float local_54;

  float local_50;

  float local_4c;

  uint local_38;

  uint local_34;

  int local_30;

  ushort *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  local_8 = (ushort *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 +

             *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar13 = (uint)param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar18 = 0;

    iVar14 = 1;

  }

  else {

    iVar18 = *(int *)(param_1 + 0x68) + -1;

    iVar14 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar14 * 0x10;

    iVar10 = iVar18 * 0x10;

    iVar12 = (iVar14 + iVar18) * 0x10;

    iVar18 = (iVar18 - iVar14) * 0x10;

    param_3 = (float *)(iVar10 + 8 + param_4);

    do {

      fVar8 = _DAT_007edf0c;

      fVar2 = *(float *)(iVar3 + (uVar13 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_58 + param_3[-2]) * _DAT_007cb7b4;

      fVar5 = (local_54 + param_3[-1]) * _DAT_007cb7b4;

      fVar6 = (local_50 + *param_3) * _DAT_007938bc;

      fVar7 = (local_4c + param_3[1]) * _DAT_00797188;

      local_38 = (uint)ROUND(fVar4 + fVar2);

      local_34 = (uint)ROUND(fVar5 + fVar2);

      local_30 = (int)ROUND(fVar6 + fVar2);

      iVar17 = (int)ROUND(fVar7 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar18);

        local_58 = (fVar4 - (float)(int)local_38) * _DAT_007edf0c;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar18);

        local_58 = local_58 * (float)_DAT_007edef8;

        fVar8 = (fVar5 - (float)(int)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar10);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar18);

        local_54 = fVar8 * (float)_DAT_007edef8;

        local_50 = (fVar6 - (float)local_30) * _DAT_007e75f0;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar18);

        local_50 = local_50 * (float)_DAT_007edef8;

        local_4c = (fVar7 - (float)iVar17) * _DAT_00799208;

        *pfVar1 = _DAT_007edf08 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar10);

        *pfVar1 = _DAT_007edf04 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar12);

        *pfVar1 = _DAT_007edf00 * local_4c + *pfVar1;

        local_4c = local_4c * (float)_DAT_007edef8;

      }

      uVar15 = local_38;

      if (6 < (int)local_38) {

        uVar15 = 7;

      }

      if ((int)uVar15 < 1) {

        local_38 = 0;

      }

      else if (6 < (int)local_38) {

        local_38 = 7;

      }

      uVar15 = local_34;

      if (6 < (int)local_34) {

        uVar15 = 7;

      }

      if ((int)uVar15 < 1) {

        local_34 = 0;

      }

      else if (6 < (int)local_34) {

        local_34 = 7;

      }

      iVar16 = local_30;

      if (2 < local_30) {

        iVar16 = 3;

      }

      if (iVar16 < 1) {

        local_30 = 0;

      }

      else if (2 < local_30) {

        local_30 = 3;

      }

      iVar16 = iVar17;

      if (0xfe < iVar17) {

        iVar16 = 0xff;

      }

      if (iVar16 < 1) {

        iVar17 = 0;

      }

      else if (0xfe < iVar17) {

        iVar17 = 0xff;

      }

      *local_8 = (ushort)(((iVar17 << 3 | local_38) << 3 | local_34) << 2) | (ushort)local_30;

      local_8 = local_8 + iVar14;

      param_3 = param_3 + iVar14 * 4;

      iVar10 = iVar10 + iVar11;

      iVar18 = iVar18 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f78ef at 0x005F78EF (size: 767) ---


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



void __thiscall FUN_005f78ef(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  uint uVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  int iVar14;

  uint uVar15;

  int iVar16;

  ushort in_FPUControlWord;

  float local_54;

  float local_50;

  float local_4c;

  uint local_30;

  int local_2c;

  ushort *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  uVar8 = param_2 & 3;

  local_8 = (ushort *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 + *(int *)(param_1 + 100) * param_3

            + *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar14 = 0;

    iVar13 = 1;

  }

  else {

    iVar14 = *(int *)(param_1 + 0x68) + -1;

    iVar13 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = iVar13 * 0x10;

    iVar9 = iVar14 * 0x10;

    iVar11 = (iVar13 + iVar14) * 0x10;

    iVar14 = (iVar14 - iVar13) * 0x10;

    param_4 = (float *)(iVar9 + 8 + (int)param_4);

    do {

      fVar7 = _DAT_0079cc80;

      fVar2 = *(float *)(iVar3 + ((param_3 & 3) + uVar8 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_54 + param_4[-2]) * _DAT_0079c6d8;

      fVar5 = (local_50 + param_4[-1]) * _DAT_0079c6d8;

      fVar6 = (local_4c + *param_4) * _DAT_0079c6d8;

      iVar12 = (int)ROUND(fVar4 + fVar2);

      local_30 = (uint)ROUND(fVar5 + fVar2);

      local_2c = (int)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar14);

        local_54 = (fVar4 - (float)iVar12) * _DAT_0079cc80;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar11);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar14);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar5 - (float)(int)local_30) * fVar7;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar11);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar14);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar7 = (fVar6 - (float)local_2c) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar9);

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar11);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        local_4c = fVar7 * (float)_DAT_007edef8;

      }

      iVar16 = iVar12;

      if (0xe < iVar12) {

        iVar16 = 0xf;

      }

      if (iVar16 < 1) {

        iVar12 = 0;

      }

      else if (0xe < iVar12) {

        iVar12 = 0xf;

      }

      uVar15 = local_30;

      if (0xe < (int)local_30) {

        uVar15 = 0xf;

      }

      if ((int)uVar15 < 1) {

        local_30 = 0;

      }

      else if (0xe < (int)local_30) {

        local_30 = 0xf;

      }

      iVar16 = local_2c;

      if (0xe < local_2c) {

        iVar16 = 0xf;

      }

      if (iVar16 < 1) {

        local_2c = 0;

      }

      else if (0xe < local_2c) {

        local_2c = 0xf;

      }

      *local_8 = (ushort)((iVar12 << 4 | local_30) << 4) | (ushort)local_2c;

      local_8 = local_8 + iVar13;

      param_4 = param_4 + iVar13 * 4;

      iVar9 = iVar9 + iVar10;

      iVar14 = iVar14 + iVar10;

      iVar11 = iVar11 + iVar10;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f7bee at 0x005F7BEE (size: 949) ---


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



void __thiscall FUN_005f7bee(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  uint uVar13;

  int iVar14;

  int iVar15;

  uint uVar16;

  int iVar17;

  int iVar18;

  ushort in_FPUControlWord;

  float local_58;

  float local_54;

  float local_50;

  float local_4c;

  uint local_38;

  uint local_34;

  uint local_30;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar13 = (uint)param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar18 = 0;

    iVar15 = 1;

  }

  else {

    iVar18 = *(int *)(param_1 + 0x68) + -1;

    iVar15 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar15 * 0x10;

    iVar10 = iVar18 * 0x10;

    param_3 = (float *)(iVar10 + 8 + param_4);

    iVar12 = (iVar15 + iVar18) * 0x10;

    iVar18 = (iVar18 - iVar15) * 0x10;

    do {

      fVar8 = _DAT_007edf10;

      fVar2 = *(float *)(iVar3 + (uVar13 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_58 + param_3[-2]) * _DAT_007edf14;

      fVar5 = (local_54 + param_3[-1]) * _DAT_007edf14;

      fVar6 = (local_50 + *param_3) * _DAT_007edf14;

      fVar7 = (local_4c + param_3[1]) * _DAT_007938bc;

      local_38 = (uint)ROUND(fVar4 + fVar2);

      local_34 = (uint)ROUND(fVar5 + fVar2);

      local_30 = (uint)ROUND(fVar6 + fVar2);

      iVar14 = (int)ROUND(fVar7 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar18);

        local_58 = (fVar4 - (float)(int)local_38) * _DAT_007edf10;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar18);

        local_58 = local_58 * (float)_DAT_007edef8;

        local_54 = (fVar5 - (float)(int)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar18);

        local_54 = local_54 * (float)_DAT_007edef8;

        fVar8 = (fVar6 - (float)(int)local_30) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar10);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar18);

        local_50 = fVar8 * (float)_DAT_007edef8;

        local_4c = (fVar7 - (float)iVar14) * _DAT_007e75f0;

        *pfVar1 = _DAT_007edf08 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar10);

        *pfVar1 = _DAT_007edf04 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar12);

        *pfVar1 = _DAT_007edf00 * local_4c + *pfVar1;

        local_4c = local_4c * (float)_DAT_007edef8;

      }

      uVar16 = local_38;

      if (0x3fe < (int)local_38) {

        uVar16 = 0x3ff;

      }

      if ((int)uVar16 < 1) {

        local_38 = 0;

      }

      else if (0x3fe < (int)local_38) {

        local_38 = 0x3ff;

      }

      uVar16 = local_34;

      if (0x3fe < (int)local_34) {

        uVar16 = 0x3ff;

      }

      if ((int)uVar16 < 1) {

        local_34 = 0;

      }

      else if (0x3fe < (int)local_34) {

        local_34 = 0x3ff;

      }

      uVar16 = local_30;

      if (0x3fe < (int)local_30) {

        uVar16 = 0x3ff;

      }

      if ((int)uVar16 < 1) {

        local_30 = 0;

      }

      else if (0x3fe < (int)local_30) {

        local_30 = 0x3ff;

      }

      iVar17 = iVar14;

      if (2 < iVar14) {

        iVar17 = 3;

      }

      if (iVar17 < 1) {

        iVar14 = 0;

      }

      else if (2 < iVar14) {

        iVar14 = 3;

      }

      *local_8 = ((iVar14 << 10 | local_30) << 10 | local_34) << 10 | local_38;

      local_8 = local_8 + iVar15;

      param_3 = param_3 + iVar15 * 4;

      iVar10 = iVar10 + iVar11;

      iVar18 = iVar18 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f7fa3 at 0x005F7FA3 (size: 943) ---


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



void __thiscall FUN_005f7fa3(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  uint uVar13;

  int iVar14;

  int iVar15;

  uint uVar16;

  int iVar17;

  int iVar18;

  ushort in_FPUControlWord;

  float local_58;

  float local_54;

  float local_50;

  float local_4c;

  uint local_38;

  uint local_34;

  uint local_30;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar13 = (uint)param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar18 = 0;

    iVar15 = 1;

  }

  else {

    iVar18 = *(int *)(param_1 + 0x68) + -1;

    iVar15 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar15 * 0x10;

    iVar10 = iVar18 * 0x10;

    param_3 = (float *)(iVar10 + 8 + param_4);

    iVar12 = (iVar15 + iVar18) * 0x10;

    iVar18 = (iVar18 - iVar15) * 0x10;

    do {

      fVar8 = _DAT_00799208;

      fVar2 = *(float *)(iVar3 + (uVar13 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_58 + param_3[-2]) * _DAT_00797188;

      fVar5 = (local_54 + param_3[-1]) * _DAT_00797188;

      fVar6 = (local_50 + *param_3) * _DAT_00797188;

      fVar7 = (local_4c + param_3[1]) * _DAT_00797188;

      local_38 = (uint)ROUND(fVar4 + fVar2);

      local_34 = (uint)ROUND(fVar5 + fVar2);

      local_30 = (uint)ROUND(fVar6 + fVar2);

      iVar14 = (int)ROUND(fVar7 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar18);

        local_58 = (fVar4 - (float)(int)local_38) * _DAT_00799208;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar18);

        local_58 = local_58 * (float)_DAT_007edef8;

        local_54 = (fVar5 - (float)(int)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar18);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar6 - (float)(int)local_30) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar18);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar8 = (fVar7 - (float)iVar14) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar10);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        local_4c = fVar8 * (float)_DAT_007edef8;

      }

      uVar16 = local_38;

      if (0xfe < (int)local_38) {

        uVar16 = 0xff;

      }

      if ((int)uVar16 < 1) {

        local_38 = 0;

      }

      else if (0xfe < (int)local_38) {

        local_38 = 0xff;

      }

      uVar16 = local_34;

      if (0xfe < (int)local_34) {

        uVar16 = 0xff;

      }

      if ((int)uVar16 < 1) {

        local_34 = 0;

      }

      else if (0xfe < (int)local_34) {

        local_34 = 0xff;

      }

      uVar16 = local_30;

      if (0xfe < (int)local_30) {

        uVar16 = 0xff;

      }

      if ((int)uVar16 < 1) {

        local_30 = 0;

      }

      else if (0xfe < (int)local_30) {

        local_30 = 0xff;

      }

      iVar17 = iVar14;

      if (0xfe < iVar14) {

        iVar17 = 0xff;

      }

      if (iVar17 < 1) {

        iVar14 = 0;

      }

      else if (0xfe < iVar14) {

        iVar14 = 0xff;

      }

      *local_8 = ((iVar14 << 8 | local_30) << 8 | local_34) << 8 | local_38;

      local_8 = local_8 + iVar15;

      param_3 = param_3 + iVar15 * 4;

      iVar10 = iVar10 + iVar11;

      iVar18 = iVar18 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f8352 at 0x005F8352 (size: 790) ---


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



void __thiscall FUN_005f8352(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  uint uVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  int iVar14;

  uint uVar15;

  int iVar16;

  ushort in_FPUControlWord;

  float local_54;

  float local_50;

  float local_4c;

  uint local_34;

  uint local_30;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  uVar8 = param_2 & 3;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * param_3 + *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar14 = 0;

    iVar13 = 1;

  }

  else {

    iVar14 = *(int *)(param_1 + 0x68) + -1;

    iVar13 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = iVar13 * 0x10;

    iVar9 = iVar14 * 0x10;

    iVar11 = (iVar13 + iVar14) * 0x10;

    iVar14 = (iVar14 - iVar13) * 0x10;

    param_4 = (float *)(iVar9 + 8 + (int)param_4);

    do {

      fVar7 = _DAT_00799208;

      fVar2 = *(float *)(iVar3 + ((param_3 & 3) + uVar8 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_54 + param_4[-2]) * _DAT_00797188;

      fVar5 = (local_50 + param_4[-1]) * _DAT_00797188;

      fVar6 = (local_4c + *param_4) * _DAT_00797188;

      local_34 = (uint)ROUND(fVar4 + fVar2);

      local_30 = (uint)ROUND(fVar5 + fVar2);

      iVar12 = (int)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar14);

        local_54 = (fVar4 - (float)(int)local_34) * _DAT_00799208;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar11);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar14);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar5 - (float)(int)local_30) * fVar7;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar11);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar14);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar7 = (fVar6 - (float)iVar12) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar9);

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar11);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        local_4c = fVar7 * (float)_DAT_007edef8;

      }

      uVar15 = local_34;

      if (0xfe < (int)local_34) {

        uVar15 = 0xff;

      }

      if ((int)uVar15 < 1) {

        local_34 = 0;

      }

      else if (0xfe < (int)local_34) {

        local_34 = 0xff;

      }

      uVar15 = local_30;

      if (0xfe < (int)local_30) {

        uVar15 = 0xff;

      }

      if ((int)uVar15 < 1) {

        local_30 = 0;

      }

      else if (0xfe < (int)local_30) {

        local_30 = 0xff;

      }

      iVar16 = iVar12;

      if (0xfe < iVar12) {

        iVar16 = 0xff;

      }

      if (iVar16 < 1) {

        iVar12 = 0;

      }

      else if (0xfe < iVar12) {

        iVar12 = 0xff;

      }

      *local_8 = (iVar12 << 8 | local_30) << 8 | local_34;

      local_8 = local_8 + iVar13;

      param_4 = param_4 + iVar13 * 4;

      iVar9 = iVar9 + iVar10;

      iVar14 = iVar14 + iVar10;

      iVar11 = iVar11 + iVar10;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f8668 at 0x005F8668 (size: 629) ---


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



void __thiscall FUN_005f8668(int param_1,uint param_2,uint param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  int iVar7;

  uint uVar8;

  int iVar9;

  uint uVar10;

  int iVar11;

  int iVar12;

  uint *puVar13;

  int iVar14;

  uint uVar15;

  int iVar16;

  ushort in_FPUControlWord;

  float local_54;

  float local_50;

  uint local_34;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_50 = 0.0;

  uVar8 = param_2 & 3;

  uVar10 = param_3 & 3;

  puVar13 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * param_3 + *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar14 = 0;

    param_3 = 1;

  }

  else {

    iVar14 = *(int *)(param_1 + 0x68) + -1;

    param_3 = -1;

  }

  iVar7 = param_3;

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = param_3 * 0x10;

    iVar9 = iVar14 << 4;

    iVar12 = (param_3 + iVar14) * 0x10;

    param_3 = (iVar14 - param_3) * 0x10;

    do {

      fVar6 = _DAT_007edf18;

      fVar2 = *(float *)(iVar3 + (uVar10 + uVar8 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_54 + *(float *)(param_4 + iVar9)) * _DAT_007edf1c;

      fVar5 = (local_50 + ((float *)(param_4 + iVar9))[1]) * _DAT_007edf1c;

      local_34 = (uint)ROUND(fVar4 + fVar2);

      iVar14 = (int)ROUND(fVar5 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(param_3 + 0x10 + *(int *)(param_1 + 0x5c));

        local_54 = (fVar4 - (float)(int)local_34) * _DAT_007edf18;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(iVar9 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(iVar12 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(param_3 + 0x14 + *(int *)(param_1 + 0x5c));

        local_54 = local_54 * (float)_DAT_007edef8;

        fVar6 = (fVar5 - (float)iVar14) * fVar6;

        *pfVar1 = _DAT_007edf08 * fVar6 + *pfVar1;

        pfVar1 = (float *)(iVar9 + 0x14 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf04 * fVar6 + *pfVar1;

        pfVar1 = (float *)(iVar12 + 0x14 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf00 * fVar6 + *pfVar1;

        local_50 = fVar6 * (float)_DAT_007edef8;

      }

      uVar15 = local_34;

      if (0xfffe < (int)local_34) {

        uVar15 = 0xffff;

      }

      if ((int)uVar15 < 1) {

        local_34 = 0;

      }

      else if (0xfffe < (int)local_34) {

        local_34 = 0xffff;

      }

      iVar16 = iVar14;

      if (0xfffe < iVar14) {

        iVar16 = 0xffff;

      }

      if (iVar16 < 1) {

        iVar14 = 0;

      }

      else if (0xfffe < iVar14) {

        iVar14 = 0xffff;

      }

      *puVar13 = iVar14 << 0x10 | local_34;

      puVar13 = puVar13 + iVar7;

      param_3 = param_3 + iVar11;

      iVar9 = iVar9 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f88dd at 0x005F88DD (size: 949) ---


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



void __thiscall FUN_005f88dd(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  uint uVar13;

  int iVar14;

  int iVar15;

  uint uVar16;

  int iVar17;

  int iVar18;

  ushort in_FPUControlWord;

  float local_58;

  float local_54;

  float local_50;

  float local_4c;

  uint local_38;

  uint local_34;

  uint local_30;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar13 = (uint)param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar18 = 0;

    iVar15 = 1;

  }

  else {

    iVar18 = *(int *)(param_1 + 0x68) + -1;

    iVar15 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar15 * 0x10;

    iVar10 = iVar18 * 0x10;

    param_3 = (float *)(iVar10 + 8 + param_4);

    iVar12 = (iVar15 + iVar18) * 0x10;

    iVar18 = (iVar18 - iVar15) * 0x10;

    do {

      fVar8 = _DAT_007edf10;

      fVar2 = *(float *)(iVar3 + (uVar13 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_58 + param_3[-2]) * _DAT_007edf14;

      fVar5 = (local_54 + param_3[-1]) * _DAT_007edf14;

      fVar6 = (local_50 + *param_3) * _DAT_007edf14;

      fVar7 = (local_4c + param_3[1]) * _DAT_007938bc;

      local_38 = (uint)ROUND(fVar4 + fVar2);

      local_34 = (uint)ROUND(fVar5 + fVar2);

      local_30 = (uint)ROUND(fVar6 + fVar2);

      iVar14 = (int)ROUND(fVar7 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar18);

        local_58 = (fVar4 - (float)(int)local_38) * _DAT_007edf10;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar18);

        local_58 = local_58 * (float)_DAT_007edef8;

        local_54 = (fVar5 - (float)(int)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar18);

        local_54 = local_54 * (float)_DAT_007edef8;

        fVar8 = (fVar6 - (float)(int)local_30) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar10);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar18);

        local_50 = fVar8 * (float)_DAT_007edef8;

        local_4c = (fVar7 - (float)iVar14) * _DAT_007e75f0;

        *pfVar1 = _DAT_007edf08 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar10);

        *pfVar1 = _DAT_007edf04 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar12);

        *pfVar1 = _DAT_007edf00 * local_4c + *pfVar1;

        local_4c = local_4c * (float)_DAT_007edef8;

      }

      uVar16 = local_38;

      if (0x3fe < (int)local_38) {

        uVar16 = 0x3ff;

      }

      if ((int)uVar16 < 1) {

        local_38 = 0;

      }

      else if (0x3fe < (int)local_38) {

        local_38 = 0x3ff;

      }

      uVar16 = local_34;

      if (0x3fe < (int)local_34) {

        uVar16 = 0x3ff;

      }

      if ((int)uVar16 < 1) {

        local_34 = 0;

      }

      else if (0x3fe < (int)local_34) {

        local_34 = 0x3ff;

      }

      uVar16 = local_30;

      if (0x3fe < (int)local_30) {

        uVar16 = 0x3ff;

      }

      if ((int)uVar16 < 1) {

        local_30 = 0;

      }

      else if (0x3fe < (int)local_30) {

        local_30 = 0x3ff;

      }

      iVar17 = iVar14;

      if (2 < iVar14) {

        iVar17 = 3;

      }

      if (iVar17 < 1) {

        iVar14 = 0;

      }

      else if (2 < iVar14) {

        iVar14 = 3;

      }

      *local_8 = ((iVar14 << 10 | local_38) << 10 | local_34) << 10 | local_30;

      local_8 = local_8 + iVar15;

      param_3 = param_3 + iVar15 * 4;

      iVar10 = iVar10 + iVar11;

      iVar18 = iVar18 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f8c92 at 0x005F8C92 (size: 951) ---


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



void __thiscall FUN_005f8c92(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  uint uVar12;

  int iVar13;

  uint uVar14;

  int iVar15;

  int iVar16;

  int iVar17;

  ushort in_FPUControlWord;

  float local_60;

  float local_5c;

  float local_58;

  float local_54;

  uint local_40;

  uint local_3c;

  uint local_38;

  int local_34;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_60 = 0.0;

  local_5c = 0.0;

  local_58 = 0.0;

  local_54 = 0.0;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 8 +

                     *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar12 = (uint)param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar17 = 0;

    iVar16 = 1;

  }

  else {

    iVar17 = *(int *)(param_1 + 0x68) + -1;

    iVar16 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = iVar16 * 0x10;

    iVar11 = iVar17 * 0x10;

    iVar13 = (iVar16 + iVar17) * 0x10;

    iVar17 = (iVar17 - iVar16) * 0x10;

    param_3 = (float *)(iVar11 + 8 + param_4);

    do {

      fVar8 = _DAT_007edf18;

      fVar2 = *(float *)(iVar3 + (uVar12 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_60 + param_3[-2]) * _DAT_007edf1c;

      fVar5 = (local_5c + param_3[-1]) * _DAT_007edf1c;

      fVar6 = (local_58 + *param_3) * _DAT_007edf1c;

      fVar7 = (local_54 + param_3[1]) * _DAT_007edf1c;

      local_40 = (uint)ROUND(fVar4 + fVar2);

      local_3c = (uint)ROUND(fVar5 + fVar2);

      local_38 = (uint)ROUND(fVar6 + fVar2);

      local_34 = (int)ROUND(fVar7 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar17);

        local_60 = (fVar4 - (float)(int)local_40) * _DAT_007edf18;

        *pfVar1 = _DAT_007edf08 * local_60 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar11);

        *pfVar1 = _DAT_007edf04 * local_60 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar13);

        *pfVar1 = _DAT_007edf00 * local_60 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar17);

        local_60 = local_60 * (float)_DAT_007edef8;

        local_5c = (fVar5 - (float)(int)local_3c) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_5c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar11);

        *pfVar1 = _DAT_007edf04 * local_5c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar13);

        *pfVar1 = _DAT_007edf00 * local_5c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar17);

        local_5c = local_5c * (float)_DAT_007edef8;

        local_58 = (fVar6 - (float)(int)local_38) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar11);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar13);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar17);

        local_58 = local_58 * (float)_DAT_007edef8;

        fVar8 = (fVar7 - (float)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar11);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar13);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        local_54 = fVar8 * (float)_DAT_007edef8;

      }

      uVar14 = local_40;

      if (0xfffe < (int)local_40) {

        uVar14 = 0xffff;

      }

      if ((int)uVar14 < 1) {

        local_40 = 0;

      }

      else if (0xfffe < (int)local_40) {

        local_40 = 0xffff;

      }

      uVar14 = local_3c;

      if (0xfffe < (int)local_3c) {

        uVar14 = 0xffff;

      }

      if ((int)uVar14 < 1) {

        local_3c = 0;

      }

      else if (0xfffe < (int)local_3c) {

        local_3c = 0xffff;

      }

      uVar14 = local_38;

      if (0xfffe < (int)local_38) {

        uVar14 = 0xffff;

      }

      if ((int)uVar14 < 1) {

        local_38 = 0;

      }

      else if (0xfffe < (int)local_38) {

        local_38 = 0xffff;

      }

      iVar15 = local_34;

      if (0xfffe < local_34) {

        iVar15 = 0xffff;

      }

      if (iVar15 < 1) {

        local_34 = 0;

      }

      else if (0xfffe < local_34) {

        local_34 = 0xffff;

      }

      *local_8 = local_3c << 0x10 | local_40;

      local_8[1] = ((local_34 << 0x10 | local_38) >> 0x10 | (int)local_3c >> 0x1f) << 0x10 |

                   (local_38 << 0x10 | local_3c) >> 0x10 | (int)local_40 >> 0x1f;

      local_8 = local_8 + iVar16 * 2;

      param_3 = param_3 + iVar16 * 4;

      iVar17 = iVar17 + iVar10;

      iVar13 = iVar13 + iVar10;

      iVar11 = iVar11 + iVar10;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f9049 at 0x005F9049 (size: 584) ---


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



void __thiscall FUN_005f9049(int param_1,uint param_2,uint param_3,uint param_4)



{

  int iVar1;

  float fVar2;

  int iVar3;

  uint uVar4;

  float *pfVar5;

  int iVar6;

  uint uVar7;

  int iVar8;

  int iVar9;

  ushort *puVar10;

  int iVar11;

  float *pfVar12;

  undefined2 in_FPUControlWord;

  float local_3c;

  uint local_18;

  float local_14;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  iVar3 = param_4;

  local_3c = 0.0;

  uVar4 = param_2 & 3;

  uVar7 = param_3 & 3;

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

  puVar10 = (ushort *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 + *(int *)(param_1 + 100) * param_3

            + *(int *)(param_1 + 0x20));

  if ((param_2 & 1) == 0) {

    iVar11 = 0;

    param_2 = 1;

  }

  else {

    iVar11 = *(int *)(param_1 + 0x68) + -1;

    param_2 = -1;

  }

  param_3 = CONCAT22(param_3._2_2_,in_FPUControlWord);

  *(uint *)(param_1 + 0x7c) = param_3;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_3 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar8 = (iVar11 - param_2) * 0x10;

    pfVar12 = (float *)(iVar11 * 0x10 + 8 + param_4);

    iVar11 = (param_2 + iVar11) * 0x10;

    do {

      pfVar5 = *(float **)(param_1 + 0x38);

      local_18 = 0;

      param_4 = 0;

      local_14 = 3.4028235e+38;

      do {

        fVar2 = (pfVar12[-2] - *pfVar5) * (pfVar12[-2] - *pfVar5) +

                (pfVar12[-1] - pfVar5[1]) * (pfVar12[-1] - pfVar5[1]) +

                (*pfVar12 - pfVar5[2]) * (*pfVar12 - pfVar5[2]);

        if (fVar2 < local_14) {

          local_18 = param_4;

          local_14 = fVar2;

        }

        param_4 = param_4 + 1;

        pfVar5 = pfVar5 + 4;

      } while (param_4 < 0x100);

      fVar2 = (local_3c + pfVar12[1]) * _DAT_00797188;

      iVar6 = (int)ROUND(fVar2 + *(float *)(iVar1 + (uVar7 + uVar4 * 8) * 4 + (param_3 & 3) * 4));

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar5 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar8);

        local_3c = (fVar2 - (float)iVar6) * _DAT_00799208;

        *pfVar5 = _DAT_007edf08 * local_3c + *pfVar5;

        pfVar5 = (float *)((*(int *)(param_1 + 0x5c) - iVar3) + 0x14 + (int)pfVar12);

        *pfVar5 = _DAT_007edf04 * local_3c + *pfVar5;

        pfVar5 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar11);

        *pfVar5 = _DAT_007edf00 * local_3c + *pfVar5;

        local_3c = local_3c * (float)_DAT_007edef8;

      }

      iVar9 = iVar6;

      if (0xfe < iVar6) {

        iVar9 = 0xff;

      }

      if (iVar9 < 1) {

        iVar6 = 0;

      }

      else if (0xfe < iVar6) {

        iVar6 = 0xff;

      }

      pfVar12 = pfVar12 + param_2 * 4;

      iVar11 = iVar11 + param_2 * 0x10;

      *puVar10 = (ushort)(byte)iVar6 << 8 | (ushort)local_18;

      iVar8 = iVar8 + param_2 * 0x10;

      puVar10 = puVar10 + param_2;

      param_3 = param_3 + 1;

    } while (param_3 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f9291 at 0x005F9291 (size: 199) ---


void __thiscall FUN_005f9291(int param_1,uint param_2,float param_3,uint param_4)



{

  float fVar1;

  undefined1 *puVar2;

  float *pfVar3;

  uint uVar4;

  float *pfVar5;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  puVar2 = (undefined1 *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * (int)param_3 +

           *(int *)(param_1 + 0x20));

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    pfVar5 = (float *)(param_4 + 8);

    do {

      pfVar3 = *(float **)(param_1 + 0x38);

      uVar4 = 0;

      param_4 = 0;

      param_3 = 3.4028235e+38;

      do {

        fVar1 = (pfVar5[-2] - *pfVar3) * (pfVar5[-2] - *pfVar3) +

                (pfVar5[-1] - pfVar3[1]) * (pfVar5[-1] - pfVar3[1]) +

                (*pfVar5 - pfVar3[2]) * (*pfVar5 - pfVar3[2]) +

                (pfVar5[1] - pfVar3[3]) * (pfVar5[1] - pfVar3[3]);

        if (fVar1 < param_3) {

          uVar4 = param_4;

          param_3 = fVar1;

        }

        param_4 = param_4 + 1;

        pfVar3 = pfVar3 + 4;

      } while (param_4 < 0x100);

      *puVar2 = (char)uVar4;

      puVar2 = puVar2 + 1;

      param_2 = param_2 + 1;

      pfVar5 = pfVar5 + 4;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f9358 at 0x005F9358 (size: 489) ---


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



void __thiscall FUN_005f9358(int param_1,uint param_2,uint param_3,float *param_4)



{

  int iVar1;

  float fVar2;

  uint uVar3;

  float *pfVar4;

  int iVar5;

  uint uVar6;

  uint uVar7;

  int iVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  undefined1 *puVar12;

  undefined2 in_FPUControlWord;

  float local_38;

  int local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_38 = 0.0;

  uVar3 = param_2 & 3;

  uVar6 = param_3 & 3;

  puVar12 = (undefined1 *)

            (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) + *(int *)(param_1 + 0x20));

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

  if ((param_2 & 1) == 0) {

    iVar10 = 0;

    param_2 = 1;

  }

  else {

    iVar10 = *(int *)(param_1 + 0x68) + -1;

    param_2 = -1;

  }

  param_3 = CONCAT22(param_3._2_2_,in_FPUControlWord);

  *(uint *)(param_1 + 0x7c) = param_3;

  uVar7 = 0;

  pfVar4 = param_4;

  if (*(int *)(param_1 + 0x68) != 0) {

    do {

      uVar7 = uVar7 + 1;

      *pfVar4 = *pfVar4 * _DAT_007eb2cc + pfVar4[1] * _DAT_007eb2d0 + pfVar4[2] * _DAT_007eb2d4;

      pfVar4 = pfVar4 + 4;

    } while (uVar7 < *(uint *)(param_1 + 0x68));

  }

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_3 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar8 = param_2 * 0x10;

    iVar5 = iVar10 << 4;

    iVar9 = (param_2 + iVar10) * 0x10;

    local_8 = (iVar10 - param_2) * 0x10;

    do {

      fVar2 = (local_38 + *(float *)(iVar5 + (int)param_4)) * _DAT_00797188;

      iVar10 = (int)ROUND(fVar2 + *(float *)(iVar1 + (uVar6 + uVar3 * 8) * 4 + (param_3 & 3) * 4));

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar4 = (float *)(local_8 + 0x10 + *(int *)(param_1 + 0x5c));

        local_38 = (fVar2 - (float)iVar10) * _DAT_00799208;

        *pfVar4 = _DAT_007edf08 * local_38 + *pfVar4;

        pfVar4 = (float *)(iVar5 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar4 = _DAT_007edf04 * local_38 + *pfVar4;

        pfVar4 = (float *)(iVar9 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar4 = _DAT_007edf00 * local_38 + *pfVar4;

        local_38 = local_38 * (float)_DAT_007edef8;

      }

      iVar11 = iVar10;

      if (0xfe < iVar10) {

        iVar11 = 0xff;

      }

      if (iVar11 < 1) {

        iVar10 = 0;

      }

      else if (0xfe < iVar10) {

        iVar10 = 0xff;

      }

      *puVar12 = (char)iVar10;

      local_8 = local_8 + iVar8;

      puVar12 = puVar12 + param_2;

      iVar5 = iVar5 + iVar8;

      iVar9 = iVar9 + iVar8;

      param_3 = param_3 + 1;

    } while (param_3 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f9541 at 0x005F9541 (size: 654) ---


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



void __thiscall FUN_005f9541(int param_1,uint param_2,uint param_3,float *param_4)



{

  float fVar1;

  int iVar2;

  float fVar3;

  float fVar4;

  float fVar5;

  uint uVar6;

  float *pfVar7;

  int iVar8;

  uint uVar9;

  uint uVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  int iVar14;

  int iVar15;

  ushort in_FPUControlWord;

  float local_50;

  float local_44;

  int local_30;

  int local_24;

  ushort *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_50 = 0.0;

  local_44 = 0.0;

  local_8 = (ushort *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 + *(int *)(param_1 + 100) * param_3

            + *(int *)(param_1 + 0x20));

  uVar6 = param_2 & 3;

  uVar9 = param_3 & 3;

  iVar2 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar13 = 0;

    iVar14 = 1;

    param_3 = 1;

  }

  else {

    iVar13 = *(int *)(param_1 + 0x68) + -1;

    param_3 = -1;

    iVar14 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  uVar10 = 0;

  pfVar7 = param_4;

  if (*(int *)(param_1 + 0x68) != 0) {

    do {

      uVar10 = uVar10 + 1;

      *pfVar7 = *pfVar7 * _DAT_007eb2cc + pfVar7[1] * _DAT_007eb2d0 + pfVar7[2] * _DAT_007eb2d4;

      pfVar7 = pfVar7 + 4;

    } while (uVar10 < *(uint *)(param_1 + 0x68));

  }

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar14 * 0x10;

    iVar8 = iVar13 << 4;

    iVar15 = (iVar14 + iVar13) * 0x10;

    iVar13 = (iVar13 - param_3) * 0x10;

    do {

      fVar5 = _DAT_00799208;

      fVar1 = *(float *)(iVar2 + (uVar9 + uVar6 * 8) * 4 + (param_2 & 3) * 4);

      fVar3 = (local_50 + *(float *)((int)param_4 + iVar8)) * _DAT_00797188;

      fVar4 = (local_44 + ((float *)((int)param_4 + iVar8))[3]) * _DAT_00797188;

      local_30 = (int)ROUND(fVar3 + fVar1);

      local_24 = (int)ROUND(fVar4 + fVar1);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar7 = (float *)(iVar13 + 0x10 + *(int *)(param_1 + 0x5c));

        local_50 = (fVar3 - (float)local_30) * _DAT_00799208;

        *pfVar7 = _DAT_007edf08 * local_50 + *pfVar7;

        pfVar7 = (float *)(iVar8 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar7 = _DAT_007edf04 * local_50 + *pfVar7;

        pfVar7 = (float *)(iVar15 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar7 = _DAT_007edf00 * local_50 + *pfVar7;

        pfVar7 = (float *)(iVar13 + 0x1c + *(int *)(param_1 + 0x5c));

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar5 = (fVar4 - (float)local_24) * fVar5;

        *pfVar7 = _DAT_007edf08 * fVar5 + *pfVar7;

        pfVar7 = (float *)(iVar8 + 0x1c + *(int *)(param_1 + 0x5c));

        *pfVar7 = _DAT_007edf04 * fVar5 + *pfVar7;

        pfVar7 = (float *)(iVar15 + 0x1c + *(int *)(param_1 + 0x5c));

        *pfVar7 = _DAT_007edf00 * fVar5 + *pfVar7;

        local_44 = fVar5 * (float)_DAT_007edef8;

      }

      iVar12 = local_30;

      if (0xfe < local_30) {

        iVar12 = 0xff;

      }

      if (iVar12 < 1) {

        local_30 = 0;

      }

      else if (0xfe < local_30) {

        local_30 = 0xff;

      }

      iVar12 = local_24;

      if (0xfe < local_24) {

        iVar12 = 0xff;

      }

      if (iVar12 < 1) {

        local_24 = 0;

      }

      else if (0xfe < local_24) {

        local_24 = 0xff;

      }

      iVar8 = iVar8 + iVar11;

      iVar13 = iVar13 + iVar11;

      iVar15 = iVar15 + iVar11;

      *local_8 = (ushort)(byte)local_24 << 8 | (ushort)local_30;

      local_8 = local_8 + iVar14;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f97cf at 0x005F97CF (size: 673) ---


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



void __thiscall FUN_005f97cf(int param_1,uint param_2,uint param_3,float *param_4)



{

  float fVar1;

  int iVar2;

  float fVar3;

  float fVar4;

  float fVar5;

  uint uVar6;

  float *pfVar7;

  int iVar8;

  uint uVar9;

  uint uVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  int iVar14;

  byte *pbVar15;

  undefined2 in_FPUControlWord;

  float local_54;

  float local_48;

  int local_34;

  undefined4 local_c;

  uint local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_48 = 0.0;

  uVar6 = param_2 & 3;

  uVar9 = param_3 & 3;

  pbVar15 = (byte *)((*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) +

                     *(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                    *(int *)(param_1 + 0x20));

  iVar2 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    param_3 = 0;

    param_2 = 1;

  }

  else {

    param_3 = *(int *)(param_1 + 0x68) + -1;

    param_2 = -1;

  }

  local_c = CONCAT22(local_c._2_2_,in_FPUControlWord);

  *(undefined4 *)(param_1 + 0x7c) = local_c;

  uVar10 = 0;

  pfVar7 = param_4;

  if (*(int *)(param_1 + 0x68) != 0) {

    do {

      uVar10 = uVar10 + 1;

      *pfVar7 = pfVar7[1] * _DAT_007eb2d0 + *pfVar7 * _DAT_007eb2cc + pfVar7[2] * _DAT_007eb2d4;

      pfVar7 = pfVar7 + 4;

    } while (uVar10 < *(uint *)(param_1 + 0x68));

  }

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  local_8 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = param_2 * 0x10;

    iVar14 = (param_2 + param_3) * 0x10;

    iVar8 = param_3 << 4;

    param_3 = (param_3 - param_2) * 0x10;

    do {

      fVar5 = _DAT_0079cc80;

      fVar1 = *(float *)(iVar2 + (uVar9 + uVar6 * 8) * 4 + (local_8 & 3) * 4);

      fVar3 = (local_54 + *(float *)((int)param_4 + iVar8)) * _DAT_0079c6d8;

      fVar4 = (local_48 + ((float *)((int)param_4 + iVar8))[3]) * _DAT_0079c6d8;

      local_34 = (int)ROUND(fVar3 + fVar1);

      iVar12 = (int)ROUND(fVar4 + fVar1);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar7 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + param_3);

        local_54 = (fVar3 - (float)local_34) * _DAT_0079cc80;

        *pfVar7 = _DAT_007edf08 * local_54 + *pfVar7;

        pfVar7 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar8);

        *pfVar7 = _DAT_007edf04 * local_54 + *pfVar7;

        pfVar7 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar14);

        *pfVar7 = _DAT_007edf00 * local_54 + *pfVar7;

        pfVar7 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + param_3);

        local_54 = local_54 * (float)_DAT_007edef8;

        fVar5 = (fVar4 - (float)iVar12) * fVar5;

        *pfVar7 = _DAT_007edf08 * fVar5 + *pfVar7;

        pfVar7 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar8);

        *pfVar7 = _DAT_007edf04 * fVar5 + *pfVar7;

        pfVar7 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar14);

        *pfVar7 = _DAT_007edf00 * fVar5 + *pfVar7;

        local_48 = fVar5 * (float)_DAT_007edef8;

      }

      iVar13 = local_34;

      if (0xe < local_34) {

        iVar13 = 0xf;

      }

      if (iVar13 < 1) {

        local_34 = 0;

      }

      else if (0xe < local_34) {

        local_34 = 0xf;

      }

      iVar13 = iVar12;

      if (0xe < iVar12) {

        iVar13 = 0xf;

      }

      if (iVar13 < 1) {

        iVar12 = 0;

      }

      else if (0xe < iVar12) {

        iVar12 = 0xf;

      }

      *pbVar15 = (char)iVar12 << 4 | (byte)local_34;

      param_3 = param_3 + iVar11;

      pbVar15 = pbVar15 + param_2;

      iVar14 = iVar14 + iVar11;

      iVar8 = iVar8 + iVar11;

      local_8 = local_8 + 1;

    } while (local_8 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f9a70 at 0x005F9A70 (size: 615) ---


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



void __thiscall FUN_005f9a70(int param_1,uint param_2,uint param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  uint uVar7;

  int iVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  int iVar14;

  ushort in_FPUControlWord;

  int iVar15;

  float local_50;

  float local_4c;

  int local_30;

  undefined2 *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_50 = 0.0;

  local_4c = 0.0;

  uVar7 = param_2 & 3;

  uVar9 = param_3 & 3;

  local_8 = (undefined2 *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 + *(int *)(param_1 + 100) * param_3

            + *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar12 = 0;

    iVar13 = 1;

    param_3 = 1;

  }

  else {

    iVar12 = *(int *)(param_1 + 0x68) + -1;

    param_3 = -1;

    iVar13 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = iVar13 * 0x10;

    iVar8 = iVar12 << 4;

    iVar14 = (iVar13 + iVar12) * 0x10;

    iVar12 = (iVar12 - param_3) * 0x10;

    do {

      fVar6 = _DAT_007edf20;

      fVar2 = *(float *)(iVar3 + (uVar9 + uVar7 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_50 + *(float *)(param_4 + iVar8)) * _DAT_007edf24;

      fVar5 = (local_4c + ((float *)(param_4 + iVar8))[1]) * _DAT_007edf24;

      local_30 = (int)ROUND(fVar4 + fVar2);

      iVar15 = (int)ROUND(fVar5 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        local_50 = (fVar4 - (float)local_30) * _DAT_007edf20;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(iVar8 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar14);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar6 = (fVar5 - (float)iVar15) * fVar6;

        *pfVar1 = _DAT_007edf08 * fVar6 + *pfVar1;

        pfVar1 = (float *)(iVar8 + 0x14 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf04 * fVar6 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar14);

        *pfVar1 = _DAT_007edf00 * fVar6 + *pfVar1;

        local_4c = fVar6 * (float)_DAT_007edef8;

      }

      iVar11 = local_30;

      if (0x7e < local_30) {

        iVar11 = 0x7f;

      }

      if (iVar11 < -0x7e) {

        local_30 = -0x7f;

      }

      else if (0x7e < local_30) {

        local_30 = 0x7f;

      }

      iVar11 = iVar15;

      if (0x7e < iVar15) {

        iVar11 = 0x7f;

      }

      if (iVar11 < -0x7e) {

        iVar15 = -0x7f;

      }

      else if (0x7e < iVar15) {

        iVar15 = 0x7f;

      }

      iVar8 = iVar8 + iVar10;

      iVar12 = iVar12 + iVar10;

      iVar14 = iVar14 + iVar10;

      *local_8 = CONCAT11((char)iVar15,(undefined1)local_30);

      local_8 = local_8 + iVar13;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f9cd7 at 0x005F9CD7 (size: 795) ---


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



void __thiscall FUN_005f9cd7(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  uint uVar8;

  int iVar9;

  int iVar10;

  uint uVar11;

  int iVar12;

  uint uVar13;

  int iVar14;

  int iVar15;

  int iVar16;

  ushort in_FPUControlWord;

  uint uVar17;

  int iVar18;

  float local_58;

  float local_54;

  float local_4c;

  int local_38;

  ushort *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_4c = 0.0;

  local_8 = (ushort *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 + *(int *)(param_1 + 100) * param_3

            + *(int *)(param_1 + 0x20));

  uVar8 = param_2 & 3;

  uVar11 = param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar12 = 0;

    iVar15 = 1;

    param_3 = 1;

  }

  else {

    iVar12 = *(int *)(param_1 + 0x68) + -1;

    param_3 = -1;

    iVar15 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = iVar15 * 0x10;

    iVar9 = iVar12 * 0x10;

    iVar16 = (iVar15 + iVar12) * 0x10;

    iVar12 = (iVar12 - param_3) * 0x10;

    param_4 = (float *)(iVar9 + 0xc + (int)param_4);

    do {

      fVar7 = _DAT_0079cc80;

      fVar2 = *(float *)(iVar3 + (uVar11 + uVar8 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_58 + param_4[-3]) * _DAT_0079c6d8;

      fVar5 = (local_54 + param_4[-2]) * _DAT_0079c6d8;

      fVar6 = (local_4c + *param_4) * _DAT_007edee4;

      local_38 = (int)ROUND(fVar4 + fVar2);

      uVar17 = (uint)ROUND(fVar5 + fVar2);

      iVar18 = (int)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        local_58 = (fVar4 - (float)local_38) * _DAT_0079cc80;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar16);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        local_58 = local_58 * (float)_DAT_007edef8;

        fVar7 = (fVar5 - (float)(int)uVar17) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar9);

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar16);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar12);

        local_54 = fVar7 * (float)_DAT_007edef8;

        local_4c = (fVar6 - (float)iVar18) * _DAT_007edee0;

        *pfVar1 = _DAT_007edf08 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar9);

        *pfVar1 = _DAT_007edf04 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar16);

        *pfVar1 = _DAT_007edf00 * local_4c + *pfVar1;

        local_4c = local_4c * (float)_DAT_007edef8;

      }

      iVar14 = local_38;

      if (0xe < local_38) {

        iVar14 = 0xf;

      }

      if (iVar14 < -0xe) {

        local_38 = -0xf;

      }

      else if (0xe < local_38) {

        local_38 = 0xf;

      }

      uVar13 = uVar17;

      if (0xe < (int)uVar17) {

        uVar13 = 0xf;

      }

      if ((int)uVar13 < -0xe) {

        uVar17 = 0xfffffff1;

      }

      else if (0xe < (int)uVar17) {

        uVar17 = 0xf;

      }

      iVar14 = iVar18;

      if (0x3e < iVar18) {

        iVar14 = 0x3f;

      }

      if (iVar14 < -0x3e) {

        iVar18 = -0x3f;

      }

      else if (0x3e < iVar18) {

        iVar18 = 0x3f;

      }

      *local_8 = (ushort)((uVar17 & 0x1f | iVar18 << 5) << 5) | (ushort)local_38 & 0x1f;

      local_8 = local_8 + iVar15;

      param_4 = param_4 + iVar15 * 4;

      iVar12 = iVar12 + iVar10;

      iVar9 = iVar9 + iVar10;

      iVar16 = iVar16 + iVar10;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005f9ff2 at 0x005F9FF2 (size: 793) ---


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



void __thiscall FUN_005f9ff2(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  uint uVar8;

  int iVar9;

  uint uVar10;

  int iVar11;

  uint uVar12;

  int iVar13;

  int iVar14;

  int iVar15;

  int iVar16;

  ushort in_FPUControlWord;

  float local_54;

  float local_50;

  float local_48;

  uint local_34;

  uint local_30;

  int local_28;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_50 = 0.0;

  local_48 = 0.0;

  uVar8 = param_2 & 3;

  uVar10 = param_3 & 3;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * param_3 + *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar14 = 0;

    iVar15 = 1;

    param_3 = 1;

  }

  else {

    iVar14 = *(int *)(param_1 + 0x68) + -1;

    param_3 = -1;

    iVar15 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar15 * 0x10;

    iVar9 = iVar14 * 0x10;

    param_4 = (float *)(iVar9 + 0xc + (int)param_4);

    iVar16 = (iVar15 + iVar14) * 0x10;

    iVar14 = (iVar14 - param_3) * 0x10;

    do {

      fVar7 = _DAT_007edf20;

      fVar2 = *(float *)(iVar3 + (uVar10 + uVar8 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_54 + param_4[-3]) * _DAT_007edf24;

      fVar5 = (local_50 + param_4[-2]) * _DAT_007edf24;

      fVar6 = (local_48 + *param_4) * _DAT_00797188;

      local_34 = (uint)ROUND(fVar4 + fVar2);

      local_30 = (uint)ROUND(fVar5 + fVar2);

      local_28 = (int)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar14);

        local_54 = (fVar4 - (float)(int)local_34) * _DAT_007edf20;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar16);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar14);

        local_54 = local_54 * (float)_DAT_007edef8;

        fVar7 = (fVar5 - (float)(int)local_30) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar9);

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar16);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar14);

        local_50 = fVar7 * (float)_DAT_007edef8;

        local_48 = (fVar6 - (float)local_28) * _DAT_00799208;

        *pfVar1 = _DAT_007edf08 * local_48 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar9);

        *pfVar1 = _DAT_007edf04 * local_48 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar16);

        *pfVar1 = _DAT_007edf00 * local_48 + *pfVar1;

        local_48 = local_48 * (float)_DAT_007edef8;

      }

      uVar12 = local_34;

      if (0x7e < (int)local_34) {

        uVar12 = 0x7f;

      }

      if ((int)uVar12 < -0x7e) {

        local_34 = 0xffffff81;

      }

      else if (0x7e < (int)local_34) {

        local_34 = 0x7f;

      }

      uVar12 = local_30;

      if (0x7e < (int)local_30) {

        uVar12 = 0x7f;

      }

      if ((int)uVar12 < -0x7e) {

        local_30 = 0xffffff81;

      }

      else if (0x7e < (int)local_30) {

        local_30 = 0x7f;

      }

      iVar13 = local_28;

      if (0xfe < local_28) {

        iVar13 = 0xff;

      }

      if (iVar13 < -0xfe) {

        local_28 = -0xff;

      }

      else if (0xfe < local_28) {

        local_28 = 0xff;

      }

      *local_8 = (uint)CONCAT11((undefined1)local_28,(undefined1)local_30) << 8 | local_34 & 0xff;

      local_8 = local_8 + iVar15;

      param_4 = param_4 + iVar15 * 4;

      iVar9 = iVar9 + iVar11;

      iVar14 = iVar14 + iVar11;

      iVar16 = iVar16 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fa30b at 0x005FA30B (size: 33) ---


undefined4 * __thiscall FUN_005fa30b(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x18,1);

  *param_1 = &PTR_FUN_007edf28;

  return param_1;

}





// --- FUN_005fa32c at 0x005FA32C (size: 33) ---


undefined4 * __thiscall FUN_005fa32c(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,1);

  *param_1 = &PTR_FUN_007edf38;

  return param_1;

}





// --- FUN_005fa34d at 0x005FA34D (size: 33) ---


undefined4 * __thiscall FUN_005fa34d(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,1);

  *param_1 = &PTR_FUN_007edf48;

  return param_1;

}





// --- FUN_005fa36e at 0x005FA36E (size: 940) ---


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



void __thiscall FUN_005fa36e(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  uint uVar13;

  int iVar14;

  uint uVar15;

  int iVar16;

  int iVar17;

  ushort in_FPUControlWord;

  uint uVar18;

  int iVar19;

  float local_58;

  float local_54;

  float local_50;

  float local_4c;

  uint local_38;

  uint local_34;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar13 = (uint)param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar17 = 0;

    iVar14 = 1;

  }

  else {

    iVar17 = *(int *)(param_1 + 0x68) + -1;

    iVar14 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar14 * 0x10;

    iVar10 = iVar17 * 0x10;

    param_3 = (float *)(iVar10 + 8 + param_4);

    iVar12 = (iVar14 + iVar17) * 0x10;

    iVar17 = (iVar17 - iVar14) * 0x10;

    do {

      fVar8 = _DAT_007edf20;

      fVar2 = *(float *)(iVar3 + (uVar13 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_58 + param_3[-2]) * _DAT_007edf24;

      fVar5 = (local_54 + param_3[-1]) * _DAT_007edf24;

      fVar6 = (local_50 + *param_3) * _DAT_007edf24;

      fVar7 = (local_4c + param_3[1]) * _DAT_007edf24;

      local_38 = (uint)ROUND(fVar4 + fVar2);

      local_34 = (uint)ROUND(fVar5 + fVar2);

      uVar18 = (uint)ROUND(fVar6 + fVar2);

      iVar19 = (int)ROUND(fVar7 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar17);

        local_58 = (fVar4 - (float)(int)local_38) * _DAT_007edf20;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar17);

        local_58 = local_58 * (float)_DAT_007edef8;

        local_54 = (fVar5 - (float)(int)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar17);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar6 - (float)(int)uVar18) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar17);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar8 = (fVar7 - (float)iVar19) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar10);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        local_4c = fVar8 * (float)_DAT_007edef8;

      }

      uVar15 = local_38;

      if (0x7e < (int)local_38) {

        uVar15 = 0x7f;

      }

      if ((int)uVar15 < -0x7e) {

        local_38 = 0xffffff81;

      }

      else if (0x7e < (int)local_38) {

        local_38 = 0x7f;

      }

      uVar15 = local_34;

      if (0x7e < (int)local_34) {

        uVar15 = 0x7f;

      }

      if ((int)uVar15 < -0x7e) {

        local_34 = 0xffffff81;

      }

      else if (0x7e < (int)local_34) {

        local_34 = 0x7f;

      }

      uVar15 = uVar18;

      if (0x7e < (int)uVar18) {

        uVar15 = 0x7f;

      }

      if ((int)uVar15 < -0x7e) {

        uVar18 = 0xffffff81;

      }

      else if (0x7e < (int)uVar18) {

        uVar18 = 0x7f;

      }

      iVar16 = iVar19;

      if (0x7e < iVar19) {

        iVar16 = 0x7f;

      }

      if (iVar16 < -0x7e) {

        iVar19 = -0x7f;

      }

      else if (0x7e < iVar19) {

        iVar19 = 0x7f;

      }

      *local_8 = ((uVar18 & 0xff | iVar19 << 8) << 8 | local_34 & 0xff) << 8 | local_38 & 0xff;

      local_8 = local_8 + iVar14;

      param_3 = param_3 + iVar14 * 4;

      iVar10 = iVar10 + iVar11;

      iVar17 = iVar17 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fa71a at 0x005FA71A (size: 33) ---


undefined4 * __thiscall FUN_005fa71a(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,1);

  *param_1 = &PTR_FUN_007edf58;

  return param_1;

}





// --- FUN_005fa73b at 0x005FA73B (size: 33) ---


undefined4 * __thiscall FUN_005fa73b(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,1);

  *param_1 = &PTR_FUN_007edf68;

  return param_1;

}





// --- FUN_005fa75c at 0x005FA75C (size: 33) ---


undefined4 * __thiscall FUN_005fa75c(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,1);

  *param_1 = &PTR_FUN_007edf78;

  return param_1;

}





// --- FUN_005fa77d at 0x005FA77D (size: 33) ---


undefined4 * __thiscall FUN_005fa77d(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,1);

  *param_1 = &PTR_FUN_007edf88;

  return param_1;

}





// --- FUN_005fa79e at 0x005FA79E (size: 33) ---


void * __thiscall FUN_005fa79e(void *param_1,byte param_2)



{

  FUN_005f40bf();

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_005fa7bf at 0x005FA7BF (size: 33) ---


undefined4 * __thiscall FUN_005fa7bf(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,8,1);

  *param_1 = &PTR_FUN_007edf98;

  return param_1;

}





// --- FUN_005fa7e0 at 0x005FA7E0 (size: 33) ---


undefined4 * __thiscall FUN_005fa7e0(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,8,1);

  *param_1 = &PTR_FUN_007edfa8;

  return param_1;

}





// --- FUN_005fa801 at 0x005FA801 (size: 33) ---


undefined4 * __thiscall FUN_005fa801(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,1);

  *param_1 = &PTR_FUN_007edfb8;

  return param_1;

}





// --- FUN_005fa822 at 0x005FA822 (size: 631) ---


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



void __thiscall FUN_005fa822(int param_1,uint param_2,uint param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  uint uVar7;

  int iVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  uint uVar13;

  int iVar14;

  int iVar15;

  uint uVar16;

  ushort in_FPUControlWord;

  float local_44;

  float local_40;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_44 = 0.0;

  local_40 = 0.0;

  uVar7 = param_2 & 3;

  uVar9 = param_3 & 3;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * param_3 + *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar15 = 0;

    iVar12 = 1;

  }

  else {

    iVar15 = *(int *)(param_1 + 0x68) + -1;

    iVar12 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = iVar12 * 0x10;

    iVar8 = iVar15 << 4;

    iVar11 = (iVar12 + iVar15) * 0x10;

    param_3 = (iVar15 - iVar12) * 0x10;

    do {

      fVar6 = _DAT_007cbd08;

      fVar2 = *(float *)(iVar3 + (uVar9 + uVar7 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_44 + *(float *)(param_4 + iVar8)) * _DAT_007edfc8;

      fVar5 = (local_40 + ((float *)(param_4 + iVar8))[1]) * _DAT_007edfc8;

      uVar16 = (uint)ROUND(fVar4 + fVar2);

      iVar15 = (int)ROUND(fVar5 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(param_3 + 0x10 + *(int *)(param_1 + 0x5c));

        local_44 = (fVar4 - (float)(int)uVar16) * _DAT_007cbd08;

        *pfVar1 = _DAT_007edf08 * local_44 + *pfVar1;

        pfVar1 = (float *)(iVar8 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf04 * local_44 + *pfVar1;

        pfVar1 = (float *)(iVar11 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf00 * local_44 + *pfVar1;

        pfVar1 = (float *)(param_3 + 0x14 + *(int *)(param_1 + 0x5c));

        local_44 = local_44 * (float)_DAT_007edef8;

        fVar6 = (fVar5 - (float)iVar15) * fVar6;

        *pfVar1 = _DAT_007edf08 * fVar6 + *pfVar1;

        pfVar1 = (float *)(iVar8 + 0x14 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf04 * fVar6 + *pfVar1;

        pfVar1 = (float *)(iVar11 + 0x14 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf00 * fVar6 + *pfVar1;

        local_40 = fVar6 * (float)_DAT_007edef8;

      }

      uVar13 = uVar16;

      if (0x7ffe < (int)uVar16) {

        uVar13 = 0x7fff;

      }

      if ((int)uVar13 < -0x7ffe) {

        uVar16 = 0xffff8001;

      }

      else if (0x7ffe < (int)uVar16) {

        uVar16 = 0x7fff;

      }

      iVar14 = iVar15;

      if (0x7ffe < iVar15) {

        iVar14 = 0x7fff;

      }

      if (iVar14 < -0x7ffe) {

        iVar15 = -0x7fff;

      }

      else if (0x7ffe < iVar15) {

        iVar15 = 0x7fff;

      }

      *local_8 = iVar15 << 0x10 | uVar16 & 0xffff;

      local_8 = local_8 + iVar12;

      param_3 = param_3 + iVar10;

      iVar8 = iVar8 + iVar10;

      iVar11 = iVar11 + iVar10;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005faa99 at 0x005FAA99 (size: 33) ---


undefined4 * __thiscall FUN_005faa99(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,1);

  *param_1 = &PTR_FUN_007edfcc;

  return param_1;

}





// --- FUN_005faaba at 0x005FAABA (size: 33) ---


undefined4 * __thiscall FUN_005faaba(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,1);

  *param_1 = &PTR_FUN_007edfdc;

  return param_1;

}





// --- FUN_005faadb at 0x005FAADB (size: 33) ---


undefined4 * __thiscall FUN_005faadb(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,1);

  *param_1 = &PTR_FUN_007edfec;

  return param_1;

}





// --- FUN_005faafc at 0x005FAAFC (size: 33) ---


undefined4 * __thiscall FUN_005faafc(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,1);

  *param_1 = &PTR_FUN_007edffc;

  return param_1;

}





// --- FUN_005fab1d at 0x005FAB1D (size: 33) ---


undefined4 * __thiscall FUN_005fab1d(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,1);

  *param_1 = &PTR_FUN_007ee00c;

  return param_1;

}





// --- FUN_005fab3e at 0x005FAB3E (size: 33) ---


undefined4 * __thiscall FUN_005fab3e(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,1);

  *param_1 = &PTR_FUN_007ee01c;

  return param_1;

}





// --- FUN_005fab5f at 0x005FAB5F (size: 33) ---


undefined4 * __thiscall FUN_005fab5f(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x40,1);

  *param_1 = &PTR_FUN_007ee02c;

  return param_1;

}





// --- FUN_005fab80 at 0x005FAB80 (size: 33) ---


undefined4 * __thiscall FUN_005fab80(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,1);

  *param_1 = &PTR_FUN_007ee03c;

  return param_1;

}





// --- FUN_005faba1 at 0x005FABA1 (size: 986) ---


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



void __thiscall FUN_005faba1(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  uint uVar13;

  uint uVar14;

  int iVar15;

  uint uVar16;

  int iVar17;

  int iVar18;

  ushort in_FPUControlWord;

  int iVar19;

  float local_58;

  float local_54;

  float local_50;

  float local_4c;

  uint local_38;

  uint local_34;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_58 = 0.0;

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar13 = (uint)param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar18 = 0;

    iVar15 = 1;

  }

  else {

    iVar18 = *(int *)(param_1 + 0x68) + -1;

    iVar15 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar15 * 0x10;

    iVar10 = iVar18 * 0x10;

    param_3 = (float *)(iVar10 + 8 + param_4);

    iVar12 = (iVar15 + iVar18) * 0x10;

    iVar18 = (iVar18 - iVar15) * 0x10;

    do {

      fVar8 = _DAT_007ee04c;

      fVar2 = *(float *)(iVar3 + (uVar13 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_58 + param_3[-2]) * _DAT_007ee050;

      fVar5 = (local_54 + param_3[-1]) * _DAT_007ee050;

      fVar6 = (local_50 + *param_3) * _DAT_007ee050;

      fVar7 = (local_4c + param_3[1]) * _DAT_007938bc;

      local_38 = (uint)ROUND(fVar4 + fVar2);

      local_34 = (uint)ROUND(fVar5 + fVar2);

      uVar14 = (uint)ROUND(fVar6 + fVar2);

      iVar19 = (int)ROUND(fVar7 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar18);

        local_58 = (fVar4 - (float)(int)local_38) * _DAT_007ee04c;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar18);

        local_58 = local_58 * (float)_DAT_007edef8;

        local_54 = (fVar5 - (float)(int)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar10);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar18);

        local_54 = local_54 * (float)_DAT_007edef8;

        fVar8 = (fVar6 - (float)(int)uVar14) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar10);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar18);

        local_50 = fVar8 * (float)_DAT_007edef8;

        local_4c = (fVar7 - (float)iVar19) * _DAT_007e75f0;

        *pfVar1 = _DAT_007edf08 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar10);

        *pfVar1 = _DAT_007edf04 * local_4c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar12);

        *pfVar1 = _DAT_007edf00 * local_4c + *pfVar1;

        local_4c = local_4c * (float)_DAT_007edef8;

      }

      uVar16 = local_38;

      if (0x1fe < (int)local_38) {

        uVar16 = 0x1ff;

      }

      if ((int)uVar16 < -0x1fe) {

        local_38 = 0xfffffe01;

      }

      else if (0x1fe < (int)local_38) {

        local_38 = 0x1ff;

      }

      uVar16 = local_34;

      if (0x1fe < (int)local_34) {

        uVar16 = 0x1ff;

      }

      if ((int)uVar16 < -0x1fe) {

        local_34 = 0xfffffe01;

      }

      else if (0x1fe < (int)local_34) {

        local_34 = 0x1ff;

      }

      uVar16 = uVar14;

      if (0x1fe < (int)uVar14) {

        uVar16 = 0x1ff;

      }

      if ((int)uVar16 < -0x1fe) {

        uVar14 = 0xfffffe01;

      }

      else if (0x1fe < (int)uVar14) {

        uVar14 = 0x1ff;

      }

      iVar17 = iVar19;

      if (2 < iVar19) {

        iVar17 = 3;

      }

      if (iVar17 < -2) {

        iVar19 = -3;

      }

      else if (2 < iVar19) {

        iVar19 = 3;

      }

      *local_8 = ((uVar14 & 0x3ff | iVar19 << 10) << 10 | local_34 & 0x3ff) << 10 | local_38 & 0x3ff

      ;

      local_8 = local_8 + iVar15;

      param_3 = param_3 + iVar15 * 4;

      iVar10 = iVar10 + iVar11;

      iVar18 = iVar18 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005faf7b at 0x005FAF7B (size: 33) ---


undefined4 * __thiscall FUN_005faf7b(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,8,1);

  *param_1 = &PTR_FUN_007ee054;

  return param_1;

}





// --- FUN_005faf9c at 0x005FAF9C (size: 33) ---


undefined4 * __thiscall FUN_005faf9c(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,8,1);

  *param_1 = &PTR_FUN_007ee064;

  return param_1;

}





// --- FUN_005fafbd at 0x005FAFBD (size: 33) ---


undefined4 * __thiscall FUN_005fafbd(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,1);

  *param_1 = &PTR_FUN_007ee074;

  return param_1;

}





// --- FUN_005fafde at 0x005FAFDE (size: 33) ---


undefined4 * __thiscall FUN_005fafde(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,8,1);

  *param_1 = &PTR_FUN_007ee084;

  return param_1;

}





// --- FUN_005fafff at 0x005FAFFF (size: 33) ---


undefined4 * __thiscall FUN_005fafff(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,1);

  *param_1 = &PTR_FUN_007ee094;

  return param_1;

}





// --- FUN_005fb020 at 0x005FB020 (size: 33) ---


undefined4 * __thiscall FUN_005fb020(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,2);

  *param_1 = &PTR_FUN_007ee0a4;

  return param_1;

}





// --- FUN_005fb041 at 0x005FB041 (size: 33) ---


undefined4 * __thiscall FUN_005fb041(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,2);

  *param_1 = &PTR_FUN_007ee0b4;

  return param_1;

}





// --- FUN_005fb062 at 0x005FB062 (size: 981) ---


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



void __thiscall FUN_005fb062(int param_1,uint param_2,float *param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  uint uVar12;

  int iVar13;

  int iVar14;

  int iVar15;

  uint uVar16;

  int iVar17;

  ushort in_FPUControlWord;

  float local_60;

  float local_5c;

  float local_58;

  float local_54;

  uint local_40;

  int local_3c;

  uint local_38;

  int local_34;

  uint *local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_60 = 0.0;

  local_5c = 0.0;

  local_58 = 0.0;

  local_54 = 0.0;

  local_8 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 8 +

                     *(int *)(param_1 + 100) * (int)param_3 + *(int *)(param_1 + 0x20));

  uVar9 = param_2 & 3;

  uVar12 = (uint)param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar15 = 0;

    iVar14 = 1;

  }

  else {

    iVar15 = *(int *)(param_1 + 0x68) + -1;

    iVar14 = -1;

  }

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = iVar14 * 0x10;

    iVar11 = iVar15 * 0x10;

    iVar13 = (iVar14 + iVar15) * 0x10;

    iVar15 = (iVar15 - iVar14) * 0x10;

    param_3 = (float *)(iVar11 + 8 + param_4);

    do {

      fVar8 = _DAT_007cbd08;

      fVar2 = *(float *)(iVar3 + (uVar12 + uVar9 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_60 + param_3[-2]) * _DAT_007edfc8;

      fVar5 = (local_5c + param_3[-1]) * _DAT_007edfc8;

      fVar6 = (local_58 + *param_3) * _DAT_007edfc8;

      fVar7 = (local_54 + param_3[1]) * _DAT_007edfc8;

      local_40 = (uint)ROUND(fVar4 + fVar2);

      local_3c = (int)ROUND(fVar5 + fVar2);

      local_38 = (uint)ROUND(fVar6 + fVar2);

      local_34 = (int)ROUND(fVar7 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar15);

        local_60 = (fVar4 - (float)(int)local_40) * _DAT_007cbd08;

        *pfVar1 = _DAT_007edf08 * local_60 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar11);

        *pfVar1 = _DAT_007edf04 * local_60 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar13);

        *pfVar1 = _DAT_007edf00 * local_60 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar15);

        local_60 = local_60 * (float)_DAT_007edef8;

        local_5c = (fVar5 - (float)local_3c) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_5c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar11);

        *pfVar1 = _DAT_007edf04 * local_5c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar13);

        *pfVar1 = _DAT_007edf00 * local_5c + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar15);

        local_5c = local_5c * (float)_DAT_007edef8;

        local_58 = (fVar6 - (float)(int)local_38) * fVar8;

        *pfVar1 = _DAT_007edf08 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar11);

        *pfVar1 = _DAT_007edf04 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar13);

        *pfVar1 = _DAT_007edf00 * local_58 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar15);

        local_58 = local_58 * (float)_DAT_007edef8;

        fVar8 = (fVar7 - (float)local_34) * fVar8;

        *pfVar1 = _DAT_007edf08 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar11);

        *pfVar1 = _DAT_007edf04 * fVar8 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x1c + iVar13);

        *pfVar1 = _DAT_007edf00 * fVar8 + *pfVar1;

        local_54 = fVar8 * (float)_DAT_007edef8;

      }

      uVar16 = local_40;

      if (0x7ffe < (int)local_40) {

        uVar16 = 0x7fff;

      }

      if ((int)uVar16 < -0x7ffe) {

        local_40 = 0xffff8001;

      }

      else if (0x7ffe < (int)local_40) {

        local_40 = 0x7fff;

      }

      iVar17 = local_3c;

      if (0x7ffe < local_3c) {

        iVar17 = 0x7fff;

      }

      if (iVar17 < -0x7ffe) {

        local_3c = -0x7fff;

      }

      else if (0x7ffe < local_3c) {

        local_3c = 0x7fff;

      }

      uVar16 = local_38;

      if (0x7ffe < (int)local_38) {

        uVar16 = 0x7fff;

      }

      if ((int)uVar16 < -0x7ffe) {

        local_38 = 0xffff8001;

      }

      else if (0x7ffe < (int)local_38) {

        local_38 = 0x7fff;

      }

      iVar17 = local_34;

      if (0x7ffe < local_34) {

        iVar17 = 0x7fff;

      }

      if (iVar17 < -0x7ffe) {

        local_34 = -0x7fff;

      }

      else if (0x7ffe < local_34) {

        local_34 = 0x7fff;

      }

      local_8[1] = local_34 << 0x10 | local_38 & 0xffff;

      *local_8 = local_3c << 0x10 | local_40 & 0xffff;

      local_8 = local_8 + iVar14 * 2;

      param_3 = param_3 + iVar14 * 4;

      iVar15 = iVar15 + iVar10;

      iVar13 = iVar13 + iVar10;

      iVar11 = iVar11 + iVar10;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fb437 at 0x005FB437 (size: 33) ---


undefined4 * __thiscall FUN_005fb437(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,2);

  *param_1 = &PTR_FUN_007ee0c4;

  return param_1;

}





// --- FUN_005fb458 at 0x005FB458 (size: 33) ---


undefined4 * __thiscall FUN_005fb458(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,3);

  *param_1 = &PTR_FUN_007ee0d4;

  return param_1;

}





// --- FUN_005fb479 at 0x005FB479 (size: 33) ---


undefined4 * __thiscall FUN_005fb479(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,2);

  *param_1 = &PTR_FUN_007ee0e4;

  return param_1;

}





// --- FUN_005fb49a at 0x005FB49A (size: 33) ---


undefined4 * __thiscall FUN_005fb49a(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,2);

  *param_1 = &PTR_FUN_007ee0f4;

  return param_1;

}





// --- FUN_005fb4bb at 0x005FB4BB (size: 33) ---


undefined4 * __thiscall FUN_005fb4bb(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x40,3);

  *param_1 = &PTR_FUN_007ee104;

  return param_1;

}





// --- FUN_005fb4dc at 0x005FB4DC (size: 33) ---


undefined4 * __thiscall FUN_005fb4dc(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,2);

  *param_1 = &PTR_FUN_007ee114;

  return param_1;

}





// --- FUN_005fb4fd at 0x005FB4FD (size: 624) ---


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



void __thiscall FUN_005fb4fd(int param_1,uint param_2,uint param_3,int param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  int iVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  int iVar8;

  uint uVar9;

  int iVar10;

  int iVar11;

  uint uVar12;

  int iVar13;

  int iVar14;

  int iVar15;

  undefined2 in_FPUControlWord;

  float local_48;

  float local_44;

  undefined2 *local_c;

  uint local_8;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  local_48 = 0.0;

  local_44 = 0.0;

  uVar9 = param_2 & 3;

  uVar12 = param_3 & 3;

  local_c = (undefined2 *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 + *(int *)(param_1 + 100) * param_3

            + *(int *)(param_1 + 0x20));

  iVar3 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar14 = 0;

    param_2 = 1;

  }

  else {

    iVar14 = *(int *)(param_1 + 0x68) + -1;

    param_2 = -1;

  }

  iVar8 = param_2;

  param_3 = CONCAT22(param_3._2_2_,in_FPUControlWord);

  *(uint *)(param_1 + 0x7c) = param_3;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  local_8 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar10 = param_2 * 0x10;

    param_3 = (param_2 + iVar14) * 0x10;

    iVar15 = iVar14 << 4;

    param_2 = (iVar14 - param_2) * 0x10;

    do {

      pfVar1 = (float *)(iVar15 + param_4);

      thunk_FUN_005e06f5(pfVar1,pfVar1);

      fVar7 = _DAT_007edf20;

      fVar2 = *(float *)(iVar3 + (uVar12 + uVar9 * 8) * 4 + (local_8 & 3) * 4);

      fVar5 = (local_48 + *pfVar1) * _DAT_007edf24;

      fVar6 = (local_44 + pfVar1[1]) * _DAT_007edf24;

      iVar14 = (int)ROUND(fVar5 + fVar2);

      iVar13 = (int)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + param_2);

        local_48 = (fVar5 - (float)iVar14) * _DAT_007edf20;

        *pfVar1 = _DAT_007edf08 * local_48 + *pfVar1;

        pfVar1 = (float *)(iVar15 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf04 * local_48 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + param_3);

        *pfVar1 = _DAT_007edf00 * local_48 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + param_2);

        local_48 = local_48 * (float)_DAT_007edef8;

        fVar7 = (fVar6 - (float)iVar13) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(iVar15 + 0x14 + *(int *)(param_1 + 0x5c));

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + param_3);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        local_44 = fVar7 * (float)_DAT_007edef8;

      }

      iVar4 = 0x7f;

      iVar11 = iVar14;

      if (0x7e < iVar14) {

        iVar11 = iVar4;

      }

      if (iVar11 < -0x7e) {

        iVar14 = -0x7f;

      }

      else if (0x7e < iVar14) {

        iVar14 = iVar4;

      }

      iVar11 = iVar13;

      if (0x7e < iVar13) {

        iVar11 = iVar4;

      }

      if (iVar11 < -0x7e) {

        iVar13 = -0x7f;

      }

      else if (0x7e < iVar13) {

        iVar13 = iVar4;

      }

      *local_c = CONCAT11((char)iVar13,(char)iVar14);

      local_c = local_c + iVar8;

      param_2 = param_2 + iVar10;

      param_3 = param_3 + iVar10;

      iVar15 = iVar15 + iVar10;

      local_8 = local_8 + 1;

    } while (local_8 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fb76d at 0x005FB76D (size: 33) ---


undefined4 * __thiscall FUN_005fb76d(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x10,4);

  *param_1 = &PTR_FUN_007ee124;

  return param_1;

}





// --- FUN_005fb78e at 0x005FB78E (size: 33) ---


undefined4 * __thiscall FUN_005fb78e(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,4);

  *param_1 = &PTR_FUN_007ee134;

  return param_1;

}





// --- FUN_005fb7af at 0x005FB7AF (size: 33) ---


undefined4 * __thiscall FUN_005fb7af(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x40,4);

  *param_1 = &PTR_FUN_007ee144;

  return param_1;

}





// --- FUN_005fb7d0 at 0x005FB7D0 (size: 33) ---


undefined4 * __thiscall FUN_005fb7d0(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,4);

  *param_1 = &PTR_FUN_007ee154;

  return param_1;

}





// --- FUN_005fb7f1 at 0x005FB7F1 (size: 33) ---


undefined4 * __thiscall FUN_005fb7f1(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x40,4);

  *param_1 = &PTR_FUN_007ee164;

  return param_1;

}





// --- FUN_005fb812 at 0x005FB812 (size: 36) ---


undefined4 * __thiscall FUN_005fb812(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x80,4);

  *param_1 = &PTR_FUN_007ee174;

  return param_1;

}





// --- FUN_005fb836 at 0x005FB836 (size: 497) ---


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



void __thiscall FUN_005fb836(int param_1,uint param_2,uint param_3,float *param_4)



{

  int iVar1;

  float fVar2;

  int iVar3;

  uint uVar4;

  float *pfVar5;

  int iVar6;

  uint uVar7;

  uint uVar8;

  int iVar9;

  int iVar10;

  undefined2 *puVar11;

  int iVar12;

  int iVar13;

  ushort in_FPUControlWord;

  float local_38;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_38 = 0.0;

  uVar4 = param_2 & 3;

  uVar7 = param_3 & 3;

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

  puVar11 = (undefined2 *)

            (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 2 + *(int *)(param_1 + 0x20));

  if ((param_2 & 1) == 0) {

    iVar12 = 0;

    param_3 = 1;

  }

  else {

    iVar12 = *(int *)(param_1 + 0x68) + -1;

    param_3 = -1;

  }

  iVar3 = param_3;

  param_2 = (uint)in_FPUControlWord;

  *(uint *)(param_1 + 0x7c) = param_2;

  uVar8 = 0;

  pfVar5 = param_4;

  if (*(int *)(param_1 + 0x68) != 0) {

    do {

      uVar8 = uVar8 + 1;

      *pfVar5 = *pfVar5 * _DAT_007eb2cc + pfVar5[1] * _DAT_007eb2d0 + pfVar5[2] * _DAT_007eb2d4;

      pfVar5 = pfVar5 + 4;

    } while (uVar8 < *(uint *)(param_1 + 0x68));

  }

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar9 = param_3 * 0x10;

    iVar6 = iVar12 << 4;

    iVar10 = (param_3 + iVar12) * 0x10;

    param_3 = (iVar12 - param_3) * 0x10;

    do {

      fVar2 = (local_38 + *(float *)(iVar6 + (int)param_4)) * _DAT_007edf1c;

      iVar12 = (int)ROUND(fVar2 + *(float *)(iVar1 + (uVar7 + uVar4 * 8) * 4 + (param_2 & 3) * 4));

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar5 = (float *)(param_3 + 0x10 + *(int *)(param_1 + 0x5c));

        local_38 = (fVar2 - (float)iVar12) * _DAT_007edf18;

        *pfVar5 = _DAT_007edf08 * local_38 + *pfVar5;

        pfVar5 = (float *)(iVar6 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar5 = _DAT_007edf04 * local_38 + *pfVar5;

        pfVar5 = (float *)(iVar10 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar5 = _DAT_007edf00 * local_38 + *pfVar5;

        local_38 = local_38 * (float)_DAT_007edef8;

      }

      iVar13 = iVar12;

      if (0xfffe < iVar12) {

        iVar13 = 0xffff;

      }

      if (iVar13 < 1) {

        iVar12 = 0;

      }

      else if (0xfffe < iVar12) {

        iVar12 = 0xffff;

      }

      *puVar11 = (short)iVar12;

      param_3 = param_3 + iVar9;

      puVar11 = puVar11 + iVar3;

      iVar6 = iVar6 + iVar9;

      iVar10 = iVar10 + iVar9;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fba27 at 0x005FBA27 (size: 33) ---


undefined4 * __thiscall FUN_005fba27(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x20,1);

  *param_1 = &PTR_FUN_007ee184;

  return param_1;

}





// --- FUN_005fba48 at 0x005FBA48 (size: 33) ---


undefined4 * __thiscall FUN_005fba48(undefined4 *param_1,undefined4 param_2)



{

  FUN_005f518f(param_2,0x30,1);

  *param_1 = &PTR_FUN_007ee194;

  return param_1;

}





// --- FUN_005fba69 at 0x005FBA69 (size: 77) ---


void __thiscall FUN_005fba69(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  undefined4 *puVar1;

  uint uVar2;

  

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (undefined4 *)FUN_005f560f(param_4);

  }

  puVar1 = (undefined4 *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  uVar2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    do {

      *puVar1 = *param_4;

      puVar1 = puVar1 + 1;

      uVar2 = uVar2 + 1;

      param_4 = param_4 + 4;

    } while (uVar2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fbab6 at 0x005FBAB6 (size: 88) ---


void __thiscall FUN_005fbab6(int param_1,int param_2,int param_3,int param_4)



{

  uint uVar1;

  int iVar2;

  

  uVar1 = 0;

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  iVar2 = *(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

          *(int *)(param_1 + 0x20);

  if (*(int *)(param_1 + 0x68) != 0) {

    do {

      thunk_FUN_005e02d4(iVar2,param_4,1);

      param_4 = param_4 + 0x10;

      iVar2 = iVar2 + 2;

      uVar1 = uVar1 + 1;

    } while (uVar1 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fbb0e at 0x005FBB0E (size: 89) ---


void __thiscall FUN_005fbb0e(int param_1,int param_2,int param_3,int param_4)



{

  uint uVar1;

  int iVar2;

  

  uVar1 = 0;

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  iVar2 = *(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

          *(int *)(param_1 + 0x20);

  if (*(int *)(param_1 + 0x68) != 0) {

    do {

      thunk_FUN_005e02d4(iVar2,param_4,2);

      param_4 = param_4 + 0x10;

      iVar2 = iVar2 + 4;

      uVar1 = uVar1 + 1;

    } while (uVar1 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fbb67 at 0x005FBB67 (size: 65) ---


void __thiscall FUN_005fbb67(int param_1,int param_2,int param_3,undefined4 param_4)



{

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = FUN_005f560f(param_4);

  }

  thunk_FUN_005e02d4(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                     *(int *)(param_1 + 0x20),param_4,*(int *)(param_1 + 0x68) << 2);

  return;

}





// --- FUN_005fbba8 at 0x005FBBA8 (size: 83) ---


void __thiscall FUN_005fbba8(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  undefined4 *puVar1;

  uint uVar2;

  

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (undefined4 *)FUN_005f560f(param_4);

  }

  puVar1 = (undefined4 *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  uVar2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    do {

      *puVar1 = *param_4;

      puVar1[1] = param_4[1];

      puVar1 = puVar1 + 2;

      uVar2 = uVar2 + 1;

      param_4 = param_4 + 4;

    } while (uVar2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fbbfb at 0x005FBBFB (size: 76) ---


void __thiscall FUN_005fbbfb(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  uint uVar1;

  int iVar2;

  undefined4 *puVar3;

  

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (undefined4 *)FUN_005f560f(param_4);

  }

  puVar3 = (undefined4 *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  for (uVar1 = (uint)(*(int *)(param_1 + 0x68) << 4) >> 2; uVar1 != 0; uVar1 = uVar1 - 1) {

    *puVar3 = *param_4;

    param_4 = param_4 + 1;

    puVar3 = puVar3 + 1;

  }

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

    *(undefined1 *)puVar3 = *(undefined1 *)param_4;

    param_4 = (undefined4 *)((int)param_4 + 1);

    puVar3 = (undefined4 *)((int)puVar3 + 1);

  }

  return;

}





// --- FUN_005fbc47 at 0x005FBC47 (size: 680) ---


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



void __thiscall FUN_005fbc47(int param_1,uint param_2,uint param_3,float *param_4)



{

  float fVar1;

  int iVar2;

  float fVar3;

  float fVar4;

  float fVar5;

  int iVar6;

  uint uVar7;

  float *pfVar8;

  int iVar9;

  uint uVar10;

  uint uVar11;

  int iVar12;

  int iVar13;

  uint *puVar14;

  int iVar15;

  int iVar16;

  ushort in_FPUControlWord;

  float local_54;

  float local_48;

  uint local_34;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_48 = 0.0;

  uVar7 = param_2 & 3;

  uVar10 = param_3 & 3;

  puVar14 = (uint *)(*(int *)(param_1 + 0x60) * param_2 +

                     (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 4 +

                     *(int *)(param_1 + 100) * param_3 + *(int *)(param_1 + 0x20));

  iVar2 = *(int *)(param_1 + 0x34);

  if ((param_2 & 1) == 0) {

    iVar15 = 0;

    param_3 = 1;

  }

  else {

    iVar15 = *(int *)(param_1 + 0x68) + -1;

    param_3 = -1;

  }

  iVar6 = param_3;

  param_2 = (uint)in_FPUControlWord;

  uVar11 = 0;

  *(uint *)(param_1 + 0x7c) = param_2;

  pfVar8 = param_4;

  if (*(int *)(param_1 + 0x68) != 0) {

    do {

      uVar11 = uVar11 + 1;

      *pfVar8 = *pfVar8 * _DAT_007eb2cc + pfVar8[1] * _DAT_007eb2d0 + pfVar8[2] * _DAT_007eb2d4;

      pfVar8 = pfVar8 + 4;

    } while (uVar11 < *(uint *)(param_1 + 0x68));

  }

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar12 = param_3 * 0x10;

    iVar9 = iVar15 << 4;

    iVar13 = (param_3 + iVar15) * 0x10;

    param_3 = (iVar15 - param_3) * 0x10;

    do {

      fVar5 = _DAT_007edf18;

      fVar1 = *(float *)(iVar2 + (uVar10 + uVar7 * 8) * 4 + (param_2 & 3) * 4);

      fVar3 = (local_54 + *(float *)((int)param_4 + iVar9)) * _DAT_007edf1c;

      fVar4 = (local_48 + ((float *)((int)param_4 + iVar9))[3]) * _DAT_007edf1c;

      local_34 = (uint)ROUND(fVar3 + fVar1);

      iVar15 = (int)ROUND(fVar4 + fVar1);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar8 = (float *)(param_3 + 0x10 + *(int *)(param_1 + 0x5c));

        local_54 = (fVar3 - (float)(int)local_34) * _DAT_007edf18;

        *pfVar8 = _DAT_007edf08 * local_54 + *pfVar8;

        pfVar8 = (float *)(iVar9 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar8 = _DAT_007edf04 * local_54 + *pfVar8;

        pfVar8 = (float *)(iVar13 + 0x10 + *(int *)(param_1 + 0x5c));

        *pfVar8 = _DAT_007edf00 * local_54 + *pfVar8;

        pfVar8 = (float *)(param_3 + 0x1c + *(int *)(param_1 + 0x5c));

        local_54 = local_54 * (float)_DAT_007edef8;

        fVar5 = (fVar4 - (float)iVar15) * fVar5;

        *pfVar8 = _DAT_007edf08 * fVar5 + *pfVar8;

        pfVar8 = (float *)(iVar9 + 0x1c + *(int *)(param_1 + 0x5c));

        *pfVar8 = _DAT_007edf04 * fVar5 + *pfVar8;

        pfVar8 = (float *)(iVar13 + 0x1c + *(int *)(param_1 + 0x5c));

        *pfVar8 = _DAT_007edf00 * fVar5 + *pfVar8;

        local_48 = fVar5 * (float)_DAT_007edef8;

      }

      uVar11 = local_34;

      if (0xfffe < (int)local_34) {

        uVar11 = 0xffff;

      }

      if ((int)uVar11 < 1) {

        local_34 = 0;

      }

      else if (0xfffe < (int)local_34) {

        local_34 = 0xffff;

      }

      iVar16 = iVar15;

      if (0xfffe < iVar15) {

        iVar16 = 0xffff;

      }

      if (iVar16 < 1) {

        iVar15 = 0;

      }

      else if (0xfffe < iVar15) {

        iVar15 = 0xffff;

      }

      *puVar14 = iVar15 << 0x10 | local_34;

      puVar14 = puVar14 + iVar6;

      param_3 = param_3 + iVar12;

      iVar9 = iVar9 + iVar12;

      iVar13 = iVar13 + iVar12;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fbeef at 0x005FBEEF (size: 771) ---


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



void __thiscall FUN_005fbeef(int param_1,uint param_2,uint param_3,float *param_4)



{

  float *pfVar1;

  float fVar2;

  int iVar3;

  float fVar4;

  float fVar5;

  float fVar6;

  float fVar7;

  uint uVar8;

  int iVar9;

  uint uVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  int iVar14;

  int iVar15;

  undefined2 *puVar16;

  undefined2 in_FPUControlWord;

  float local_54;

  float local_50;

  float local_4c;

  int local_34;

  int local_30;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (float *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (float *)FUN_005f560f(param_4);

  }

  local_54 = 0.0;

  local_50 = 0.0;

  local_4c = 0.0;

  uVar10 = param_2 & 3;

  uVar8 = param_3 & 3;

  iVar3 = *(int *)(param_1 + 0x34);

  puVar16 = (undefined2 *)

            (*(int *)(param_1 + 0x60) * param_2 +

             (*(int *)(param_1 + 0x68) + -1) * (param_2 & 1) * 6 + *(int *)(param_1 + 100) * param_3

            + *(int *)(param_1 + 0x20));

  if ((param_2 & 1) == 0) {

    iVar14 = 0;

    iVar13 = 1;

    param_2 = 1;

  }

  else {

    iVar14 = *(int *)(param_1 + 0x68) + -1;

    param_2 = -1;

    iVar13 = -1;

  }

  param_3 = CONCAT22(param_3._2_2_,in_FPUControlWord);

  *(uint *)(param_1 + 0x7c) = param_3;

  if (*(int *)(param_1 + 0x5c) != 0) {

    FUN_005f592b(param_4);

    iVar13 = param_2;

  }

  param_2 = 0;

  if (*(int *)(param_1 + 0x68) != 0) {

    iVar11 = iVar13 * 0x10;

    iVar9 = iVar14 * 0x10;

    iVar12 = (iVar13 + iVar14) * 0x10;

    param_3 = (iVar14 - iVar13) * 0x10;

    param_4 = (float *)(iVar9 + 8 + (int)param_4);

    do {

      fVar7 = _DAT_007edf18;

      fVar2 = *(float *)(iVar3 + (uVar8 + uVar10 * 8) * 4 + (param_2 & 3) * 4);

      fVar4 = (local_54 + param_4[-2]) * _DAT_007edf1c;

      fVar5 = (local_50 + param_4[-1]) * _DAT_007edf1c;

      fVar6 = (local_4c + *param_4) * _DAT_007edf1c;

      local_34 = (int)ROUND(fVar4 + fVar2);

      local_30 = (int)ROUND(fVar5 + fVar2);

      iVar14 = (int)ROUND(fVar6 + fVar2);

      if (*(int *)(param_1 + 0x5c) != 0) {

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + param_3);

        local_54 = (fVar4 - (float)local_34) * _DAT_007edf18;

        *pfVar1 = _DAT_007edf08 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x10 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_54 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + param_3);

        local_54 = local_54 * (float)_DAT_007edef8;

        local_50 = (fVar5 - (float)local_30) * fVar7;

        *pfVar1 = _DAT_007edf08 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar9);

        *pfVar1 = _DAT_007edf04 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x14 + iVar12);

        *pfVar1 = _DAT_007edf00 * local_50 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + param_3);

        local_50 = local_50 * (float)_DAT_007edef8;

        fVar7 = (fVar6 - (float)iVar14) * fVar7;

        *pfVar1 = _DAT_007edf08 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar9);

        *pfVar1 = _DAT_007edf04 * fVar7 + *pfVar1;

        pfVar1 = (float *)(*(int *)(param_1 + 0x5c) + 0x18 + iVar12);

        *pfVar1 = _DAT_007edf00 * fVar7 + *pfVar1;

        local_4c = fVar7 * (float)_DAT_007edef8;

      }

      iVar15 = local_34;

      if (0xfffe < local_34) {

        iVar15 = 0xffff;

      }

      if (iVar15 < 1) {

        local_34 = 0;

      }

      else if (0xfffe < local_34) {

        local_34 = 0xffff;

      }

      iVar15 = local_30;

      if (0xfffe < local_30) {

        iVar15 = 0xffff;

      }

      if (iVar15 < 1) {

        local_30 = 0;

      }

      else if (0xfffe < local_30) {

        local_30 = 0xffff;

      }

      iVar15 = iVar14;

      if (0xfffe < iVar14) {

        iVar15 = 0xffff;

      }

      if (iVar15 < 1) {

        iVar14 = 0;

      }

      else if (0xfffe < iVar14) {

        iVar14 = 0xffff;

      }

      puVar16[1] = (undefined2)local_30;

      puVar16[2] = (undefined2)local_34;

      param_4 = param_4 + iVar13 * 4;

      param_3 = param_3 + iVar11;

      *puVar16 = (short)iVar14;

      puVar16 = puVar16 + iVar13 * 3;

      iVar9 = iVar9 + iVar11;

      iVar12 = iVar12 + iVar11;

      param_2 = param_2 + 1;

    } while (param_2 < *(uint *)(param_1 + 0x68));

  }

  return;

}





// --- FUN_005fc1f2 at 0x005FC1F2 (size: 152) ---


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



void __thiscall FUN_005fc1f2(int param_1,int param_2,int param_3,float *param_4)



{

  float fVar1;

  byte *pbVar2;

  int extraout_ECX;

  byte *pbVar3;

  

  fVar1 = _DAT_00799208;

  pbVar2 = (byte *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pbVar3 = pbVar2 + *(int *)(param_1 + 0x74);

  for (; pbVar2 < pbVar3; pbVar2 = pbVar2 + 3) {

    *param_4 = (float)pbVar2[2] * fVar1;

    param_4[1] = (float)pbVar2[1] * fVar1;

    param_4[2] = (float)*pbVar2 * fVar1;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc28a at 0x005FC28A (size: 178) ---


/* WARNING: Removing unreachable block (ram,0x005fc2e6) */

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



void __thiscall FUN_005fc28a(int param_1,int param_2,int param_3,float *param_4)



{

  uint *puVar1;

  float fVar2;

  uint *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_00799208;

  puVar3 = (uint *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)*(byte *)((int)puVar3 + 2) * fVar2;

    param_4[1] = (float)*(byte *)((int)puVar3 + 1) * fVar2;

    param_4[2] = (float)(*puVar3 & 0xff) * fVar2;

    param_4[3] = (float)*(byte *)((int)puVar3 + 3) * fVar2;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc33c at 0x005FC33C (size: 168) ---


/* WARNING: Removing unreachable block (ram,0x005fc398) */

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



void __thiscall FUN_005fc33c(int param_1,int param_2,int param_3,float *param_4)



{

  uint *puVar1;

  float fVar2;

  uint *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_00799208;

  puVar3 = (uint *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)*(byte *)((int)puVar3 + 2) * fVar2;

    param_4[1] = (float)*(byte *)((int)puVar3 + 1) * fVar2;

    param_4[2] = (float)(*puVar3 & 0xff) * fVar2;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc3e4 at 0x005FC3E4 (size: 173) ---


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



void __thiscall FUN_005fc3e4(int param_1,int param_2,int param_3,float *param_4)



{

  ushort *puVar1;

  float fVar2;

  ushort *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_007edee8;

  puVar3 = (ushort *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)(*puVar3 >> 0xb) * fVar2;

    param_4[1] = (float)((*puVar3 & 0x7e0) >> 5) * _DAT_007edee0;

    param_4[2] = (float)((byte)*puVar3 & 0x1f) * fVar2;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc491 at 0x005FC491 (size: 170) ---


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



void __thiscall FUN_005fc491(int param_1,int param_2,int param_3,float *param_4)



{

  ushort *puVar1;

  float fVar2;

  ushort *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_007edee8;

  puVar3 = (ushort *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)((*puVar3 & 0x7c00) >> 10) * fVar2;

    param_4[1] = (float)((*puVar3 & 0x3e0) >> 5) * fVar2;

    param_4[2] = (float)((byte)*puVar3 & 0x1f) * fVar2;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc53b at 0x005FC53B (size: 184) ---


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



void __thiscall FUN_005fc53b(int param_1,int param_2,int param_3,float *param_4)



{

  ushort *puVar1;

  float fVar2;

  ushort *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_007edee8;

  puVar3 = (ushort *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)((*puVar3 & 0x7c00) >> 10) * fVar2;

    param_4[1] = (float)((*puVar3 & 0x3e0) >> 5) * fVar2;

    param_4[2] = (float)((byte)*puVar3 & 0x1f) * fVar2;

    param_4[3] = (float)(*puVar3 >> 0xf);

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc5f3 at 0x005FC5F3 (size: 183) ---


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



void __thiscall FUN_005fc5f3(int param_1,int param_2,int param_3,float *param_4)



{

  ushort *puVar1;

  float fVar2;

  ushort *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_0079cc80;

  puVar3 = (ushort *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)(*(byte *)((int)puVar3 + 1) & 0xf) * fVar2;

    param_4[1] = (float)(byte)((byte)*puVar3 >> 4) * fVar2;

    param_4[2] = (float)((byte)*puVar3 & 0xf) * fVar2;

    param_4[3] = (float)(*puVar3 >> 0xc) * fVar2;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc6aa at 0x005FC6AA (size: 226) ---


/* WARNING: Removing unreachable block (ram,0x005fc70a) */

/* WARNING: Removing unreachable block (ram,0x005fc6ef) */

/* WARNING: Removing unreachable block (ram,0x005fc726) */

/* WARNING: Removing unreachable block (ram,0x005fc740) */

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



void __thiscall FUN_005fc6aa(int param_1,int param_2,int param_3,float *param_4)



{

  uint *puVar1;

  float fVar2;

  uint *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_007edf10;

  puVar3 = (uint *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)(*puVar3 & 0x3ff) * fVar2;

    param_4[1] = (float)(*puVar3 >> 10 & 0x3ff) * fVar2;

    param_4[2] = (float)(*puVar3 >> 0x14 & 0x3ff) * fVar2;

    param_4[3] = (float)(*puVar3 >> 0x1e) * _DAT_007e75f0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc78c at 0x005FC78C (size: 178) ---


/* WARNING: Removing unreachable block (ram,0x005fc7cb) */

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



void __thiscall FUN_005fc78c(int param_1,int param_2,int param_3,float *param_4)



{

  uint *puVar1;

  float fVar2;

  uint *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_00799208;

  puVar3 = (uint *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)(*puVar3 & 0xff) * fVar2;

    param_4[1] = (float)*(byte *)((int)puVar3 + 1) * fVar2;

    param_4[2] = (float)*(byte *)((int)puVar3 + 2) * fVar2;

    param_4[3] = (float)*(byte *)((int)puVar3 + 3) * fVar2;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc83e at 0x005FC83E (size: 168) ---


/* WARNING: Removing unreachable block (ram,0x005fc87d) */

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



void __thiscall FUN_005fc83e(int param_1,int param_2,int param_3,float *param_4)



{

  uint *puVar1;

  float fVar2;

  uint *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_00799208;

  puVar3 = (uint *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)(*puVar3 & 0xff) * fVar2;

    param_4[1] = (float)*(byte *)((int)puVar3 + 1) * fVar2;

    param_4[2] = (float)*(byte *)((int)puVar3 + 2) * fVar2;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc8e6 at 0x005FC8E6 (size: 158) ---


/* WARNING: Removing unreachable block (ram,0x005fc925) */

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



void __thiscall FUN_005fc8e6(int param_1,int param_2,int param_3,float *param_4)



{

  uint *puVar1;

  float fVar2;

  uint *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_007edf18;

  puVar3 = (uint *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)(*puVar3 & 0xffff) * fVar2;

    param_4[1] = (float)*(ushort *)((int)puVar3 + 2) * fVar2;

    param_4[2] = 1.0;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fc984 at 0x005FC984 (size: 226) ---


/* WARNING: Removing unreachable block (ram,0x005fc9e7) */

/* WARNING: Removing unreachable block (ram,0x005fc9cc) */

/* WARNING: Removing unreachable block (ram,0x005fca00) */

/* WARNING: Removing unreachable block (ram,0x005fca1a) */

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



void __thiscall FUN_005fc984(int param_1,int param_2,int param_3,float *param_4)



{

  uint *puVar1;

  float fVar2;

  uint *puVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_007edf10;

  puVar3 = (uint *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *param_4 = (float)(*puVar3 >> 0x14 & 0x3ff) * fVar2;

    param_4[1] = (float)(*puVar3 >> 10 & 0x3ff) * fVar2;

    param_4[2] = (float)(*puVar3 & 0x3ff) * fVar2;

    param_4[3] = (float)(*puVar3 >> 0x1e) * _DAT_007e75f0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fca66 at 0x005FCA66 (size: 250) ---


/* WARNING: Removing unreachable block (ram,0x005fcad2) */

/* WARNING: Removing unreachable block (ram,0x005fcab0) */

/* WARNING: Removing unreachable block (ram,0x005fcb00) */

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



void __thiscall FUN_005fca66(int param_1,int param_2,int param_3,float *param_4)



{

  uint *puVar1;

  float fVar2;

  ushort uVar3;

  uint *puVar4;

  

  puVar4 = (uint *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  puVar1 = puVar4 + *(int *)(param_1 + 0x68) * 2;

  fVar2 = _DAT_007edf18;

  for (; puVar4 < puVar1; puVar4 = puVar4 + 2) {

    *param_4 = (float)(*puVar4 & 0xffff) * fVar2;

    param_4[1] = (float)(*puVar4 >> 0x10) * fVar2;

    uVar3 = __aullshr();

    fVar2 = _DAT_007edf18;

    param_4[2] = (float)uVar3 * _DAT_007edf18;

    param_4[3] = (float)*(ushort *)((int)puVar4 + 6) * fVar2;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fcb60 at 0x005FCB60 (size: 170) ---


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



void __thiscall FUN_005fcb60(int param_1,int param_2,int param_3,float *param_4)



{

  float fVar1;

  byte *pbVar2;

  int extraout_ECX;

  byte *pbVar3;

  

  fVar1 = _DAT_007edf0c;

  pbVar2 = (byte *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pbVar3 = pbVar2 + *(int *)(param_1 + 0x68);

  for (; pbVar2 < pbVar3; pbVar2 = pbVar2 + 1) {

    *param_4 = (float)(*pbVar2 >> 5) * fVar1;

    param_4[1] = (float)(*pbVar2 >> 2 & 7) * fVar1;

    param_4[2] = (float)(*pbVar2 & 3) * _DAT_007e75f0;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fcc0a at 0x005FCC0A (size: 126) ---


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



void __thiscall FUN_005fcc0a(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  byte *pbVar1;

  int extraout_ECX;

  byte *pbVar2;

  

  pbVar1 = (byte *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pbVar2 = pbVar1 + *(int *)(param_1 + 0x68);

  for (; pbVar1 < pbVar2; pbVar1 = pbVar1 + 1) {

    *param_4 = 0;

    param_4[1] = 0;

    param_4[2] = 0;

    param_4[3] = (float)*pbVar1 * _DAT_00799208;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fcc88 at 0x005FCC88 (size: 186) ---


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



void __thiscall FUN_005fcc88(int param_1,int param_2,int param_3,float *param_4)



{

  byte *pbVar1;

  float fVar2;

  byte *pbVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_007edf0c;

  pbVar3 = (byte *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pbVar1 = pbVar3 + *(int *)(param_1 + 0x68) * 2;

  for (; pbVar3 < pbVar1; pbVar3 = pbVar3 + 2) {

    *param_4 = (float)(*pbVar3 >> 5) * fVar2;

    param_4[1] = (float)(*pbVar3 >> 2 & 7) * fVar2;

    param_4[2] = (float)(*pbVar3 & 3) * _DAT_007e75f0;

    param_4[3] = (float)pbVar3[1] * _DAT_00799208;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fcd42 at 0x005FCD42 (size: 167) ---


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



void __thiscall FUN_005fcd42(int param_1,int param_2,int param_3,float *param_4)



{

  byte *pbVar1;

  float fVar2;

  byte *pbVar3;

  int extraout_ECX;

  

  fVar2 = _DAT_0079cc80;

  pbVar3 = (byte *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pbVar1 = pbVar3 + *(int *)(param_1 + 0x68) * 2;

  for (; pbVar3 < pbVar1; pbVar3 = pbVar3 + 2) {

    *param_4 = (float)(pbVar3[1] & 0xf) * fVar2;

    param_4[1] = (float)(*pbVar3 >> 4) * fVar2;

    param_4[2] = (float)(*pbVar3 & 0xf) * fVar2;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fcde9 at 0x005FCDE9 (size: 144) ---


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



void __thiscall FUN_005fcde9(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  byte *pbVar1;

  byte *pbVar2;

  int extraout_ECX;

  undefined4 *puVar3;

  

  pbVar2 = (byte *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pbVar1 = pbVar2 + *(int *)(param_1 + 0x68) * 2;

  for (; pbVar2 < pbVar1; pbVar2 = pbVar2 + 2) {

    puVar3 = (undefined4 *)((uint)*pbVar2 * 0x10 + *(int *)(param_1 + 0x38));

    *param_4 = *puVar3;

    param_4[1] = puVar3[1];

    param_4[2] = puVar3[2];

    param_4[3] = puVar3[3];

    param_4[3] = (float)pbVar2[1] * _DAT_00799208;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fce79 at 0x005FCE79 (size: 111) ---


void __thiscall FUN_005fce79(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  undefined4 *puVar1;

  byte *pbVar2;

  int extraout_ECX;

  byte *pbVar3;

  undefined4 *puVar4;

  

  pbVar2 = (byte *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pbVar3 = pbVar2 + *(int *)(param_1 + 0x68);

  for (; pbVar2 < pbVar3; pbVar2 = pbVar2 + 1) {

    puVar4 = (undefined4 *)((uint)*pbVar2 * 0x10 + *(int *)(param_1 + 0x38));

    *param_4 = *puVar4;

    param_4[1] = puVar4[1];

    puVar1 = param_4 + 3;

    param_4[2] = puVar4[2];

    param_4 = param_4 + 4;

    *puVar1 = puVar4[3];

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fcee8 at 0x005FCEE8 (size: 122) ---


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



void __thiscall FUN_005fcee8(int param_1,int param_2,int param_3,float *param_4)



{

  float fVar1;

  byte *pbVar2;

  int extraout_ECX;

  byte *pbVar3;

  

  pbVar2 = (byte *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pbVar3 = pbVar2 + *(int *)(param_1 + 0x68);

  for (; pbVar2 < pbVar3; pbVar2 = pbVar2 + 1) {

    fVar1 = (float)*pbVar2 * _DAT_00799208;

    param_4[2] = fVar1;

    param_4[1] = fVar1;

    *param_4 = fVar1;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fcf62 at 0x005FCF62 (size: 145) ---


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



void __thiscall FUN_005fcf62(int param_1,int param_2,int param_3,float *param_4)



{

  byte *pbVar1;

  float fVar2;

  float fVar3;

  byte *pbVar4;

  int extraout_ECX;

  

  fVar3 = _DAT_00799208;

  pbVar4 = (byte *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pbVar1 = pbVar4 + *(int *)(param_1 + 0x68) * 2;

  for (; pbVar4 < pbVar1; pbVar4 = pbVar4 + 2) {

    fVar2 = (float)*pbVar4 * fVar3;

    param_4[2] = fVar2;

    param_4[1] = fVar2;

    *param_4 = fVar2;

    param_4[3] = (float)pbVar4[1] * fVar3;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fcff3 at 0x005FCFF3 (size: 145) ---


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



void __thiscall FUN_005fcff3(int param_1,int param_2,int param_3,float *param_4)



{

  float fVar1;

  float fVar2;

  byte *pbVar3;

  int extraout_ECX;

  byte *pbVar4;

  

  fVar2 = _DAT_0079cc80;

  pbVar3 = (byte *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pbVar4 = pbVar3 + *(int *)(param_1 + 0x68);

  for (; pbVar3 < pbVar4; pbVar3 = pbVar3 + 1) {

    fVar1 = (float)(*pbVar3 & 0xf) * fVar2;

    param_4[2] = fVar1;

    param_4[1] = fVar1;

    *param_4 = fVar1;

    param_4[3] = (float)(*pbVar3 >> 4) * fVar2;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd084 at 0x005FD084 (size: 174) ---


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



void __thiscall FUN_005fd084(int param_1,int param_2,int param_3,float *param_4)



{

  char *pcVar1;

  char cVar2;

  float fVar3;

  char *pcVar4;

  

  fVar3 = _DAT_007edf20;

  pcVar4 = (char *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pcVar1 = pcVar4 + *(int *)(param_1 + 0x68) * 2;

  for (; pcVar4 < pcVar1; pcVar4 = pcVar4 + 2) {

    cVar2 = pcVar4[1];

    *param_4 = (float)(int)(char)((*pcVar4 == -0x80) + *pcVar4) * fVar3;

    param_4[1] = (float)(int)(char)((cVar2 == -0x80) + cVar2) * fVar3;

    param_4[2] = 1.0;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd132 at 0x005FD132 (size: 211) ---


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



void __thiscall FUN_005fd132(int param_1,int param_2,int param_3,float *param_4)



{

  ushort *puVar1;

  float fVar2;

  ushort *puVar3;

  char cVar4;

  char cVar5;

  

  fVar2 = _DAT_0079cc80;

  puVar3 = (ushort *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    cVar5 = (char)((char)*puVar3 << 3) >> 3;

    cVar4 = (char)((char)(*puVar3 >> 5) << 3) >> 3;

    *param_4 = (float)(int)(char)((cVar5 == -0x10) + cVar5) * fVar2;

    param_4[1] = (float)(int)(char)((cVar4 == -0x10) + cVar4) * fVar2;

    param_4[2] = 1.0;

    param_4[3] = (float)(*puVar3 >> 10) * _DAT_007edee0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd205 at 0x005FD205 (size: 191) ---


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



void __thiscall FUN_005fd205(int param_1,int param_2,int param_3,float *param_4)



{

  char *pcVar1;

  float fVar2;

  char *pcVar3;

  char cVar4;

  

  fVar2 = _DAT_007edf20;

  pcVar3 = (char *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pcVar1 = pcVar3 + *(int *)(param_1 + 0x68) * 4;

  for (; pcVar3 < pcVar1; pcVar3 = pcVar3 + 4) {

    cVar4 = (char)((uint)*(undefined4 *)pcVar3 >> 8);

    *param_4 = (float)(int)(char)((*pcVar3 == -0x80) + *pcVar3) * fVar2;

    param_4[1] = (float)(int)(char)((cVar4 == -0x80) + cVar4) * fVar2;

    param_4[2] = 1.0;

    param_4[3] = (float)(byte)pcVar3[2] * _DAT_00799208;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd2c4 at 0x005FD2C4 (size: 238) ---


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



void __thiscall FUN_005fd2c4(int param_1,int param_2,int param_3,float *param_4)



{

  undefined4 *puVar1;

  undefined4 uVar2;

  char cVar3;

  float fVar4;

  undefined4 *puVar5;

  char cVar6;

  char cVar7;

  

  fVar4 = _DAT_007edf20;

  puVar5 = (undefined4 *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar1 = puVar5 + *(int *)(param_1 + 0x68);

  for (; puVar5 < puVar1; puVar5 = puVar5 + 1) {

    uVar2 = *puVar5;

    cVar3 = (char)((uint)uVar2 >> 0x10);

    cVar7 = (char)((uint)uVar2 >> 0x18);

    cVar6 = (char)((uint)uVar2 >> 8);

    *param_4 = (float)(int)(char)(((char)uVar2 == -0x80) + (char)uVar2) * fVar4;

    param_4[1] = (float)(int)(char)((cVar6 == -0x80) + cVar6) * fVar4;

    param_4[2] = (float)(int)(char)((cVar3 == -0x80) + cVar3) * fVar4;

    param_4[3] = (float)(int)(char)((cVar7 == -0x80) + cVar7) * fVar4;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd3b2 at 0x005FD3B2 (size: 181) ---


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



void __thiscall FUN_005fd3b2(int param_1,int param_2,int param_3,float *param_4)



{

  short *psVar1;

  short sVar2;

  float fVar3;

  short *psVar4;

  int extraout_ECX;

  

  fVar3 = _DAT_007cbd08;

  psVar4 = (short *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                    *(int *)(param_1 + 0x20));

  psVar1 = psVar4 + *(int *)(param_1 + 0x68) * 2;

  for (; psVar4 < psVar1; psVar4 = psVar4 + 2) {

    sVar2 = psVar4[1];

    *param_4 = (float)(int)(short)((ushort)(*psVar4 == -0x8000) + *psVar4) * fVar3;

    param_4[1] = (float)(int)(short)((ushort)(sVar2 == -0x8000) + sVar2) * fVar3;

    param_4[2] = 1.0;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd467 at 0x005FD467 (size: 268) ---


/* WARNING: Removing unreachable block (ram,0x005fd522) */

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



void __thiscall FUN_005fd467(int param_1,int param_2,int param_3,float *param_4)



{

  uint *puVar1;

  float fVar2;

  uint *puVar3;

  int extraout_ECX;

  short sVar4;

  short sVar5;

  short sVar6;

  

  fVar2 = _DAT_007ee04c;

  puVar3 = (uint *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    sVar4 = (short)((ushort)(*puVar3 >> 0x14) << 6) >> 6;

    sVar6 = (short)((short)*puVar3 << 6) >> 6;

    sVar5 = (short)((short)(*puVar3 >> 10) << 6) >> 6;

    *param_4 = (float)(int)(short)((ushort)(sVar6 == -0x200) + sVar6) * fVar2;

    param_4[1] = (float)(int)(short)((ushort)(sVar5 == -0x200) + sVar5) * fVar2;

    param_4[2] = (float)(int)(short)((ushort)(sVar4 == -0x200) + sVar4) * fVar2;

    param_4[3] = (float)(*puVar3 >> 0x1e) * _DAT_007e75f0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd573 at 0x005FD573 (size: 266) ---


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



void __thiscall FUN_005fd573(int param_1,int param_2,int param_3,float *param_4)



{

  short *psVar1;

  undefined4 uVar2;

  float *pfVar3;

  float fVar4;

  short *psVar5;

  int extraout_ECX;

  short sVar6;

  

  fVar4 = _DAT_007cbd08;

  psVar5 = (short *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                    *(int *)(param_1 + 0x20));

  psVar1 = psVar5 + *(int *)(param_1 + 0x68) * 4;

  pfVar3 = param_4;

  for (; psVar5 < psVar1; psVar5 = psVar5 + 4) {

    uVar2 = *(undefined4 *)(psVar5 + 2);

    sVar6 = (short)uVar2;

    param_4._0_2_ = (short)((uint)*(undefined4 *)psVar5 >> 0x10);

    *pfVar3 = (float)(int)(short)((ushort)(*psVar5 == -0x8000) + *psVar5) * fVar4;

    pfVar3[1] = (float)(int)(short)((ushort)((short)param_4 == -0x8000) + (short)param_4) * fVar4;

    param_2._0_2_ = (short)((uint)uVar2 >> 0x10);

    pfVar3[2] = (float)(int)(short)((ushort)(sVar6 == -0x8000) + sVar6) * fVar4;

    pfVar3[3] = (float)(int)(short)((ushort)((short)param_2 == -0x8000) + (short)param_2) * fVar4;

    pfVar3 = pfVar3 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(pfVar3 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(pfVar3 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd67d at 0x005FD67D (size: 212) ---


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



void __thiscall FUN_005fd67d(int param_1,int param_2,int param_3,float *param_4)



{

  char *pcVar1;

  char cVar2;

  float fVar3;

  float fVar4;

  float fVar5;

  char *pcVar6;

  

  fVar5 = _DAT_007edf20;

  pcVar6 = (char *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  pcVar1 = pcVar6 + *(int *)(param_1 + 0x68) * 2;

  for (; pcVar6 < pcVar1; pcVar6 = pcVar6 + 2) {

    cVar2 = pcVar6[1];

    fVar3 = (float)(int)(char)((*pcVar6 == -0x80) + *pcVar6) * fVar5;

    *param_4 = fVar3;

    fVar4 = (float)(int)(char)((cVar2 == -0x80) + cVar2) * fVar5;

    param_4[1] = fVar4;

    fVar3 = (_DAT_007938b0 - fVar3 * fVar3) - fVar4 * fVar4;

    if (fVar3 < DAT_00796344 == (fVar3 == DAT_00796344)) {

      fVar3 = SQRT(fVar3);

    }

    else {

      fVar3 = 0.0;

    }

    param_4[2] = fVar3;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd751 at 0x005FD751 (size: 124) ---


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



void __thiscall FUN_005fd751(int param_1,int param_2,int param_3,float *param_4)



{

  ushort *puVar1;

  float fVar2;

  ushort *puVar3;

  int extraout_ECX;

  

  puVar3 = (ushort *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    fVar2 = (float)*puVar3 * _DAT_007edf18;

    param_4[2] = fVar2;

    param_4[1] = fVar2;

    *param_4 = fVar2;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd7cd at 0x005FD7CD (size: 116) ---


void __thiscall FUN_005fd7cd(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  undefined4 *puVar1;

  undefined4 uVar2;

  undefined4 *puVar3;

  int extraout_ECX;

  

  puVar3 = (undefined4 *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68);

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    uVar2 = *puVar3;

    param_4[3] = 0x3f800000;

    *param_4 = uVar2;

    param_4[2] = 0x3f800000;

    param_4[1] = 0x3f800000;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fd841 at 0x005FD841 (size: 132) ---


void __thiscall FUN_005fd841(int param_1,int param_2,int param_3,int param_4)



{

  uint uVar1;

  uint uVar2;

  

  uVar2 = *(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

          *(int *)(param_1 + 0x20);

  uVar1 = uVar2 + *(int *)(param_1 + 0x68) * 2;

  for (; uVar2 < uVar1; uVar2 = uVar2 + 2) {

    thunk_FUN_005e038f(param_4,uVar2,1);

    *(undefined4 *)(param_4 + 0xc) = 0x3f800000;

    *(undefined4 *)(param_4 + 8) = 0x3f800000;

    *(undefined4 *)(param_4 + 4) = 0x3f800000;

    param_4 = param_4 + 0x10;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -0x10);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -0x10);

  }

  return;

}





// --- FUN_005fd8c5 at 0x005FD8C5 (size: 128) ---


void __thiscall FUN_005fd8c5(int param_1,int param_2,int param_3,int param_4)



{

  uint uVar1;

  uint uVar2;

  

  uVar2 = *(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

          *(int *)(param_1 + 0x20);

  uVar1 = uVar2 + *(int *)(param_1 + 0x68) * 4;

  for (; uVar2 < uVar1; uVar2 = uVar2 + 4) {

    thunk_FUN_005e038f(param_4,uVar2,2);

    *(undefined4 *)(param_4 + 0xc) = 0x3f800000;

    *(undefined4 *)(param_4 + 8) = 0x3f800000;

    param_4 = param_4 + 0x10;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -0x10);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -0x10);

  }

  return;

}





// --- FUN_005fd945 at 0x005FD945 (size: 80) ---


void __thiscall FUN_005fd945(int param_1,int param_2,int param_3,undefined4 param_4)



{

  thunk_FUN_005e038f(param_4,*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3

                             + *(int *)(param_1 + 0x20),*(int *)(param_1 + 0x68) << 2);

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4);

  }

  return;

}





// --- FUN_005fd995 at 0x005FD995 (size: 117) ---


void __thiscall FUN_005fd995(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  undefined4 *puVar1;

  undefined4 uVar2;

  undefined4 *puVar3;

  int extraout_ECX;

  

  puVar3 = (undefined4 *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar1 = puVar3 + *(int *)(param_1 + 0x68) * 2;

  for (; puVar3 < puVar1; puVar3 = puVar3 + 2) {

    *param_4 = *puVar3;

    uVar2 = puVar3[1];

    param_4[3] = 0x3f800000;

    param_4[1] = uVar2;

    param_4[2] = 0x3f800000;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fda0a at 0x005FDA0A (size: 91) ---


void __thiscall FUN_005fda0a(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  uint uVar1;

  int iVar2;

  undefined4 *puVar3;

  undefined4 *puVar4;

  

  puVar3 = (undefined4 *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar4 = param_4;

  for (uVar1 = (uint)(*(int *)(param_1 + 0x68) << 4) >> 2; uVar1 != 0; uVar1 = uVar1 - 1) {

    *puVar4 = *puVar3;

    puVar3 = puVar3 + 1;

    puVar4 = puVar4 + 1;

  }

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

    *(undefined1 *)puVar4 = *(undefined1 *)puVar3;

    puVar3 = (undefined4 *)((int)puVar3 + 1);

    puVar4 = (undefined4 *)((int)puVar4 + 1);

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4);

  }

  return;

}





// --- FUN_005fda65 at 0x005FDA65 (size: 154) ---


/* WARNING: Removing unreachable block (ram,0x005fdaa4) */

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



void __thiscall FUN_005fda65(int param_1,int param_2,int param_3,float *param_4)



{

  uint *puVar1;

  float fVar2;

  float fVar3;

  uint *puVar4;

  int extraout_ECX;

  

  fVar3 = _DAT_007edf18;

  puVar4 = (uint *)(*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

  puVar1 = puVar4 + *(int *)(param_1 + 0x68);

  for (; puVar4 < puVar1; puVar4 = puVar4 + 1) {

    fVar2 = (float)(*puVar4 & 0xffff) * fVar3;

    param_4[2] = fVar2;

    param_4[1] = fVar2;

    *param_4 = fVar2;

    param_4[3] = (float)*(ushort *)((int)puVar4 + 2) * fVar3;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fdaff at 0x005FDAFF (size: 152) ---


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



void __thiscall FUN_005fdaff(int param_1,int param_2,int param_3,float *param_4)



{

  float fVar1;

  ushort *puVar2;

  int extraout_ECX;

  ushort *puVar3;

  

  fVar1 = _DAT_007edf18;

  puVar2 = (ushort *)

           (*(int *)(param_1 + 0x60) * param_2 + *(int *)(param_1 + 100) * param_3 +

           *(int *)(param_1 + 0x20));

  puVar3 = (ushort *)(*(int *)(param_1 + 0x74) + (int)puVar2);

  for (; puVar2 < puVar3; puVar2 = puVar2 + 3) {

    *param_4 = (float)puVar2[2] * fVar1;

    param_4[1] = (float)puVar2[1] * fVar1;

    param_4[2] = (float)*puVar2 * fVar1;

    param_4[3] = 1.0;

    param_4 = param_4 + 4;

  }

  if (*(int *)(param_1 + 0x18) != 0) {

    FUN_005f5595(param_4 + *(int *)(param_1 + 0x68) * -4);

    param_1 = extraout_ECX;

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(param_4 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fdb97 at 0x005FDB97 (size: 238) ---


undefined4 * __thiscall FUN_005fdb97(undefined4 *param_1,int param_2)



{

  uint uVar1;

  int iVar2;

  int iVar3;

  

  FUN_005f518f(param_2,0,1);

  uVar1 = param_1[0x11] + 1 & 0xfffffffe;

  iVar3 = uVar1 - (param_1[0xf] & 0xfffffffe);

  param_1[0x23] = uVar1;

  *param_1 = &PTR_FUN_007ee1a4;

  param_1[0x21] = param_1[0xf] & 0xfffffffe;

  param_1[0x22] = 0;

  param_1[0x25] = 0;

  param_1[0x24] = 0;

  param_1[0x26] = 0;

  param_1[0x27] = iVar3;

  param_1[0x28] = 0;

  param_1[0x29] = 1;

  iVar2 = FUN_005df0f5(iVar3 * 0x10);

  if (iVar2 == 0) {

    iVar2 = 0;

  }

  else {

    FUN_00401000(iVar2,0x10,iVar3,&LAB_005eda5e);

  }

  param_1[0x20] = iVar2;

  if (iVar2 == 0) {

    param_1[0x29] = 0;

  }

  iVar2 = *(int *)(param_2 + 4);

  if (iVar2 == 0x32595559) {

LAB_005fdc6c:

    param_1[0x2a] = 0;

    param_1[0x2b] = 8;

  }

  else {

    if (iVar2 != 0x42475247) {

      if (iVar2 == 0x47424752) goto LAB_005fdc6c;

      if (iVar2 != 0x59565955) {

        return param_1;

      }

    }

    param_1[0x2a] = 8;

    param_1[0x2b] = 0;

  }

  return param_1;

}





// --- FUN_005fdc85 at 0x005FDC85 (size: 41) ---


void __fastcall FUN_005fdc85(undefined4 *param_1)



{

  *param_1 = &PTR_FUN_007ee1a4;

  FUN_005f4603();

  if ((void *)param_1[0x20] != (void *)0x0) {

    operator_delete((void *)param_1[0x20]);

  }

  FUN_005f40bf();

  return;

}





// --- FUN_005fdcae at 0x005FDCAE (size: 142) ---


void __thiscall FUN_005fdcae(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  int iVar1;

  uint uVar2;

  undefined4 *puVar3;

  

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (undefined4 *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (undefined4 *)FUN_005f560f(param_4);

  }

  iVar1 = FUN_005f4906(param_2 + *(int *)(param_1 + 0x40),param_3 + *(int *)(param_1 + 0x4c),

                       *(int *)(param_1 + 0x9c) != *(int *)(param_1 + 0x68));

  if (-1 < iVar1) {

    puVar3 = (undefined4 *)

             ((*(int *)(param_1 + 0x3c) - *(int *)(param_1 + 0x84)) * 0x10 +

             *(int *)(param_1 + 0x80));

    for (uVar2 = (uint)(*(int *)(param_1 + 0x68) << 4) >> 2; uVar2 != 0; uVar2 = uVar2 - 1) {

      *puVar3 = *param_4;

      param_4 = param_4 + 1;

      puVar3 = puVar3 + 1;

    }

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

      *(undefined1 *)puVar3 = *(undefined1 *)param_4;

      param_4 = (undefined4 *)((int)param_4 + 1);

      puVar3 = (undefined4 *)((int)puVar3 + 1);

    }

    *(undefined4 *)(param_1 + 0xa0) = 1;

  }

  return;

}





// --- FUN_005fdd3c at 0x005FDD3C (size: 117) ---


void __thiscall FUN_005fdd3c(int param_1,int param_2,int param_3,undefined4 *param_4)



{

  int iVar1;

  uint uVar2;

  undefined4 *puVar3;

  undefined4 *puVar4;

  

  iVar1 = FUN_005f4906(param_2 + *(int *)(param_1 + 0x40),param_3 + *(int *)(param_1 + 0x4c),1);

  if (-1 < iVar1) {

    puVar3 = (undefined4 *)

             ((*(int *)(param_1 + 0x3c) - *(int *)(param_1 + 0x84)) * 0x10 +

             *(int *)(param_1 + 0x80));

    puVar4 = param_4;

    for (uVar2 = (uint)(*(int *)(param_1 + 0x68) << 4) >> 2; uVar2 != 0; uVar2 = uVar2 - 1) {

      *puVar4 = *puVar3;

      puVar3 = puVar3 + 1;

      puVar4 = puVar4 + 1;

    }

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

      *(undefined1 *)puVar4 = *(undefined1 *)puVar3;

      puVar3 = (undefined4 *)((int)puVar3 + 1);

      puVar4 = (undefined4 *)((int)puVar4 + 1);

    }

    if (*(int *)(param_1 + 0x18) != 0) {

      FUN_005f5595(param_4);

    }

    if (*(int *)(param_1 + 0x10) != 0) {

      FUN_005f5802(param_4);

    }

  }

  return;

}





// --- FUN_005fddb1 at 0x005FDDB1 (size: 488) ---


undefined4 * __thiscall FUN_005fddb1(undefined4 *param_1,int param_2)



{

  uint uVar1;

  int iVar2;

  uint uVar3;

  uint *puVar4;

  uint *puVar5;

  

  FUN_005f518f(param_2,0,1);

  iVar2 = param_1[1];

  *param_1 = &PTR_FUN_007ee1b4;

  if (iVar2 == 0x31545844) {

    param_1[0x22] = 8;

    param_1[0x24] = FUN_00601f9e;

    param_1[0x23] = FUN_00601c99;

  }

  else if (iVar2 == 0x32545844) {

    param_1[0x22] = 0x10;

    param_1[0x24] = FUN_00602711;

    param_1[0x23] = FUN_006026c5;

  }

  else if (iVar2 == 0x33545844) {

    param_1[0x22] = 0x10;

    param_1[0x24] = FUN_006020c2;

    param_1[0x23] = FUN_00601ddb;

  }

  else if (iVar2 == 0x34545844) {

    param_1[0x22] = 0x10;

    param_1[0x24] = FUN_0060274a;

    param_1[0x23] = FUN_006026eb;

  }

  else if (iVar2 == 0x35545844) {

    param_1[0x22] = 0x10;

    param_1[0x24] = FUN_006021f1;

    param_1[0x23] = FUN_00601e60;

  }

  puVar4 = (uint *)(param_2 + 0x10);

  puVar5 = param_1 + 0x25;

  for (iVar2 = 6; iVar2 != 0; iVar2 = iVar2 + -1) {

    *puVar5 = *puVar4;

    puVar4 = puVar4 + 1;

    puVar5 = puVar5 + 1;

  }

  param_1[0x2b] = param_1[0x25] & 0xfffffffc;

  param_1[0x2c] = param_1[0x26] & 0xfffffffc;

  param_1[0x2f] = param_1[0x29];

  param_1[0x2d] = param_1[0x27] + 3 & 0xfffffffc;

  param_1[0x3a] = 0xffffffff;

  param_1[0x3b] = 0xffffffff;

  param_1[0x2e] = param_1[0x28] + 3 & 0xfffffffc;

  param_1[0x30] = param_1[0x2a];

  param_1[0x35] = param_1[0x13];

  uVar1 = param_1[0x11] + 3 & 0xfffffffc;

  param_1[0x33] = uVar1;

  uVar3 = param_1[0x12] + 3 & 0xfffffffc;

  param_1[0x34] = uVar3;

  param_1[0x37] = uVar1 - (param_1[0xf] & 0xfffffffc) >> 2;

  param_1[0x36] = param_1[0x14];

  param_1[0x3c] = 0;

  param_1[0x3d] = 0;

  param_1[0x3e] = 0;

  param_1[0x31] = param_1[0xf] & 0xfffffffc;

  param_1[0x32] = param_1[0x10] & 0xfffffffc;

  param_1[0x38] = uVar3 - (param_1[0x10] & 0xfffffffc) >> 2;

  param_1[0x39] = param_1[0x14] - param_1[0x13];

  param_1[0x3f] = *(undefined4 *)(param_2 + 0x40);

  return param_1;

}





// --- FUN_005fdf99 at 0x005FDF99 (size: 33) ---


void * __thiscall FUN_005fdf99(void *param_1,byte param_2)



{

  FUN_005f4f8d();

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_005fdfba at 0x005FDFBA (size: 1057) ---


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



{

  undefined4 *puVar1;

  uint uVar2;

  undefined4 uVar3;

  uint uVar4;

  int iVar5;

  uint uVar6;

  uint *puVar7;

  undefined4 *puVar8;

  uint local_24 [5];

  uint local_10;

  uint local_c;

  uint *local_8;

  

  param_2 = param_2 + *(int *)(param_1 + 0x40);

  param_3 = param_3 + *(int *)(param_1 + 0x4c);

  if (*(int *)(param_1 + 0xf8) == 0) {

    puVar1 = (undefined4 *)FUN_005df0f5(*(int *)(param_1 + 0xe0) * *(int *)(param_1 + 0xe4) * 8);

    *(undefined4 **)(param_1 + 0xf8) = puVar1;

    if (puVar1 == (undefined4 *)0x0) {

      return;

    }

    for (uVar4 = (uint)(*(int *)(param_1 + 0xe0) * *(int *)(param_1 + 0xe4) * 8) >> 2; uVar4 != 0;

        uVar4 = uVar4 - 1) {

      *puVar1 = 0;

      puVar1 = puVar1 + 1;

    }

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

      *(undefined1 *)puVar1 = 0;

      puVar1 = (undefined4 *)((int)puVar1 + 1);

    }

  }

  puVar7 = (uint *)(*(int *)(param_1 + 0xf8) +

                   ((param_3 - *(int *)(param_1 + 0xd4)) * *(int *)(param_1 + 0xe0) +

                   (param_2 - *(int *)(param_1 + 200) >> 2)) * 8);

  local_8 = puVar7;

  if (puVar7[1] == 0) {

    iVar5 = *(int *)(param_1 + 0xdc);

    local_24[4] = FUN_005df0f5(iVar5 << 8);

    if (local_24[4] == 0) {

      uVar4 = 0;

    }

    else {

      FUN_00401000(local_24[4],0x10,iVar5 << 4,&LAB_005eda5e);

      uVar4 = local_24[4];

    }

    puVar7[1] = uVar4;

    if (uVar4 == 0) {

      return;

    }

    *puVar7 = 0;

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

  }

  if (*puVar7 == 0) {

    local_24[4] = param_2 & 0xfffffffc;

    if (((local_24[4] < *(uint *)(param_1 + 0x40)) &&

        (*(uint *)(param_1 + 0x98) < *(uint *)(param_1 + 0x40))) ||

       ((*(uint *)(param_1 + 0x48) < local_24[4] + 4 &&

        (*(uint *)(param_1 + 0x48) < *(uint *)(param_1 + 0xa0))))) {

      local_10 = *(uint *)(param_1 + 0xc4);

      iVar5 = (param_2 >> 2) * *(int *)(param_1 + 0x60) + (local_10 >> 2) * *(int *)(param_1 + 0x88)

              + *(int *)(param_1 + 100) * param_3 + *(int *)(param_1 + 0x20);

      local_c = puVar7[1];

      if (local_10 < *(uint *)(param_1 + 0xcc)) {

        do {

          (**(code **)(param_1 + 0x8c))(local_c,iVar5);

          local_10 = local_10 + 4;

          iVar5 = iVar5 + *(int *)(param_1 + 0x88);

          local_c = local_c + 0x100;

        } while (local_10 < *(uint *)(param_1 + 0xcc));

      }

    }

    else {

      if ((*(uint *)(param_1 + 0xc4) < *(uint *)(param_1 + 0x3c)) &&

         (*(uint *)(param_1 + 0x94) < *(uint *)(param_1 + 0x3c))) {

        (**(code **)(param_1 + 0x8c))

                  (puVar7[1],

                   (*(uint *)(param_1 + 0xc4) >> 2) * *(int *)(param_1 + 0x88) +

                   (param_2 >> 2) * *(int *)(param_1 + 0x60) + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

      }

      if ((*(uint *)(param_1 + 0x44) < *(uint *)(param_1 + 0xcc)) &&

         (*(uint *)(param_1 + 0x44) < *(uint *)(param_1 + 0x9c))) {

        (**(code **)(param_1 + 0x8c))

                  (puVar7[1],

                   (*(uint *)(param_1 + 0xcc) - 4 >> 2) * *(int *)(param_1 + 0x88) +

                   (param_2 >> 2) * *(int *)(param_1 + 0x60) + *(int *)(param_1 + 100) * param_3 +

                   *(int *)(param_1 + 0x20));

      }

    }

    uVar4 = 0;

    do {

      if ((uVar4 + local_24[4] < *(uint *)(param_1 + 0x40)) ||

         (*(uint *)(param_1 + 0x48) <= uVar4 + local_24[4])) {

        *puVar7 = *puVar7 | 1 << ((byte)uVar4 & 0x1f);

      }

      uVar4 = uVar4 + 1;

    } while (uVar4 < 4);

  }

  if (*(int *)(param_1 + 0x54) != 0) {

    param_4 = (undefined4 *)FUN_005f40ea(param_4);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    param_4 = (undefined4 *)FUN_005f560f(param_4);

  }

  uVar4 = *(int *)(param_1 + 0x3c) - *(int *)(param_1 + 0xc4);

  iVar5 = *(int *)(param_1 + 200);

  local_24[4] = *(int *)(param_1 + 0x68) + uVar4;

  for (; uVar4 < local_24[4]; uVar4 = uVar4 + 1) {

    puVar1 = (undefined4 *)

             (((uVar4 & 0xfffffffc | param_2 - iVar5 & 3) << 2 | uVar4 & 3) * 0x10 + puVar7[1]);

    *puVar1 = *param_4;

    puVar1[1] = param_4[1];

    puVar1[2] = param_4[2];

    puVar1[3] = param_4[3];

    puVar7 = local_8;

    param_4 = param_4 + 4;

  }

  *puVar7 = *puVar7 | 1 << ((byte)param_2 & 3);

  if (*puVar7 == 0xf) {

    local_c = *(uint *)(param_1 + 0xc4);

    iVar5 = (param_2 >> 2) * *(int *)(param_1 + 0x60) + (local_c >> 2) * *(int *)(param_1 + 0x88) +

            *(int *)(param_1 + 100) * param_3 + *(int *)(param_1 + 0x20);

    param_4 = (undefined4 *)puVar7[1];

    if (local_c < *(uint *)(param_1 + 0xcc)) {

      local_24[0] = 0;

      local_24[1] = 0;

      local_24[2] = 0;

      local_24[4] = param_2 & 0xfffffffc;

      local_24[3] = 1;

      do {

        uVar2 = *(int *)(param_1 + 0x9c) - local_c;

        uVar4 = *(int *)(param_1 + 0xa0) - local_24[4];

        if ((uVar2 < 4) && (param_2 = 0, uVar4 != 0)) {

          do {

            uVar6 = uVar2;

            if (3 < param_2) break;

            do {

              puVar1 = (undefined4 *)((local_24[uVar6] | param_2 << 2) * 0x10 + (int)param_4);

              puVar8 = (undefined4 *)((param_2 << 2 | uVar6) * 0x10 + (int)param_4);

              uVar6 = uVar6 + 1;

              *puVar8 = *puVar1;

              puVar8[1] = puVar1[1];

              puVar8[2] = puVar1[2];

              puVar8[3] = puVar1[3];

            } while (uVar6 < 4);

            param_2 = param_2 + 1;

            puVar7 = local_8;

          } while (param_2 < uVar4);

        }

        for (; uVar4 < 4; uVar4 = uVar4 + 1) {

          uVar2 = local_24[uVar4];

          uVar6 = 0;

          do {

            puVar8 = (undefined4 *)((uVar4 << 2 | uVar6) * 0x10 + (int)param_4);

            puVar1 = (undefined4 *)((uVar2 << 2 | uVar6) * 0x10 + (int)param_4);

            uVar6 = uVar6 + 1;

            *puVar8 = *puVar1;

            puVar8[1] = puVar1[1];

            puVar8[2] = puVar1[2];

            puVar8[3] = puVar1[3];

          } while (uVar6 < 4);

          puVar7 = local_8;

        }

        uVar3 = 0;

        if ((*(int *)(param_1 + 0xfc) != 0) || (*(int *)(param_1 + 0x5c) != 0)) {

          uVar3 = 1;

        }

        (**(code **)(param_1 + 0x90))(iVar5,param_4,uVar3);

        local_c = local_c + 4;

        iVar5 = iVar5 + *(int *)(param_1 + 0x88);

        param_4 = (undefined4 *)((int)param_4 + 0x100);

      } while (local_c < *(uint *)(param_1 + 0xcc));

    }

    if (((puVar7 + 2 <

          (uint *)(*(int *)(param_1 + 0xf8) +

                  *(int *)(param_1 + 0xe4) * *(int *)(param_1 + 0xe0) * 8)) && (puVar7[2] == 0)) &&

       (puVar7[3] == 0)) {

      puVar7[3] = puVar7[1];

      puVar7[1] = 0;

    }

    else {

      operator_delete((void *)puVar7[1]);

      *(int *)(param_1 + 0xf4) = *(int *)(param_1 + 0xf4) + -1;

    }

    puVar7[1] = 0;

  }

  return;

}





// --- FUN_005fe3db at 0x005FE3DB (size: 651) ---


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



void __thiscall FUN_005fe3db(int param_1,int param_2,int param_3,float *param_4)



{

  int iVar1;

  int iVar2;

  uint uVar3;

  uint uVar4;

  float *pfVar5;

  float *pfVar6;

  uint uVar7;

  float *pfVar8;

  undefined2 in_FPUControlWord;

  

  uVar7 = param_2 + *(int *)(param_1 + 0x40);

  param_3 = param_3 + *(int *)(param_1 + 0x4c);

  if (*(int *)(param_1 + 0xf0) == 0) {

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

    iVar2 = FUN_005df0f5(iVar1 << 8);

    if (iVar2 == 0) {

      iVar2 = 0;

    }

    else {

      FUN_00401000(iVar2,0x10,iVar1 << 4,&LAB_005eda5e);

    }

    *(int *)(param_1 + 0xf0) = iVar2;

    if (iVar2 == 0) {

      return;

    }

  }

  if (((uVar7 & 0xfffffffc) != *(uint *)(param_1 + 0xe8)) || (param_3 != *(int *)(param_1 + 0xec)))

  {

    *(uint *)(param_1 + 0xe8) = uVar7 & 0xfffffffc;

    uVar3 = *(uint *)(param_1 + 0xc4);

    param_2 = (uVar7 >> 2) * *(int *)(param_1 + 0x60) + (uVar3 >> 2) * *(int *)(param_1 + 0x88) +

              *(int *)(param_1 + 100) * param_3 + *(int *)(param_1 + 0x20);

    *(int *)(param_1 + 0xec) = param_3;

    param_3 = *(int *)(param_1 + 0xf0);

    for (; uVar3 < *(uint *)(param_1 + 0xcc); uVar3 = uVar3 + 4) {

      (**(code **)(param_1 + 0x8c))(param_3,param_2);

      param_2 = param_2 + *(int *)(param_1 + 0x88);

      param_3 = param_3 + 0x100;

    }

  }

  iVar1 = *(int *)(param_1 + 200);

  uVar3 = *(int *)(param_1 + 0x3c) - *(int *)(param_1 + 0xc4);

  uVar4 = *(int *)(param_1 + 0x68) + uVar3;

  pfVar5 = param_4;

  for (; uVar3 < uVar4; uVar3 = uVar3 + 1) {

    pfVar8 = (float *)(((uVar3 & 0xfffffffc | uVar7 - iVar1 & 3) << 2 | uVar3 & 3) * 0x10 +

                      *(int *)(param_1 + 0xf0));

    *pfVar5 = *pfVar8;

    pfVar5[1] = pfVar8[1];

    pfVar6 = pfVar5 + 3;

    pfVar5[2] = pfVar8[2];

    pfVar5 = pfVar5 + 4;

    *pfVar6 = pfVar8[3];

  }

  pfVar6 = pfVar5;

  if (*(int *)(param_1 + 0x18) != 0) {

    param_4 = (float *)CONCAT22(param_4._2_2_,in_FPUControlWord);

    *(float **)(param_1 + 0x7c) = param_4;

    for (pfVar6 = pfVar5 + *(int *)(param_1 + 0x68) * -4; pfVar6 < pfVar5; pfVar6 = pfVar6 + 4) {

      if (((((float)(int)ROUND(*pfVar6 * _DAT_007edeec + _DAT_007938b8) * _DAT_007edee8 ==

             *(float *)(param_1 + 0x24)) &&

           ((float)(int)ROUND(pfVar6[1] * _DAT_007edee4 + _DAT_007938b8) * _DAT_007edee0 ==

            *(float *)(param_1 + 0x28))) &&

          ((float)(int)ROUND(pfVar6[2] * _DAT_007edeec + _DAT_007938b8) * _DAT_007edee8 ==

           *(float *)(param_1 + 0x2c))) &&

         ((float)(int)ROUND(pfVar6[3] * *(float *)(param_1 + 0x80) + _DAT_007938b8) *

          *(float *)(param_1 + 0x84) == *(float *)(param_1 + 0x30))) {

        *pfVar6 = 0.0;

        pfVar6[1] = 0.0;

        pfVar6[2] = 0.0;

        pfVar6[3] = 0.0;

      }

    }

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    FUN_005f5802(pfVar6 + *(int *)(param_1 + 0x68) * -4);

  }

  return;

}





// --- FUN_005fe666 at 0x005FE666 (size: 29) ---


undefined4 * __thiscall FUN_005fe666(undefined4 *param_1,undefined4 param_2)



{

  FUN_005fdb97(param_2);

  *param_1 = &PTR_FUN_007ee1a4;

  return param_1;

}





// --- FUN_005fe683 at 0x005FE683 (size: 29) ---


undefined4 * __thiscall FUN_005fe683(undefined4 *param_1,undefined4 param_2)



{

  FUN_005fddb1(param_2);

  *param_1 = &PTR_FUN_007ee1b4;

  return param_1;

}





// --- FUN_005fe6a0 at 0x005FE6A0 (size: 33) ---


void * __thiscall FUN_005fe6a0(void *param_1,byte param_2)



{

  FUN_005fdc85();

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_005fe6c1 at 0x005FE6C1 (size: 1916) ---


int * FUN_005fe6c1(int param_1)



{

  int iVar1;

  int *piVar2;

  

  iVar1 = *(int *)(param_1 + 4);

  if (iVar1 < 0x31545845) {

    if (iVar1 == 0x31545844) {

      iVar1 = FUN_005df0f5(0x100);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fe683(param_1);

    }

    else if (iVar1 < 0x33) {

      if (iVar1 == 0x32) {

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005faf9c(param_1);

      }

      else {

        switch(iVar1) {

        case 0x14:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) {

LAB_005fee04:

            piVar2 = (int *)0x0;

          }

          else {

            piVar2 = (int *)FUN_005fa30b(param_1);

          }

          break;

        case 0x15:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fa32c(param_1);

          break;

        case 0x16:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fa34d(param_1);

          break;

        case 0x17:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fa71a(param_1);

          break;

        case 0x18:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fa73b(param_1);

          break;

        case 0x19:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fa75c(param_1);

          break;

        case 0x1a:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fa77d(param_1);

          break;

        case 0x1b:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fa7bf(param_1);

          break;

        case 0x1c:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fa7e0(param_1);

          break;

        case 0x1d:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fa801(param_1);

          break;

        case 0x1e:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005faa99(param_1);

          break;

        case 0x1f:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005faaba(param_1);

          break;

        case 0x20:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005faadb(param_1);

          break;

        case 0x21:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005faafc(param_1);

          break;

        case 0x22:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fab1d(param_1);

          break;

        case 0x23:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fab3e(param_1);

          break;

        case 0x24:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fab5f(param_1);

          break;

        default:

          goto LAB_005fee37;

        case 0x28:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fab80(param_1);

          break;

        case 0x29:

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005faf7b(param_1);

        }

      }

    }

    else if (iVar1 < 0x52) {

      if (iVar1 == 0x51) {

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005fafff(param_1);

      }

      else if (iVar1 < 0x3f) {

        if (iVar1 == 0x3e) {

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fb437(param_1);

        }

        else if (iVar1 == 0x33) {

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fafbd(param_1);

        }

        else if (iVar1 == 0x34) {

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fafde(param_1);

        }

        else if (iVar1 == 0x3c) {

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fb020(param_1);

        }

        else {

          if (iVar1 != 0x3d) {

            return (int *)0x0;

          }

          iVar1 = FUN_005df0f5(0x80);

          if (iVar1 == 0) goto LAB_005fee04;

          piVar2 = (int *)FUN_005fb041(param_1);

        }

      }

      else if (iVar1 == 0x3f) {

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005fb458(param_1);

      }

      else if (iVar1 == 0x40) {

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005fb479(param_1);

      }

      else if (iVar1 == 0x43) {

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005fb49a(param_1);

      }

      else {

        if (iVar1 != 0x46) {

          return (int *)0x0;

        }

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005fafff(param_1);

      }

    }

    else if (iVar1 < 0x72) {

      if (iVar1 == 0x71) {

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005fb7af(param_1);

      }

      else if (iVar1 == 0x52) {

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005fb7d0(param_1);

      }

      else if (iVar1 == 0x6e) {

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005fb4bb(param_1);

      }

      else if (iVar1 == 0x6f) {

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005fb76d(param_1);

      }

      else {

        if (iVar1 != 0x70) {

          return (int *)0x0;

        }

        iVar1 = FUN_005df0f5(0x80);

        if (iVar1 == 0) goto LAB_005fee04;

        piVar2 = (int *)FUN_005fb78e(param_1);

      }

    }

    else if (iVar1 == 0x72) {

      iVar1 = FUN_005df0f5(0x80);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fb7d0(param_1);

    }

    else if (iVar1 == 0x73) {

      iVar1 = FUN_005df0f5(0x80);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fb7f1(param_1);

    }

    else if (iVar1 == 0x74) {

      iVar1 = FUN_005df0f5(0x80);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fb812(param_1);

    }

    else {

      if (iVar1 != 0x75) {

        return (int *)0x0;

      }

      iVar1 = FUN_005df0f5(0x80);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fb4dc(param_1);

    }

  }

  else if (iVar1 < 0x36314c42) {

    if (iVar1 == 0x36314c41) {

      iVar1 = FUN_005df0f5(0x80);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fba27(param_1);

    }

    else if (iVar1 == 0x32545844) {

      iVar1 = FUN_005df0f5(0x100);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fe683(param_1);

    }

    else if (iVar1 == 0x32595559) {

      iVar1 = FUN_005df0f5(0xb0);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fe666(param_1);

    }

    else if (iVar1 == 0x33545844) {

      iVar1 = FUN_005df0f5(0x100);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fe683(param_1);

    }

    else if (iVar1 == 0x34545844) {

      iVar1 = FUN_005df0f5(0x100);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fe683(param_1);

    }

    else {

      if (iVar1 != 0x35545844) {

        return (int *)0x0;

      }

      iVar1 = FUN_005df0f5(0x100);

      if (iVar1 == 0) goto LAB_005fee04;

      piVar2 = (int *)FUN_005fe683(param_1);

    }

  }

  else if (iVar1 == 0x36315220) {

    iVar1 = FUN_005df0f5(0x80);

    if (iVar1 == 0) goto LAB_005fee04;

    piVar2 = (int *)FUN_005fba48(param_1);

  }

  else if (iVar1 == 0x42475247) {

    iVar1 = FUN_005df0f5(0xb0);

    if (iVar1 == 0) goto LAB_005fee04;

    piVar2 = (int *)FUN_005fe666(param_1);

  }

  else if (iVar1 == 0x47424752) {

    iVar1 = FUN_005df0f5(0xb0);

    if (iVar1 == 0) goto LAB_005fee04;

    piVar2 = (int *)FUN_005fe666(param_1);

  }

  else {

    if (iVar1 != 0x59565955) {

      return (int *)0x0;

    }

    iVar1 = FUN_005df0f5(0xb0);

    if (iVar1 == 0) goto LAB_005fee04;

    piVar2 = (int *)FUN_005fe666(param_1);

  }

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

    if ((piVar2[7] == 0) || (iVar1 = FUN_005f53de(param_1), -1 < iVar1)) {

      if (piVar2[6] != 0) {

        (**(code **)(*piVar2 + 0xc))();

        return piVar2;

      }

      return piVar2;

    }

    (**(code **)*piVar2)(1);

  }

LAB_005fee37:

  return (int *)0x0;

}





// --- FUN_005fee95 at 0x005FEE95 (size: 2) ---


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



void FUN_005fee95(int param_1,int param_2,undefined4 *param_3,undefined4 *param_4,uint param_5,

                 uint param_6,float *param_7,int *param_8,char *param_9,float param_10,

                 float *param_11)



{

  int *piVar1;

  undefined4 *puVar2;

  byte bVar3;

  float *pfVar4;

  int iVar5;

  int *piVar6;

  uint uVar7;

  uint uVar8;

  float *pfVar9;

  float fVar10;

  undefined4 *puVar11;

  undefined4 *puVar12;

  float afStack_33c [195];

  uint uStack_30;

  uint uStack_2c;

  float fStack_28;

  float fStack_24;

  float fStack_20;

  float fStack_1c;

  float fStack_18;

  float fStack_14;

  float fStack_10;

  float *pfStack_c;

  float fStack_8;

  

  uStack_30 = (int)param_10 * 0xc;

  uStack_2c = (uint)((int)param_10 * 0xc != param_6);

  if (param_2 == 0) {

    param_2 = param_1;

  }

  if (param_10 == 2.8026e-45) {

    if ((*param_9 == '\0') && (param_9[1] == '\x03')) {

      fStack_1c = *param_7;

      fStack_8 = param_7[1];

      pfStack_c = (float *)param_8[1];

      pfVar9 = (float *)*param_8;

    }

    else {

      if ((param_9[1] != '\0') || (*param_9 != '\x03')) goto LAB_005ff084;

      fStack_1c = param_7[1];

      fStack_8 = *param_7;

      pfVar9 = (float *)param_8[1];

      pfStack_c = (float *)*param_8;

    }

    if (fStack_1c != 0.0) {

      if (param_5 == 0) {

        return;

      }

      param_7 = (float *)param_5;

      do {

        if (uStack_2c != 0) {

          puVar2 = (undefined4 *)((int)param_4 + param_6);

          puVar11 = param_3;

          for (uVar7 = param_6 >> 2; uVar7 != 0; uVar7 = uVar7 - 1) {

            *param_4 = *puVar11;

            puVar11 = puVar11 + 1;

            param_4 = param_4 + 1;

          }

          param_3 = (undefined4 *)((int)param_3 + param_6);

          puVar12 = param_4;

          for (uVar7 = param_6 & 3; param_4 = puVar2, uVar7 != 0; uVar7 = uVar7 - 1) {

            *(undefined1 *)puVar12 = *(undefined1 *)puVar11;

            puVar11 = (undefined4 *)((int)puVar11 + 1);

            puVar12 = (undefined4 *)((int)puVar12 + 1);

          }

        }

        *pfVar9 = 0.0;

        pfVar9[1] = 0.0;

        pfVar9[2] = 0.0;

        *pfStack_c = 0.0;

        pfStack_c[1] = 0.0;

        pfStack_c[2] = 0.0;

        if (DAT_00796344 <= *param_11) {

          do {

            uVar7 = FUN_005df4c4();

            iVar5 = (uVar7 >> 1) * 2;

            fVar10 = (float)iVar5;

            if (iVar5 < 0) {

              fVar10 = fVar10 + _DAT_0079920c;

            }

            fVar10 = *param_11 - fVar10;

            iVar5 = (uVar7 >> 1) * 0x40;

            thunk_FUN_005e09a5(&fStack_18,fStack_1c,param_1 + iVar5);

            thunk_FUN_005e09d7(&fStack_28,fStack_8,iVar5 + param_2);

            fStack_18 = fStack_18 * fVar10;

            param_11 = param_11 + 1;

            fStack_14 = fStack_14 * fVar10;

            fStack_10 = fStack_10 * fVar10;

            fStack_28 = fStack_28 * fVar10;

            fStack_24 = fStack_24 * fVar10;

            fStack_20 = fStack_20 * fVar10;

            *pfVar9 = fStack_18 + *pfVar9;

            pfVar9[1] = fStack_14 + pfVar9[1];

            pfVar9[2] = fStack_10 + pfVar9[2];

            *pfStack_c = fStack_28 + *pfStack_c;

            pfStack_c[1] = fStack_24 + pfStack_c[1];

            pfStack_c[2] = fStack_20 + pfStack_c[2];

          } while (DAT_00796344 <= *param_11);

        }

        fStack_1c = (float)((int)fStack_1c + param_6);

        fStack_8 = (float)((int)fStack_8 + param_6);

        pfStack_c = (float *)((int)pfStack_c + param_6);

        param_11 = param_11 + 1;

        pfVar9 = (float *)((int)pfVar9 + param_6);

        param_7 = (float *)((int)param_7 - 1);

      } while (param_7 != (float *)0x0);

      return;

    }

  }

LAB_005ff084:

  pfStack_c = (float *)0x0;

  if (param_5 != 0) {

    do {

      uVar7 = uStack_30;

      pfVar9 = afStack_33c;

      for (uVar8 = uStack_30 >> 2; uVar8 != 0; uVar8 = uVar8 - 1) {

        *pfVar9 = 0.0;

        pfVar9 = pfVar9 + 1;

      }

      for (uVar7 = uVar7 & 3; uVar7 != 0; uVar7 = uVar7 - 1) {

        *(undefined1 *)pfVar9 = 0;

        pfVar9 = (float *)((int)pfVar9 + 1);

      }

      for (; DAT_00796344 <= *param_11; param_11 = param_11 + 1) {

        uVar7 = FUN_005df4c4();

        uVar7 = uVar7 >> 1;

        fStack_8 = (float)(int)(uVar7 * 2);

        if ((int)(uVar7 * 2) < 0) {

          fStack_8 = fStack_8 + _DAT_0079920c;

        }

        fStack_8 = *param_11 - fStack_8;

        fVar10 = 0.0;

        if (param_10 != 0.0) {

          pfVar9 = afStack_33c + 2;

          do {

            bVar3 = param_9[(int)fVar10];

            if (bVar3 == 0) {

              thunk_FUN_005e09a5(&fStack_18,param_7[(int)fVar10],uVar7 * 0x40 + param_1);

            }

            else {

              if (bVar3 == 3) {

                iVar5 = uVar7 * 0x40 + param_2;

              }

              else {

                if (bVar3 < 6) {

                  return;

                }

                if (7 < bVar3) {

                  return;

                }

                iVar5 = uVar7 * 0x40 + param_1;

              }

              thunk_FUN_005e09d7(&fStack_18,param_7[(int)fVar10],iVar5);

            }

            fVar10 = (float)((int)fVar10 + 1);

            fStack_18 = fStack_18 * fStack_8;

            fStack_14 = fStack_14 * fStack_8;

            fStack_10 = fStack_10 * fStack_8;

            pfVar9[-2] = fStack_18 + pfVar9[-2];

            pfVar9[-1] = fStack_14 + pfVar9[-1];

            *pfVar9 = fStack_10 + *pfVar9;

            pfVar9 = pfVar9 + 3;

          } while ((uint)fVar10 < (uint)param_10);

        }

      }

      if (uStack_2c != 0) {

        puVar2 = (undefined4 *)((int)param_4 + param_6);

        puVar11 = param_3;

        for (uVar7 = param_6 >> 2; uVar7 != 0; uVar7 = uVar7 - 1) {

          *param_4 = *puVar11;

          puVar11 = puVar11 + 1;

          param_4 = param_4 + 1;

        }

        param_3 = (undefined4 *)((int)param_3 + param_6);

        puVar12 = param_4;

        for (uVar7 = param_6 & 3; param_4 = puVar2, uVar7 != 0; uVar7 = uVar7 - 1) {

          *(undefined1 *)puVar12 = *(undefined1 *)puVar11;

          puVar11 = (undefined4 *)((int)puVar11 + 1);

          puVar12 = (undefined4 *)((int)puVar12 + 1);

        }

      }

      if (param_10 != 0.0) {

        pfVar9 = afStack_33c;

        fStack_8 = param_10;

        piVar6 = param_8;

        do {

          pfVar4 = (float *)*piVar6;

          *pfVar4 = *pfVar9;

          pfVar4[1] = pfVar9[1];

          pfVar4[2] = pfVar9[2];

          *piVar6 = *piVar6 + param_6;

          piVar1 = (int *)(((int)param_7 - (int)param_8) + (int)piVar6);

          *piVar1 = *piVar1 + param_6;

          pfVar9 = pfVar9 + 3;

          piVar6 = piVar6 + 1;

          fStack_8 = (float)((int)fStack_8 + -1);

        } while (fStack_8 != 0.0);

      }

      param_11 = param_11 + 1;

      pfStack_c = (float *)((int)pfStack_c + 1);

    } while (pfStack_c < param_5);

  }

  return;

}





// --- FUN_005fee97 at 0x005FEE97 (size: 888) ---


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



void FUN_005fee97(int param_1,int param_2,undefined4 *param_3,undefined4 *param_4,uint param_5,

                 uint param_6,float *param_7,int *param_8,char *param_9,float param_10,

                 float *param_11)



{

  int *piVar1;

  undefined4 *puVar2;

  byte bVar3;

  float *pfVar4;

  int iVar5;

  int *piVar6;

  uint uVar7;

  uint uVar8;

  float *pfVar9;

  float fVar10;

  undefined4 *puVar11;

  undefined4 *puVar12;

  float local_33c [195];

  uint local_30;

  uint local_2c;

  float local_28;

  float local_24;

  float local_20;

  float local_1c;

  float local_18;

  float local_14;

  float local_10;

  float *local_c;

  float local_8;

  

  local_30 = (int)param_10 * 0xc;

  local_2c = (uint)((int)param_10 * 0xc != param_6);

  if (param_2 == 0) {

    param_2 = param_1;

  }

  if (param_10 == 2.8026e-45) {

    if ((*param_9 == '\0') && (param_9[1] == '\x03')) {

      local_1c = *param_7;

      local_8 = param_7[1];

      local_c = (float *)param_8[1];

      pfVar9 = (float *)*param_8;

    }

    else {

      if ((param_9[1] != '\0') || (*param_9 != '\x03')) goto LAB_005ff084;

      local_1c = param_7[1];

      local_8 = *param_7;

      pfVar9 = (float *)param_8[1];

      local_c = (float *)*param_8;

    }

    if (local_1c != 0.0) {

      if (param_5 == 0) {

        return;

      }

      param_7 = (float *)param_5;

      do {

        if (local_2c != 0) {

          puVar2 = (undefined4 *)((int)param_4 + param_6);

          puVar11 = param_3;

          for (uVar7 = param_6 >> 2; uVar7 != 0; uVar7 = uVar7 - 1) {

            *param_4 = *puVar11;

            puVar11 = puVar11 + 1;

            param_4 = param_4 + 1;

          }

          param_3 = (undefined4 *)((int)param_3 + param_6);

          puVar12 = param_4;

          for (uVar7 = param_6 & 3; param_4 = puVar2, uVar7 != 0; uVar7 = uVar7 - 1) {

            *(undefined1 *)puVar12 = *(undefined1 *)puVar11;

            puVar11 = (undefined4 *)((int)puVar11 + 1);

            puVar12 = (undefined4 *)((int)puVar12 + 1);

          }

        }

        *pfVar9 = 0.0;

        pfVar9[1] = 0.0;

        pfVar9[2] = 0.0;

        *local_c = 0.0;

        local_c[1] = 0.0;

        local_c[2] = 0.0;

        if (DAT_00796344 <= *param_11) {

          do {

            uVar7 = FUN_005df4c4();

            iVar5 = (uVar7 >> 1) * 2;

            fVar10 = (float)iVar5;

            if (iVar5 < 0) {

              fVar10 = fVar10 + _DAT_0079920c;

            }

            fVar10 = *param_11 - fVar10;

            iVar5 = (uVar7 >> 1) * 0x40;

            thunk_FUN_005e09a5(&local_18,local_1c,param_1 + iVar5);

            thunk_FUN_005e09d7(&local_28,local_8,iVar5 + param_2);

            local_18 = local_18 * fVar10;

            param_11 = param_11 + 1;

            local_14 = local_14 * fVar10;

            local_10 = local_10 * fVar10;

            local_28 = local_28 * fVar10;

            local_24 = local_24 * fVar10;

            local_20 = local_20 * fVar10;

            *pfVar9 = local_18 + *pfVar9;

            pfVar9[1] = local_14 + pfVar9[1];

            pfVar9[2] = local_10 + pfVar9[2];

            *local_c = local_28 + *local_c;

            local_c[1] = local_24 + local_c[1];

            local_c[2] = local_20 + local_c[2];

          } while (DAT_00796344 <= *param_11);

        }

        local_1c = (float)((int)local_1c + param_6);

        local_8 = (float)((int)local_8 + param_6);

        local_c = (float *)((int)local_c + param_6);

        param_11 = param_11 + 1;

        pfVar9 = (float *)((int)pfVar9 + param_6);

        param_7 = (float *)((int)param_7 - 1);

      } while (param_7 != (float *)0x0);

      return;

    }

  }

LAB_005ff084:

  local_c = (float *)0x0;

  if (param_5 != 0) {

    do {

      uVar7 = local_30;

      pfVar9 = local_33c;

      for (uVar8 = local_30 >> 2; uVar8 != 0; uVar8 = uVar8 - 1) {

        *pfVar9 = 0.0;

        pfVar9 = pfVar9 + 1;

      }

      for (uVar7 = uVar7 & 3; uVar7 != 0; uVar7 = uVar7 - 1) {

        *(undefined1 *)pfVar9 = 0;

        pfVar9 = (float *)((int)pfVar9 + 1);

      }

      for (; DAT_00796344 <= *param_11; param_11 = param_11 + 1) {

        uVar7 = FUN_005df4c4();

        uVar7 = uVar7 >> 1;

        local_8 = (float)(int)(uVar7 * 2);

        if ((int)(uVar7 * 2) < 0) {

          local_8 = local_8 + _DAT_0079920c;

        }

        local_8 = *param_11 - local_8;

        fVar10 = 0.0;

        if (param_10 != 0.0) {

          pfVar9 = local_33c + 2;

          do {

            bVar3 = param_9[(int)fVar10];

            if (bVar3 == 0) {

              thunk_FUN_005e09a5(&local_18,param_7[(int)fVar10],uVar7 * 0x40 + param_1);

            }

            else {

              if (bVar3 == 3) {

                iVar5 = uVar7 * 0x40 + param_2;

              }

              else {

                if (bVar3 < 6) {

                  return;

                }

                if (7 < bVar3) {

                  return;

                }

                iVar5 = uVar7 * 0x40 + param_1;

              }

              thunk_FUN_005e09d7(&local_18,param_7[(int)fVar10],iVar5);

            }

            fVar10 = (float)((int)fVar10 + 1);

            local_18 = local_18 * local_8;

            local_14 = local_14 * local_8;

            local_10 = local_10 * local_8;

            pfVar9[-2] = local_18 + pfVar9[-2];

            pfVar9[-1] = local_14 + pfVar9[-1];

            *pfVar9 = local_10 + *pfVar9;

            pfVar9 = pfVar9 + 3;

          } while ((uint)fVar10 < (uint)param_10);

        }

      }

      if (local_2c != 0) {

        puVar2 = (undefined4 *)((int)param_4 + param_6);

        puVar11 = param_3;

        for (uVar7 = param_6 >> 2; uVar7 != 0; uVar7 = uVar7 - 1) {

          *param_4 = *puVar11;

          puVar11 = puVar11 + 1;

          param_4 = param_4 + 1;

        }

        param_3 = (undefined4 *)((int)param_3 + param_6);

        puVar12 = param_4;

        for (uVar7 = param_6 & 3; param_4 = puVar2, uVar7 != 0; uVar7 = uVar7 - 1) {

          *(undefined1 *)puVar12 = *(undefined1 *)puVar11;

          puVar11 = (undefined4 *)((int)puVar11 + 1);

          puVar12 = (undefined4 *)((int)puVar12 + 1);

        }

      }

      if (param_10 != 0.0) {

        pfVar9 = local_33c;

        local_8 = param_10;

        piVar6 = param_8;

        do {

          pfVar4 = (float *)*piVar6;

          *pfVar4 = *pfVar9;

          pfVar4[1] = pfVar9[1];

          pfVar4[2] = pfVar9[2];

          *piVar6 = *piVar6 + param_6;

          piVar1 = (int *)(((int)param_7 - (int)param_8) + (int)piVar6);

          *piVar1 = *piVar1 + param_6;

          pfVar9 = pfVar9 + 3;

          piVar6 = piVar6 + 1;

          local_8 = (float)((int)local_8 + -1);

        } while (local_8 != 0.0);

      }

      param_11 = param_11 + 1;

      local_c = (float *)((int)local_c + 1);

    } while (local_c < param_5);

  }

  return;

}





// --- FUN_005ff20f at 0x005FF20F (size: 159) ---


void FUN_005ff20f(float *param_1,float *param_2,float *param_3,float param_4,float *param_5)



{

  float fVar1;

  float fVar2;

  float fVar3;

  float fVar4;

  

  *param_5 = *param_1;

  param_5[1] = param_1[1];

  param_5[2] = param_1[2];

  *param_5 = *param_5 - *param_2;

  param_5[1] = param_5[1] - param_2[1];

  fVar3 = param_5[2] - param_2[2];

  param_5[2] = fVar3;

  fVar4 = param_5[1] * param_3[1] + *param_3 * *param_5 + fVar3 * param_3[2];

  fVar1 = *param_3;

  fVar2 = param_3[1];

  param_5[2] = fVar3 - fVar4 * param_3[2];

  fVar1 = (*param_5 - fVar4 * fVar1) * param_4;

  *param_5 = fVar1;

  fVar2 = (param_5[1] - fVar4 * fVar2) * param_4;

  param_5[1] = fVar2;

  param_5[2] = param_4 * param_5[2];

  *param_5 = fVar1 + *param_2;

  param_5[1] = fVar2 + param_2[1];

  param_5[2] = param_2[2] + param_5[2];

  return;

}





// --- FUN_005ff2ae at 0x005FF2AE (size: 857) ---


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



void FUN_005ff2ae(uint param_1,int param_2,uint param_3,float *param_4,float *param_5,float *param_6

                 ,float *param_7,uint param_8)



{

  float fVar1;

  float fVar2;

  float fVar3;

  float fVar4;

  float fVar5;

  float *pfVar6;

  uint uVar7;

  int iVar8;

  float *pfVar9;

  float local_1cc [68];

  float local_bc [10];

  float local_94;

  float local_8c;

  float local_84;

  float local_80;

  float local_7c;

  float local_78;

  float local_74;

  float local_70;

  float fStack_6c;

  float fStack_68;

  float local_64;

  float local_60;

  float local_5c;

  float local_58;

  float local_54;

  float local_50;

  float local_4c;

  float local_48;

  float local_44;

  float local_40;

  float local_3c;

  float local_38;

  float local_34;

  float local_30;

  float local_2c;

  float local_28;

  float local_24;

  float local_20;

  float local_1c;

  float local_18;

  float local_14;

  float local_10;

  float local_c;

  float local_8;

  

  local_7c = *param_5;

  local_78 = param_5[1];

  local_74 = param_5[2];

  local_34 = *param_6;

  local_30 = param_6[1];

  local_2c = param_6[2];

  local_10 = *param_7;

  local_c = param_7[1];

  local_8 = param_7[2];

  FUN_005ff20f(&local_34,&local_7c,param_1,_DAT_007e75f0,&local_70);

  FUN_005ff20f(&local_10,&local_7c,param_1,_DAT_007e75f0,&local_64);

  FUN_005ff20f(&local_7c,&local_34,param_1 + 0xc,_DAT_007e75f0,&local_58);

  FUN_005ff20f(&local_7c,&local_10,param_1 + 0x18,_DAT_007e75f0,&local_40);

  FUN_005ff20f(&local_10,&local_34,param_1 + 0xc,_DAT_007e75f0,&local_28);

  FUN_005ff20f(&local_34,&local_10,param_1 + 0x18,_DAT_007e75f0,&local_1c);

  fVar5 = _DAT_007938bc;

  local_94 = local_10 + local_34 + local_7c;

  local_8c = local_8 + local_2c + local_74;

  param_1 = 0;

  local_84 = (local_c + local_30 + local_78) * _DAT_007f13bc;

  local_80 = local_8c * _DAT_007f13bc;

  local_4c = (local_1c + local_28 + local_40 + local_58 + local_64 + local_70) * _DAT_007c97cc -

             local_94 * _DAT_007f13bc;

  local_48 = (local_18 + local_24 + local_3c + local_54 + local_60 + fStack_6c) * _DAT_007c97cc -

             local_84;

  local_44 = (local_14 + local_20 + local_38 + local_50 + local_5c + fStack_68) * _DAT_007c97cc -

             local_80;

  if (param_3 != 0) {

    do {

      fVar1 = *(float *)(param_1 * 8 + param_2);

      uVar7 = 0;

      fVar2 = *(float *)(param_1 * 8 + 4 + param_2);

      fVar3 = (1.0 - fVar1) - fVar2;

      local_bc[0] = fVar2 * fVar2 * fVar2;

      local_bc[1] = fVar3 * fVar2 * fVar2 * fVar5;

      local_bc[2] = fVar2 * fVar2 * fVar1 * fVar5;

      fVar4 = fVar3 * fVar3;

      local_bc[3] = fVar4 * fVar2 * fVar5;

      local_bc[4] = fVar3 * fVar2 * fVar1 * _DAT_007d07fc;

      local_bc[5] = fVar2 * fVar1 * fVar1 * fVar5;

      local_bc[6] = fVar4 * fVar3;

      local_bc[7] = fVar4 * fVar1 * fVar5;

      local_bc[8] = fVar3 * fVar1 * fVar1 * fVar5;

      local_bc[9] = fVar1 * fVar1 * fVar1;

      local_1cc[0] = 0.0;

      local_1cc[1] = 0.0;

      local_1cc[2] = 0.0;

      pfVar6 = &local_78;

      do {

        pfVar9 = local_bc + uVar7;

        uVar7 = uVar7 + 1;

        local_1cc[0] = pfVar6[-1] * *pfVar9 + local_1cc[0];

        local_1cc[1] = *pfVar9 * *pfVar6 + local_1cc[1];

        local_1cc[2] = pfVar6[1] * *pfVar9 + local_1cc[2];

        pfVar6 = pfVar6 + 3;

      } while (uVar7 < 10);

      if (3 < param_8) {

        pfVar6 = param_6 + 3;

        iVar8 = param_8 - 3;

        do {

          *(float *)(((int)local_1cc - (int)param_6) + (int)pfVar6) =

               fVar3 * *pfVar6 +

               fVar2 * *(float *)(((int)param_5 - (int)param_6) + (int)pfVar6) +

               fVar1 * *(float *)(((int)param_7 - (int)param_6) + (int)pfVar6);

          pfVar6 = pfVar6 + 1;

          iVar8 = iVar8 + -1;

        } while (iVar8 != 0);

      }

      pfVar6 = local_1cc;

      pfVar9 = param_4;

      for (uVar7 = param_8 & 0x3fffffff; uVar7 != 0; uVar7 = uVar7 - 1) {

        *pfVar9 = *pfVar6;

        pfVar6 = pfVar6 + 1;

        pfVar9 = pfVar9 + 1;

      }

      param_1 = param_1 + 1;

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

        *(undefined1 *)pfVar9 = *(undefined1 *)pfVar6;

        pfVar6 = (float *)((int)pfVar6 + 1);

        pfVar9 = (float *)((int)pfVar9 + 1);

      }

      param_4 = param_4 + param_8;

    } while (param_1 < param_3);

  }

  return;

}





// --- FUN_005ff607 at 0x005FF607 (size: 95) ---


undefined4 FUN_005ff607(LPBYTE param_1,LPCSTR param_2,LPBYTE param_3)



{

  LSTATUS LVar1;

  HKEY local_8;

  

  local_8 = (HKEY)0x0;

  LVar1 = RegOpenKeyA((HKEY)0x80000002,"Software\\Microsoft\\Direct3D",&local_8);

  if (LVar1 == 0) {

    LVar1 = RegQueryValueExA(local_8,param_2,(LPDWORD)0x0,(LPDWORD)&param_3,param_3,

                             (LPDWORD)&stack0x00000010);

    RegCloseKey(local_8);

    if ((LVar1 == 0) && (param_3 == param_1)) {

      return 1;

    }

  }

  return 0;

}





// --- FUN_005ff666 at 0x005FF666 (size: 40) ---


/* WARNING: Removing unreachable block (ram,0x005ff677) */

/* WARNING: Restarted to delay deadcode elimination for space: stack */



undefined8 __fastcall FUN_005ff666(undefined4 param_1,undefined4 param_2)



{

  int iVar1;

  

  iVar1 = cpuid_Version_info(1);

  return CONCAT44(param_2,(uint)((*(uint *)(iVar1 + 8) & 0x800000) != 0));

}





// --- FUN_005ff68e at 0x005FF68E (size: 178) ---


int FUN_005ff68e(void)



{

  LSTATUS LVar1;

  int iVar2;

  _union_530 local_38 [8];

  ushort local_18;

  int local_14;

  DWORD local_10 [2];

  HKEY local_8;

  

  LVar1 = RegOpenKeyA((HKEY)0x80000002,"Software\\Microsoft\\Direct3D",&local_8);

  if (LVar1 == 0) {

    local_10[1] = 4;

    LVar1 = RegQueryValueExA(local_8,"DisableMMX",(LPDWORD)0x0,local_10,(LPBYTE)&local_14,

                             local_10 + 1);

    if (((LVar1 == 0) && (local_10[0] == 4)) && (local_14 != 0)) {

      RegCloseKey(local_8);

      DAT_00825d78 = 0;

      return 0;

    }

    RegCloseKey(local_8);

  }

  if (DAT_00825d78 < 0) {

    DAT_00825d78 = 0;

    GetSystemInfo((LPSYSTEM_INFO)&local_38[0].s);

    if (((local_38[0].s.wProcessorArchitecture == 0) && (4 < local_18)) &&

       (iVar2 = FUN_005ff666(), iVar2 != 0)) {

      DAT_00825d78 = 1;

    }

  }

  return DAT_00825d78;

}





// --- FUN_005ff740 at 0x005FF740 (size: 66) ---


/* WARNING: Removing unreachable block (ram,0x005ff772) */



void FUN_005ff740(void)



{

  undefined4 *puVar1;

  undefined4 uVar2;

  undefined4 uVar3;

  undefined4 uVar4;

  int unaff_EBP;

  

  FUN_006b8bd4();

  *(undefined4 *)(unaff_EBP + -0x18) = DAT_00836f40;

  *(undefined1 **)(unaff_EBP + -0x10) = &stack0xffffffc0;

  *(undefined4 *)(unaff_EBP + -0x14) = 0;

  *(undefined4 *)(unaff_EBP + -0x28) = s_GenuineIntel_007f13cc._0_4_;

  *(undefined4 *)(unaff_EBP + -0x24) = s_GenuineIntel_007f13cc._4_4_;

  *(undefined4 *)(unaff_EBP + -0x20) = s_GenuineIntel_007f13cc._8_4_;

  *(char *)(unaff_EBP + -0x1c) = s_GenuineIntel_007f13cc[0xc];

  *(undefined4 *)(unaff_EBP + -4) = 0;

  puVar1 = (undefined4 *)cpuid_basic_info(0);

  uVar4 = puVar1[1];

  uVar3 = puVar1[2];

  uVar2 = puVar1[3];

  *(undefined4 *)(unaff_EBP + -0x30) = *puVar1;

  *(undefined4 *)(unaff_EBP + -0x3c) = uVar4;

  *(undefined4 *)(unaff_EBP + -0x38) = uVar3;

  *(undefined4 *)(unaff_EBP + -0x34) = uVar2;

  FUN_005ff78e();

  return;

}





// --- Catch@005ff782 at 0x005FF782 (size: 12) ---


undefined * Catch_005ff782(void)



{

  int unaff_EBP;

  

  *(undefined4 *)(unaff_EBP + -0x40) = *(undefined4 *)(unaff_EBP + -0x14);

  return &DAT_005ff794;

}





// --- FUN_005ff78e at 0x005FF78E (size: 94) ---


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

/* WARNING: Removing unreachable block (ram,0x005ff7a9) */



undefined4 FUN_005ff78e(void)



{

  undefined4 *puVar1;

  undefined4 uVar2;

  int unaff_EBP;

  

  *(undefined4 *)(unaff_EBP + -4) = 0xffffffff;

  if (*(int *)(unaff_EBP + -0x30) == 0) {

    uVar2 = *(undefined4 *)(unaff_EBP + -0x14);

  }

  else {

    puVar1 = (undefined4 *)cpuid_Version_info(1);

    uVar2 = puVar1[2];

    *(undefined4 *)(unaff_EBP + -0x30) = *puVar1;

    *(undefined4 *)(unaff_EBP + -0x2c) = uVar2;

    if ((*(uint *)(unaff_EBP + -0x2c) & 0x2000000) != 0) {

      *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) | 4;

    }

    if ((*(uint *)(unaff_EBP + -0x2c) & 0x4000000) != 0) {

      *(uint *)(unaff_EBP + -0x14) = *(uint *)(unaff_EBP + -0x14) | 8;

    }

    uVar2 = *(undefined4 *)(unaff_EBP + -0x14);

  }

  ExceptionList = *(void **)(unaff_EBP + -0xc);

  return uVar2;

}





// --- FUN_005ff7f1 at 0x005FF7F1 (size: 259) ---


int FUN_005ff7f1(int param_1)



{

  BOOL BVar1;

  uint uVar2;

  int iVar3;

  undefined **ppuVar4;

  undefined **ppuVar5;

  int local_8;

  

  FUN_005efc68();

  if (param_1 == 0) {

    DAT_00825d7c = 0xffff;

    ppuVar4 = &PTR_FUN_00825310;

    ppuVar5 = &PTR_FUN_008251e8;

    for (iVar3 = 0x4a; iVar3 != 0; iVar3 = iVar3 + -1) {

      *ppuVar5 = *ppuVar4;

      ppuVar4 = ppuVar4 + 1;

      ppuVar5 = ppuVar5 + 1;

    }

  }

  else if (DAT_00825d7c == 0xffff) {

    DAT_00825d7c = 0;

    ppuVar4 = &PTR_FUN_00825310;

    ppuVar5 = &PTR_FUN_008251e8;

    for (iVar3 = 0x4a; iVar3 != 0; iVar3 = iVar3 + -1) {

      *ppuVar5 = *ppuVar4;

      ppuVar4 = ppuVar4 + 1;

      ppuVar5 = ppuVar5 + 1;

    }

    FUN_00600850(&PTR_FUN_008251e8);

    iVar3 = FUN_005ff607(4,"DisablePSGP",&param_1,4);

    if (iVar3 == 0) {

      param_1 = 0;

    }

    iVar3 = FUN_005ff607(4,"DisableD3DXPSGP",&local_8,4);

    if (iVar3 != 0) {

      param_1 = local_8;

    }

    if (param_1 != 1) {

      if ((param_1 == 2) || (BVar1 = IsProcessorFeaturePresent(7), BVar1 == 0)) {

        uVar2 = FUN_005ff740();

        if ((uVar2 & 8) == 0) {

          BVar1 = IsProcessorFeaturePresent(6);

          if (BVar1 != 0) {

            FUN_00602783(&PTR_FUN_008251e8);

            DAT_00825d7c = 3;

          }

        }

        else {

          FUN_006028f6(&PTR_FUN_008251e8);

          DAT_00825d7c = 2;

        }

      }

      else {

        FUN_00602b55(&PTR_FUN_008251e8);

        DAT_00825d7c = 1;

      }

    }

  }

  return DAT_00825d7c;

}





// --- FUN_005ff8f4 at 0x005FF8F4 (size: 19) ---


int __fastcall FUN_005ff8f4(int param_1)



{

  int iVar1;

  undefined4 *puVar2;

  

  puVar2 = (undefined4 *)(param_1 + 0x48);

  for (iVar1 = 0x10; iVar1 != 0; iVar1 = iVar1 + -1) {

    *puVar2 = 0;

    puVar2 = puVar2 + 1;

  }

  return param_1;

}





// --- FUN_005ff907 at 0x005FF907 (size: 29) ---


undefined4 __thiscall FUN_005ff907(undefined4 *param_1,undefined4 param_2)



{

  undefined4 uVar1;

  

  *param_1 = param_2;

  uVar1 = FUN_005e537f(param_2);

  param_1[1] = uVar1;

  return 0;

}





// --- FUN_005ff924 at 0x005FF924 (size: 46) ---


undefined4 __thiscall FUN_005ff924(undefined4 *param_1,int param_2,undefined4 param_3,int param_4)



{

  param_1[param_2 + 2] = param_3;

  if (param_4 == 0) {

    param_4 = FUN_005e4f99(*param_1,param_2);

  }

  param_1[param_2 + 0x12] = param_4;

  return 0;

}





// --- FUN_005ff952 at 0x005FF952 (size: 35) ---


int __thiscall FUN_005ff952(int param_1,ushort *param_2,int param_3)



{

  return *(int *)(param_1 + 0x48 + (uint)*param_2 * 4) * param_3 +

         *(int *)(param_1 + 8 + (uint)*param_2 * 4) + (uint)param_2[1];

}





// --- FUN_005ff975 at 0x005FF975 (size: 972) ---


/* WARNING: Removing unreachable block (ram,0x005ffc66) */

/* WARNING: Removing unreachable block (ram,0x005ffc4c) */

/* WARNING: Removing unreachable block (ram,0x005ffc84) */

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



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



{

  float fVar1;

  float fVar2;

  float *pfVar3;

  uint uVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  float local_14 [4];

  

  if (param_1 == 0) {

    local_14[0] = 0.0;

LAB_005ffd15:

    local_14[1] = 0.0;

LAB_005ffd17:

    goto LAB_005ffd1a;

  }

  pfVar3 = (float *)FUN_005ff952(param_1,param_2);

  fVar1 = _DAT_00799208;

  switch(*(undefined1 *)(param_1 + 4)) {

  case 0:

    local_14[0] = *pfVar3;

    goto LAB_005ffd15;

  case 1:

    local_14[0] = *pfVar3;

    local_14[1] = pfVar3[1];

    goto LAB_005ffd1a;

  case 2:

    local_14[0] = *pfVar3;

    local_14[1] = pfVar3[1];

    local_14[2] = pfVar3[2];

    goto LAB_005ffd1f;

  case 3:

    local_14[0] = *pfVar3;

    local_14[1] = pfVar3[1];

    local_14[2] = pfVar3[2];

    local_14[3] = pfVar3[3];

    break;

  case 4:

    local_14[0] = (float)*(byte *)((int)pfVar3 + 2) * _DAT_00799208;

    local_14[1] = (float)((uint)*pfVar3 >> 8 & 0xff) * _DAT_00799208;

    local_14[2] = (float)*(byte *)pfVar3 * _DAT_00799208;

    fVar2 = (float)*(byte *)((int)pfVar3 + 3);

    goto LAB_005ffa33;

  case 5:

    local_14[0] = (float)*(byte *)pfVar3;

    local_14[1] = (float)*(byte *)((int)pfVar3 + 1);

    local_14[2] = (float)*(byte *)((int)pfVar3 + 2);

    local_14[3] = (float)*(byte *)((int)pfVar3 + 3);

    goto LAB_005ffd21;

  case 6:

    local_14[0] = (float)(int)(short)*(ushort *)pfVar3;

    local_14[1] = (float)(int)(short)*(ushort *)((int)pfVar3 + 2);

    goto LAB_005ffd17;

  case 7:

    local_14[0] = (float)(int)(short)*(ushort *)pfVar3;

    local_14[1] = (float)(int)(short)*(ushort *)((int)pfVar3 + 2);

    local_14[2] = (float)(int)(short)*(ushort *)(pfVar3 + 1);

    local_14[3] = (float)(int)(short)*(ushort *)((int)pfVar3 + 6);

    goto LAB_005ffd21;

  case 8:

    local_14[0] = (float)*(byte *)pfVar3 * _DAT_00799208;

    local_14[1] = (float)*(byte *)((int)pfVar3 + 1) * _DAT_00799208;

    local_14[2] = (float)*(byte *)((int)pfVar3 + 2) * _DAT_00799208;

    fVar2 = (float)*(byte *)((int)pfVar3 + 3);

    goto LAB_005ffa33;

  case 9:

    local_14[0] = (float)(int)(short)((ushort)(*(ushort *)pfVar3 == 0x8000) + *(ushort *)pfVar3) *

                  _DAT_007cbd08;

    uVar4 = (uint)(short)((ushort)(*(ushort *)((int)pfVar3 + 2) == 0x8000) +

                         *(ushort *)((int)pfVar3 + 2));

    fVar1 = _DAT_007cbd08;

    goto LAB_005ffbec;

  case 10:

    local_14[0] = (float)(int)(short)((ushort)(*(ushort *)pfVar3 == 0x8000) + *(ushort *)pfVar3) *

                  _DAT_007cbd08;

    local_14[1] = (float)(int)(short)((ushort)(*(ushort *)((int)pfVar3 + 2) == 0x8000) +

                                     *(ushort *)((int)pfVar3 + 2)) * _DAT_007cbd08;

    local_14[2] = (float)(int)(short)((ushort)(*(ushort *)(pfVar3 + 1) == 0x8000) +

                                     *(ushort *)(pfVar3 + 1)) * _DAT_007cbd08;

    local_14[3] = (float)(int)(short)((ushort)(*(ushort *)((int)pfVar3 + 6) == 0x8000) +

                                     *(ushort *)((int)pfVar3 + 6)) * _DAT_007cbd08;

    break;

  case 0xb:

    local_14[0] = (float)*(ushort *)pfVar3 * _DAT_007edf18;

    uVar4 = (uint)*(ushort *)((int)pfVar3 + 2);

    fVar1 = _DAT_007edf18;

LAB_005ffbec:

    local_14[1] = (float)(int)uVar4 * fVar1;

    goto LAB_005ffd1a;

  case 0xc:

    local_14[0] = (float)*(ushort *)pfVar3 * _DAT_007edf18;

    local_14[1] = (float)*(ushort *)((int)pfVar3 + 2) * _DAT_007edf18;

    local_14[2] = (float)*(ushort *)(pfVar3 + 1) * _DAT_007edf18;

    fVar2 = (float)*(ushort *)((int)pfVar3 + 6);

    fVar1 = _DAT_007edf18;

LAB_005ffa33:

    local_14[3] = fVar2 * fVar1;

    break;

  case 0xd:

    local_14[0] = (float)((uint)*pfVar3 & 0x3ff);

    local_14[1] = (float)((uint)*pfVar3 >> 10 & 0x3ff);

    local_14[2] = (float)((uint)*pfVar3 >> 0x14 & 0x3ff);

    goto LAB_005ffd1c;

  case 0xe:

    fVar1 = *pfVar3;

    iVar6 = ((int)fVar1 << 0x16) >> 0x16;

    iVar7 = ((int)fVar1 << 0xc) >> 0x16;

    iVar5 = ((int)fVar1 << 2) >> 0x16;

    local_14[0] = (float)(int)((uint)(iVar6 == -0x200) + iVar6) * _DAT_007ee04c;

    local_14[1] = (float)(int)((uint)(iVar7 == -0x200) + iVar7) * _DAT_007ee04c;

    local_14[2] = (float)(int)((uint)(iVar5 == -0x200) + iVar5) * _DAT_007ee04c;

    goto LAB_005ffd1f;

  case 0xf:

    thunk_FUN_005e038f(local_14,pfVar3,2);

LAB_005ffd1a:

    local_14[2] = 0.0;

LAB_005ffd1c:

LAB_005ffd1f:

    local_14[3] = 1.0;

LAB_005ffd21:

    break;

  case 0x10:

    thunk_FUN_005e038f(local_14,pfVar3,4);

  }

  if (4 < param_4) {

    param_4 = 4;

  }

  if (param_4 != 0) {

    pfVar3 = local_14;

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

      *param_3 = *pfVar3;

      pfVar3 = pfVar3 + 1;

      param_3 = param_3 + 1;

    }

  }

  return;

}





// --- FUN_005ffd85 at 0x005FFD85 (size: 1047) ---


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



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



{

  float fVar1;

  undefined1 uVar2;

  undefined2 uVar3;

  float *pfVar4;

  uint uVar5;

  int iVar6;

  uint uVar7;

  uint uVar8;

  undefined4 uVar9;

  float local_18 [5];

  

  uVar7 = 0;

  if (4 < param_4) {

    param_4 = 4;

  }

  uVar2 = *(undefined1 *)(param_1 + 4);

  switch(uVar2) {

  case 4:

  case 8:

  case 0xb:

  case 0xc:

    if (param_4 == 0) break;

    iVar6 = (int)local_18 - (int)param_3;

    uVar7 = param_4;

    do {

      if (0.0 <= *param_3) {

        if (*param_3 <= 1.0) {

          fVar1 = *param_3;

        }

        else {

          fVar1 = 1.0;

        }

      }

      else {

        fVar1 = 0.0;

      }

      *(float *)(iVar6 + (int)param_3) = fVar1;

      param_3 = param_3 + 1;

      uVar7 = uVar7 - 1;

    } while (uVar7 != 0);

LAB_005ffe80:

    uVar7 = param_4;

    if (param_4 < 3) break;

    goto LAB_005ffe96;

  case 5:

  case 0xd:

    if (param_4 != 0) {

      iVar6 = (int)local_18 - (int)param_3;

      uVar7 = param_4;

      do {

        if (0.0 <= *param_3) {

          fVar1 = *param_3;

        }

        else {

          fVar1 = 0.0;

        }

        *(float *)((int)param_3 + iVar6) = fVar1;

        param_3 = param_3 + 1;

        uVar7 = uVar7 - 1;

      } while (uVar7 != 0);

      goto LAB_005ffe80;

    }

    break;

  default:

    if (param_4 != 0) {

      pfVar4 = local_18;

      for (uVar7 = param_4; uVar7 != 0; uVar7 = uVar7 - 1) {

        *pfVar4 = *param_3;

        param_3 = param_3 + 1;

        pfVar4 = pfVar4 + 1;

      }

      goto LAB_005ffe80;

    }

    break;

  case 9:

  case 10:

  case 0xe:

    if (param_4 != 0) {

      iVar6 = (int)local_18 - (int)param_3;

      uVar7 = param_4;

      do {

        fVar1 = _DAT_0079a1a0;

        if (_DAT_0079a1a0 <= *param_3) {

          if (*param_3 <= 1.0) {

            fVar1 = *param_3;

          }

          else {

            fVar1 = 1.0;

          }

        }

        *(float *)((int)param_3 + iVar6) = fVar1;

        param_3 = param_3 + 1;

        uVar7 = uVar7 - 1;

      } while (uVar7 != 0);

      goto LAB_005ffe80;

    }

  }

  pfVar4 = local_18 + uVar7;

  for (iVar6 = 3 - uVar7; iVar6 != 0; iVar6 = iVar6 + -1) {

    *pfVar4 = 0.0;

    pfVar4 = pfVar4 + 1;

  }

  param_4 = uVar7 + (3 - uVar7);

LAB_005ffe96:

  if (param_4 < 4) {

    pfVar4 = local_18 + param_4;

    for (iVar6 = 4 - param_4; iVar6 != 0; iVar6 = iVar6 + -1) {

      *pfVar4 = 1.0;

      pfVar4 = pfVar4 + 1;

    }

  }

  pfVar4 = (float *)FUN_005ff952(param_1,param_2);

  switch(uVar2) {

  case 0:

    *pfVar4 = local_18[0];

    break;

  case 1:

    *pfVar4 = local_18[0];

    pfVar4[1] = local_18[1];

    break;

  case 2:

    *pfVar4 = local_18[0];

    pfVar4[1] = local_18[1];

    pfVar4[2] = local_18[2];

    break;

  case 3:

    *pfVar4 = local_18[0];

    pfVar4[1] = local_18[1];

    pfVar4[2] = local_18[2];

    pfVar4[3] = local_18[3];

    break;

  case 4:

    uVar7 = FUN_005df4c4();

    uVar8 = 0xff;

    iVar6 = FUN_005df4c4();

    uVar5 = FUN_005df4c4();

    uVar7 = ((uVar7 & 0xff | iVar6 << 8) << 8 | uVar5 & 0xff) << 8;

    goto LAB_00600170;

  case 5:

    uVar2 = FUN_005df4c4();

    *(undefined1 *)pfVar4 = uVar2;

    uVar2 = FUN_005df4c4();

    *(undefined1 *)((int)pfVar4 + 1) = uVar2;

    uVar2 = FUN_005df4c4();

    *(undefined1 *)((int)pfVar4 + 2) = uVar2;

    uVar2 = FUN_005df4c4();

    goto LAB_00600041;

  case 6:

    uVar3 = FUN_005df4c4();

    *(undefined2 *)pfVar4 = uVar3;

    goto LAB_00600095;

  case 7:

    uVar3 = FUN_005df4c4();

    *(undefined2 *)pfVar4 = uVar3;

    uVar3 = FUN_005df4c4();

    *(undefined2 *)((int)pfVar4 + 2) = uVar3;

    uVar3 = FUN_005df4c4();

    *(undefined2 *)(pfVar4 + 1) = uVar3;

    uVar3 = FUN_005df4c4();

    goto LAB_006000f2;

  case 8:

    uVar2 = FUN_005df4c4();

    *(undefined1 *)pfVar4 = uVar2;

    uVar2 = FUN_005df4c4();

    *(undefined1 *)((int)pfVar4 + 1) = uVar2;

    uVar2 = FUN_005df4c4();

    *(undefined1 *)((int)pfVar4 + 2) = uVar2;

    uVar2 = FUN_005df4c4();

LAB_00600041:

    *(undefined1 *)((int)pfVar4 + 3) = uVar2;

    break;

  case 9:

    uVar3 = FUN_005df4c4();

    *(undefined2 *)pfVar4 = uVar3;

    goto LAB_00600095;

  case 10:

    goto LAB_006000af;

  case 0xb:

    uVar3 = FUN_005df4c4();

    *(undefined2 *)pfVar4 = uVar3;

LAB_00600095:

    uVar3 = FUN_005df4c4();

    *(undefined2 *)((int)pfVar4 + 2) = uVar3;

    break;

  case 0xc:

LAB_006000af:

    uVar3 = FUN_005df4c4();

    *(undefined2 *)pfVar4 = uVar3;

    uVar3 = FUN_005df4c4();

    *(undefined2 *)((int)pfVar4 + 2) = uVar3;

    uVar3 = FUN_005df4c4();

    *(undefined2 *)(pfVar4 + 1) = uVar3;

    uVar3 = FUN_005df4c4();

LAB_006000f2:

    *(undefined2 *)((int)pfVar4 + 6) = uVar3;

    break;

  case 0xd:

    uVar7 = FUN_005df4c4();

    uVar8 = 0x3ff;

    uVar5 = FUN_005df4c4();

    uVar7 = ((uVar7 & 0x3ff) << 10 | uVar5 & 0x3ff) << 10;

    uVar5 = FUN_005df4c4();

    goto LAB_0060017b;

  case 0xe:

    uVar7 = FUN_005df4c4();

    uVar8 = 0x3ff;

    uVar5 = FUN_005df4c4();

    uVar7 = ((uVar7 & 0x3ff) << 10 | uVar5 & 0x3ff) << 10;

LAB_00600170:

    uVar5 = FUN_005df4c4();

LAB_0060017b:

    *pfVar4 = (float)(uVar7 | uVar5 & uVar8);

    break;

  case 0xf:

    uVar9 = 2;

    goto LAB_0060018b;

  case 0x10:

    uVar9 = 4;

LAB_0060018b:

    thunk_FUN_005e02d4(pfVar4,local_18,uVar9);

  }

  return;

}





