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

// --- FUN_006415e0 at 0x006415E0 (size: 102) ---


/* WARNING: Removing unreachable block (ram,0x00641604) */

/* WARNING: Removing unreachable block (ram,0x006415ed) */



undefined8 __fastcall FUN_006415e0(undefined4 param_1,undefined4 param_2,uint *param_3)



{

  int *piVar1;

  uint *puVar2;

  undefined4 in_EAX;

  int iVar3;

  uint uVar4;

  uint uVar5;

  uint uVar6;

  

  piVar1 = (int *)cpuid_basic_info(0);

  iVar3 = *piVar1;

  uVar5 = piVar1[2];

  uVar4 = piVar1[3];

  param_3[6] = piVar1[1];

  param_3[7] = uVar5;

  param_3[8] = uVar4;

  if (iVar3 != 0) {

    puVar2 = (uint *)cpuid_Version_info(1);

    uVar4 = *puVar2;

    uVar6 = puVar2[2];

    uVar5 = uVar4 & 0x3fff;

    *param_3 = puVar2[1] & 0xff;

    param_3[1] = uVar5 >> 0xc;

    param_3[2] = uVar5 >> 8 & 0xf;

    param_3[3] = uVar5 >> 4 & 0xf;

    param_3[4] = uVar4 & 0xf;

    param_3[5] = uVar6;

  }

  return CONCAT44(param_2,in_EAX);

}





// --- FUN_00641670 at 0x00641670 (size: 6) ---


undefined1 FUN_00641670(undefined1 param_1)



{

  return param_1;

}





// --- FUN_00641680 at 0x00641680 (size: 426) ---


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



{

  int iVar1;

  uint uVar2;

  uint uVar3;

  int local_3c;

  int local_38;

  uint local_34;

  uint local_30;

  undefined4 local_2c;

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_00908aac;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_8 = 0;

  local_3c = 0;

  local_38 = 0;

  ExceptionList = &local_14;

  *param_3 = 0;

  if (*(uint *)(param_1 + 0x24) < param_2) {

    iVar1 = FUN_005df0f5(param_2,&local_3c);

    *param_3 = iVar1;

    if (*param_3 == 0) {

      local_3c = -5;

    }

    else {

      *param_4 = *param_3;

      local_38 = *param_3;

      *param_5 = 1;

      local_34 = param_2;

      if (*(uint *)(param_1 + 0x24) <= param_2) {

        local_34 = *(uint *)(param_1 + 0x24);

      }

      (*DAT_008f85a8)(local_38,*(undefined4 *)(param_1 + 0x10),local_34,&local_3c);

      local_38 = local_38 + local_34;

      param_2 = param_2 - local_34;

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

      *(int *)(param_1 + 0x1c) = *(int *)(param_1 + 0x1c) + local_34;

      *(uint *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) - local_34;

      local_30 = param_2;

      uVar2 = param_2;

      while (param_2 = uVar3, uVar2 != 0) {

        if (0xffff < param_2) {

          ExceptionList = local_14;

          return local_3c;

        }

        uVar3 = param_2;

        if (0xfff < param_2) {

          uVar3 = 0x1000;

        }

        local_3c = FUN_006495d0(param_1,uVar3,&local_2c,&local_3c);

        if (local_3c != 0) {

          local_3c = -0x15;

          operator_delete((void *)*param_3);

          *param_3 = 0;

          ExceptionList = local_14;

          return local_3c;

        }

        uVar3 = param_2;

        if (0xfff < param_2) {

          uVar3 = 0x1000;

        }

        (*DAT_008f85a8)(local_38,local_2c,uVar3,&local_3c);

        uVar3 = param_2;

        if (0xfff < param_2) {

          uVar3 = 0x1000;

        }

        local_38 = local_38 + uVar3;

        uVar3 = param_2 - 0x1000;

        uVar2 = uVar3;

      }

    }

  }

  else {

    local_3c = FUN_006495d0(param_1,param_2,param_4,&local_3c);

  }

  ExceptionList = local_14;

  return local_3c;

}





// --- FUN_00641860 at 0x00641860 (size: 117) ---


int FUN_00641860(undefined4 param_1,uint *param_2)



{

  int iVar1;

  int local_14;

  undefined1 *local_10;

  void *local_c;

  

  local_14 = 0;

  iVar1 = FUN_00641680(param_1,2,&local_c,&local_10,&local_14);

  if (iVar1 == 0) {

    *param_2 = (uint)CONCAT11(*local_10,local_10[1]);

  }

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

    operator_delete(local_c);

  }

  return iVar1;

}





// --- FUN_006418e0 at 0x006418E0 (size: 122) ---


int FUN_006418e0(int param_1,undefined4 *param_2)



{

  char cVar1;

  undefined4 uVar2;

  int iVar3;

  undefined1 *local_c;

  

  cVar1 = *(char *)(param_1 + 0x30);

  if (cVar1 == '\0') {

    iVar3 = FUN_00649660(param_1);

    if (iVar3 == 0) {

      iVar3 = FUN_006495d0(param_1,1,&local_c);

      if (iVar3 != 0) {

        *param_2 = 0x100;

        return 0;

      }

      uVar2 = FUN_00641670(*local_c);

      *param_2 = uVar2;

      return 0;

    }

  }

  else {

    *(undefined1 *)(param_1 + 0x30) = 0;

    uVar2 = FUN_00641670(cVar1);

    *param_2 = uVar2;

    iVar3 = 0;

  }

  return iVar3;

}





// --- FUN_00641960 at 0x00641960 (size: 194) ---


int FUN_00641960(int param_1)



{

  int iVar1;

  int iVar2;

  int local_14;

  undefined1 local_10 [8];

  

  iVar2 = FUN_00641860(param_1,&local_14);

  if (iVar2 == 0) {

    if (local_14 < 2) {

      return -0x15;

    }

    local_14 = local_14 + -2;

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

    if (iVar1 <= local_14) {

      iVar2 = FUN_006495d0(param_1,iVar1,local_10);

      if (iVar2 != 0) {

        return -0x15;

      }

      local_14 = local_14 - iVar1;

      iVar2 = 0;

    }

    for (; (0 < local_14 && (local_14 < 0x10000)); local_14 = local_14 + -0x1000) {

      iVar2 = local_14;

      if (0xfff < local_14) {

        iVar2 = 0x1000;

      }

      iVar2 = FUN_006495d0(param_1,iVar2,local_10);

      if (iVar2 != 0) {

        return -0x15;

      }

      iVar2 = 0;

    }

  }

  return iVar2;

}





// --- FUN_00641a30 at 0x00641A30 (size: 168) ---


int FUN_00641a30(undefined4 param_1,uint *param_2)



{

  int iVar1;

  undefined1 *local_1c;

  void *local_18;

  int local_14;

  int local_10;

  

  local_1c = (undefined1 *)0x0;

  local_18 = (void *)0x0;

  local_14 = 0;

  *param_2 = 0;

  iVar1 = FUN_00641860(param_1,&local_10);

  if (iVar1 == 0) {

    if (local_10 < 2) {

      iVar1 = -0x15;

    }

    else {

      local_10 = local_10 + -2;

      iVar1 = FUN_00641680(param_1,local_10,&local_18,&local_1c,&local_14);

      if (iVar1 == 0) {

        *param_2 = (uint)CONCAT11(*local_1c,local_1c[1]);

      }

    }

  }

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

    operator_delete(local_18);

  }

  return iVar1;

}





// --- FUN_00641ae0 at 0x00641AE0 (size: 593) ---


int FUN_00641ae0(undefined4 param_1,int param_2)



{

  byte bVar1;

  byte bVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  int iVar6;

  uint uVar7;

  int iVar8;

  uint uVar9;

  byte *pbVar10;

  byte *local_34;

  void *local_30;

  int local_2c;

  int local_28;

  int iStack_24;

  undefined4 uStack_20;

  undefined4 uStack_1c;

  int iStack_18;

  

  local_34 = (byte *)0x0;

  local_30 = (void *)0x0;

  local_2c = 0;

  iVar4 = FUN_00641860(param_1,&local_28);

  if (iVar4 == 0) {

    if (local_28 < 2) {

      iVar4 = -0x15;

    }

    else {

      local_28 = local_28 + -2;

      iVar4 = FUN_00641680(param_1,local_28,&local_30,&local_34,&local_2c);

      if (iVar4 == 0) {

        (*DAT_008f85a4)(*(undefined4 *)(param_2 + 0x37cc),0x40);

        bVar1 = *local_34;

        *(uint *)(param_2 + 0x37a4) = (uint)bVar1;

        bVar2 = local_34[1];

        *(uint *)(param_2 + 0x37ac) = (uint)bVar2 << 8;

        uVar7 = (uint)CONCAT11(bVar2,local_34[2]);

        *(uint *)(param_2 + 0x37ac) = uVar7;

        bVar2 = local_34[3];

        *(uint *)(param_2 + 0x37a8) = (uint)bVar2 << 8;

        uVar9 = (uint)CONCAT11(bVar2,local_34[4]);

        pbVar10 = local_34 + 6;

        *(uint *)(param_2 + 0x37a8) = uVar9;

        bVar2 = local_34[5];

        *(uint *)(param_2 + 0x37c0) = (uint)bVar2;

        local_34 = pbVar10;

        if (bVar1 == 8) {

          if (uVar7 == 0) {

            iVar4 = -0x10;

          }

          else {

            iStack_18 = 0;

            uStack_1c = 0;

            iVar6 = 0;

            if (bVar2 != 0) {

              iVar6 = *(int *)(param_2 + 0x37cc);

              iVar5 = 0;

              iVar8 = 0;

              iStack_24 = 0;

              do {

                *(uint *)(iVar5 + iVar6) = (uint)*pbVar10;

                *(int *)(iVar5 + 4 + *(int *)(param_2 + 0x37cc)) = (int)(uint)pbVar10[1] >> 4;

                *(uint *)(iVar5 + 8 + *(int *)(param_2 + 0x37cc)) = pbVar10[1] & 0xf;

                local_34 = pbVar10 + 3;

                *(uint *)(iVar5 + 0xc + *(int *)(param_2 + 0x37cc)) = (uint)pbVar10[2];

                iVar6 = *(int *)(param_2 + 0x37cc);

                iVar3 = *(int *)(iVar5 + 4 + iVar6);

                if (iStack_24 < iVar3) {

                  iStack_24 = iVar3;

                }

                iVar3 = *(int *)(iVar5 + 8 + iVar6);

                if (iStack_18 < iVar3) {

                  iStack_18 = iVar3;

                }

                iVar5 = iVar5 + 0x10;

                iVar8 = iVar8 + 1;

                pbVar10 = local_34;

              } while (iVar8 < *(int *)(param_2 + 0x37c0));

              uVar7 = *(uint *)(param_2 + 0x37ac);

              uVar9 = *(uint *)(param_2 + 0x37a8);

              uStack_20 = 0;

              iVar6 = iStack_24;

            }

            iVar6 = (int)((uVar9 - 1) + iVar6 * 8) / (iVar6 << 3);

            *(int *)(param_2 + 0x37c4) = iVar6;

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

                 ((int)((uVar7 - 1) + iStack_18 * 8) / (iStack_18 * 8)) * iVar6;

          }

        }

        else {

          iVar4 = -0x1d;

        }

      }

    }

  }

  if ((local_2c != 0) && (local_30 != (void *)0x0)) {

    operator_delete(local_30);

  }

  return iVar4;

}





// --- FUN_00641d40 at 0x00641D40 (size: 354) ---


int FUN_00641d40(int param_1)



{

  char *pcVar1;

  int iVar2;

  char *local_1c;

  void *local_18;

  int local_14;

  int local_10;

  

  local_1c = (char *)0x0;

  local_18 = (void *)0x0;

  local_14 = 0;

  iVar2 = FUN_00641860(param_1 + 0x37e8,&local_10);

  pcVar1 = local_1c;

  if (iVar2 == 0) {

    if (local_10 < 2) {

      iVar2 = -0x15;

    }

    else {

      local_10 = local_10 + -2;

      if (0xb < local_10) {

        iVar2 = FUN_00641680(param_1 + 0x37e8,local_10,&local_18,&local_1c,&local_14);

        pcVar1 = local_1c;

        if (iVar2 == 0) {

          pcVar1 = local_1c + 1;

          if ((((*local_1c == 'A') && (pcVar1 = local_1c + 2, local_1c[1] == 'd')) &&

              (pcVar1 = local_1c + 3, local_1c[2] == 'o')) &&

             ((pcVar1 = local_1c + 4, local_1c[3] == 'b' &&

              (pcVar1 = local_1c + 5, local_1c[4] == 'e')))) {

            *(ushort *)(param_1 + 0x4df0) = CONCAT11(local_1c[5],local_1c[6]);

            *(ushort *)(param_1 + 0x4df2) = CONCAT11(local_1c[7],local_1c[8]);

            *(ushort *)(param_1 + 0x4df4) = CONCAT11(local_1c[9],local_1c[10]);

            *(uint *)(param_1 + 0x482c) = (uint)(byte)local_1c[0xb];

            *(undefined4 *)(param_1 + 0x4828) = 1;

            pcVar1 = local_1c + 0xc;

          }

        }

      }

    }

  }

  local_1c = pcVar1;

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

    operator_delete(local_18);

  }

  return iVar2;

}





// --- FUN_00641eb0 at 0x00641EB0 (size: 1175) ---


undefined4 FUN_00641eb0(int *param_1)



{

  byte *pbVar1;

  byte bVar2;

  int iVar3;

  byte *pbVar4;

  byte *pbVar5;

  uint uVar6;

  int iVar7;

  uint uVar8;

  int iVar9;

  byte *local_34;

  void *local_30;

  int local_2c;

  int local_28;

  uint local_24;

  uint local_20;

  int local_1c;

  byte local_18;

  byte local_14;

  

  local_34 = (byte *)0x0;

  local_30 = (void *)0x0;

  local_2c = 0;

  iVar3 = FUN_00641860(param_1 + 0xdfa,&local_28);

  pbVar5 = local_34;

  if ((((iVar3 == 0) && (1 < local_28)) && (local_28 = local_28 + -2, 0xd < local_28)) &&

     (local_28 < 0x3000f)) {

    iVar3 = FUN_00641680(param_1 + 0xdfa,local_28,&local_30,&local_34,&local_2c);

    if (iVar3 != 0) {

      if ((local_2c != 0) && (local_30 != (void *)0x0)) {

        operator_delete(local_30);

      }

      return 0xffffffeb;

    }

    pbVar5 = local_34;

    if (param_1[0xdf7] != 0) {

      if (((*local_34 == 0x4a) && (local_34[1] == 0x46)) &&

         ((local_34[2] == 0x58 && ((local_34[3] == 0x58 && (local_34[4] == 0)))))) {

        bVar2 = local_34[5];

        pbVar5 = local_34 + 5;

        if (bVar2 == 0x10) goto LAB_00641eff;

        if (bVar2 == 0x11) {

          pbVar5 = local_34 + 8;

          uVar6 = (uint)local_34[6];

          uVar8 = (uint)local_34[7];

          if (((*param_1 == 0x14) || (*param_1 == 0x15)) &&

             ((int)(uVar6 * uVar8 + 0x308) <= local_28)) {

            param_1[0x19] = uVar8;

            param_1[0x18] = uVar6;

            local_34 = pbVar5;

            pbVar4 = (byte *)FUN_005df0f5(0x300);

            pbVar5 = local_34;

            if (pbVar4 != (byte *)0x0) {

              pbVar5 = pbVar4;

              do {

                *pbVar5 = *local_34;

                pbVar5[1] = local_34[1];

                pbVar1 = local_34 + 3;

                pbVar5[2] = local_34[2];

                local_34 = local_34 + 4;

                pbVar5[3] = *pbVar1;

                pbVar5 = pbVar5 + 4;

              } while ((int)pbVar5 < (int)(pbVar4 + 0x300));

              iVar3 = 0;

              local_20 = uVar6;

              if (uVar8 != 0) {

                uVar6 = uVar6 * 3;

                do {

                  if (uVar6 != 0) {

                    iVar7 = 0;

                    do {

                      iVar9 = (uint)*local_34 * 3;

                      local_18 = pbVar4[iVar9];

                      local_14 = pbVar4[iVar9 + 1];

                      bVar2 = pbVar4[iVar9 + 2];

                      if (param_1[0xd] == 1) {

                        *(byte *)(iVar7 + param_1[0xf] * iVar3 + param_1[8]) = local_18;

                        *(byte *)(iVar7 + 1 + param_1[0xf] * iVar3 + param_1[8]) = local_14;

                        *(byte *)(iVar7 + 2 + param_1[0xf] * iVar3 + param_1[8]) = bVar2;

                      }

                      else {

                        *(byte *)(iVar7 + param_1[0xf] * iVar3 + param_1[8]) = bVar2;

                        *(byte *)(iVar7 + 1 + param_1[0xf] * iVar3 + param_1[8]) = local_14;

                        *(byte *)(iVar7 + 2 + param_1[0xf] * iVar3 + param_1[8]) = local_18;

                      }

                      iVar7 = iVar7 + 3;

                      local_34 = local_34 + 1;

                      local_20 = uVar6;

                      local_1c = iVar3;

                    } while (iVar7 < (int)uVar6);

                  }

                  iVar3 = iVar3 + 1;

                } while (iVar3 < (int)uVar8);

              }

              local_24 = uVar8;

              operator_delete(pbVar4);

              pbVar5 = local_34;

            }

          }

          goto LAB_00641eff;

        }

        if (bVar2 != 0x13) goto LAB_00641eff;

        pbVar5 = local_34 + 6;

        iVar3 = 8;

      }

      else {

        if ((*local_34 != 0x4a) ||

           ((((local_34[1] != 0x46 || (local_34[2] != 0x49)) || (local_34[3] != 0x46)) ||

            (local_34[4] != 0)))) goto LAB_00641eff;

        param_1[0x137e] = 1;

        *(ushort *)(param_1 + 0x137f) = CONCAT11(local_34[5],local_34[6]);

        *(byte *)((int)param_1 + 0x4dfe) = local_34[7];

        pbVar5 = local_34 + 0xc;

        *(ushort *)(param_1 + 0x1380) = CONCAT11(local_34[8],local_34[9]);

        iVar3 = 0xe;

        *(ushort *)((int)param_1 + 0x4e02) = CONCAT11(local_34[10],local_34[0xb]);

      }

      uVar8 = (uint)*pbVar5;

      pbVar4 = pbVar5 + 2;

      uVar6 = (uint)pbVar5[1];

      pbVar5 = pbVar4;

      if ((uVar8 != 0) && (uVar6 != 0)) {

        if ((*param_1 == 0x14) || (*param_1 == 0x15)) {

          iVar7 = uVar8 * 3;

          if (local_28 < (int)(iVar3 + uVar6 * iVar7)) {

            param_1[0x18] = uVar8;

            param_1[0x19] = uVar6;

          }

          else {

            param_1[0x19] = uVar6;

            param_1[0x18] = uVar8;

            if (param_1[0xd] == 1) {

              iVar3 = 0;

              if (uVar6 != 0) {

                do {

                  local_34 = pbVar4;

                  (*DAT_008f85a8)(iVar3 * param_1[0xf] + param_1[8],pbVar4,iVar7);

                  pbVar4 = local_34 + iVar7;

                  iVar3 = iVar3 + 1;

                  pbVar5 = pbVar4;

                } while (iVar3 < (int)uVar6);

              }

            }

            else {

              iVar3 = 0;

              local_34 = pbVar4;

              if (uVar6 != 0) {

                do {

                  iVar9 = 0;

                  if (iVar7 != 0) {

                    do {

                      *(byte *)(param_1[0xf] * iVar3 + param_1[8] + iVar9) = pbVar4[2];

                      *(byte *)(param_1[0xf] * iVar3 + 1 + param_1[8] + iVar9) = local_34[1];

                      *(byte *)(param_1[0xf] * iVar3 + 2 + param_1[8] + iVar9) = *local_34;

                      pbVar4 = local_34 + 3;

                      iVar9 = iVar9 + 3;

                      local_34 = pbVar4;

                      local_24 = uVar6;

                    } while (iVar9 < iVar7);

                  }

                  iVar3 = iVar3 + 1;

                  pbVar5 = local_34;

                } while (iVar3 < (int)uVar6);

              }

            }

          }

        }

        else {

          param_1[0x18] = uVar8;

          param_1[0x19] = uVar6;

        }

      }

    }

  }

LAB_00641eff:

  local_34 = pbVar5;

  if ((local_2c != 0) && (local_30 != (void *)0x0)) {

    operator_delete(local_30);

  }

  return 0;

}





// --- FUN_00642350 at 0x00642350 (size: 420) ---


int FUN_00642350(int param_1)



{

  undefined1 *puVar1;

  int iVar2;

  int iVar3;

  int local_44;

  int local_40;

  undefined1 *local_3c;

  void *local_38;

  int local_34;

  int local_30;

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_00908ac4;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_44 = 0;

  local_40 = 0;

  local_3c = (undefined1 *)0x0;

  local_38 = (void *)0x0;

  local_34 = 0;

  local_8 = 0;

  ExceptionList = &local_14;

  local_40 = FUN_00641860(param_1 + 0x37e8,&local_44);

  if (local_40 == 0) {

    if (local_44 < 2) {

      local_40 = -0x15;

    }

    else {

      local_44 = local_44 + -2;

      iVar2 = FUN_00641680(param_1 + 0x37e8,local_44,&local_38,&local_3c,&local_34,&local_44);

      if (iVar2 == 0) {

        local_40 = 0;

        if ((*(int *)(param_1 + 0x37dc) != 0) && (iVar2 = *(int *)(param_1 + 0x4e04), iVar2 != 0)) {

          if ((int)(uint)*(ushort *)(param_1 + 0x4e08) < local_44) {

            iVar3 = 0;

            local_30 = 0;

            if (*(ushort *)(param_1 + 0x4e08) != 0) {

              while( true ) {

                puVar1 = local_3c + 1;

                *(undefined1 *)(iVar3 + iVar2) = *local_3c;

                iVar3 = iVar3 + 1;

                local_3c = puVar1;

                local_30 = iVar3;

                if ((int)(uint)*(ushort *)(param_1 + 0x4e08) <= iVar3) break;

                iVar2 = *(int *)(param_1 + 0x4e04);

              }

            }

            *(short *)(param_1 + 0x4e08) = (short)local_44;

            local_40 = -0x1e;

          }

          else {

            iVar3 = 0;

            local_30 = 0;

            if (0 < local_44) {

              while( true ) {

                puVar1 = local_3c + 1;

                *(undefined1 *)(iVar3 + iVar2) = *local_3c;

                iVar3 = iVar3 + 1;

                local_3c = puVar1;

                local_30 = iVar3;

                if (local_44 <= iVar3) break;

                iVar2 = *(int *)(param_1 + 0x4e04);

              }

            }

            *(short *)(param_1 + 0x4e08) = (short)local_44;

          }

          local_8 = 0xffffffff;

        }

      }

      else {

        local_40 = -0x15;

      }

    }

  }

  if ((local_34 != 0) && (local_38 != (void *)0x0)) {

    operator_delete(local_38);

  }

  ExceptionList = local_14;

  return local_40;

}





// --- FUN_00642510 at 0x00642510 (size: 969) ---


int FUN_00642510(int param_1,undefined4 param_2,int param_3)



{

  byte *pbVar1;

  int iVar2;

  uint uVar3;

  undefined4 *puVar4;

  int iVar5;

  int iVar6;

  byte *local_3c;

  void *local_38;

  int local_34;

  int local_30;

  uint local_2c;

  int local_28;

  undefined4 *local_24;

  int local_20;

  byte *local_1c;

  uint local_18;

  int local_14;

  

  local_3c = (byte *)0x0;

  local_38 = (void *)0x0;

  local_34 = 0;

  iVar2 = FUN_00641860(param_2,&local_30);

  if (iVar2 == 0) {

    if (local_30 < 2) {

      iVar2 = -0x15;

    }

    else {

      local_30 = local_30 + -2;

      if (local_30 < 0x205) {

        iVar2 = FUN_00641680(param_2,local_30,&local_38,&local_3c,&local_34);

        if (iVar2 == 0) {

          iVar5 = 0;

          local_14 = iVar2;

          while (pbVar1 = local_3c, iVar2 = local_14, iVar5 < local_30) {

            uVar3 = *local_3c & 0xf;

            if (4 < uVar3) {

              iVar2 = -7;

              break;

            }

            local_28 = (int)(uint)*local_3c >> 4;

            iVar2 = uVar3 * 0xb4;

            *(int *)(param_1 + iVar2 + 0x94) = local_28;

            local_1c = local_3c + 1;

            if (*(int *)(param_1 + 0x84) <= (int)uVar3) {

              *(uint *)(param_1 + 0x84) = uVar3 + 1;

            }

            if (local_28 == 0) {

              iVar6 = 0;

              do {

                *(ushort *)(*(int *)(iVar2 + 0x9c + param_1) + iVar6 * 2) = (ushort)local_1c[iVar6];

                *(ushort *)(*(int *)(iVar2 + 0x9c + param_1) + 2 + iVar6 * 2) =

                     (ushort)local_1c[iVar6 + 1];

                *(ushort *)(*(int *)(iVar2 + 0x9c + param_1) + 4 + iVar6 * 2) =

                     (ushort)local_1c[iVar6 + 2];

                *(ushort *)(*(int *)(iVar2 + 0x9c + param_1) + 6 + iVar6 * 2) =

                     (ushort)local_1c[iVar6 + 3];

                iVar6 = iVar6 + 4;

              } while (iVar6 < 0x40);

              local_3c = local_3c + 0x41;

              iVar6 = iVar5 + 0x41;

            }

            else {

              iVar6 = 0;

              do {

                *(ushort *)(*(int *)(iVar2 + 0x9c + param_1) + iVar6 * 2) =

                     *(ushort *)(local_1c + iVar6 * 2) >> 8 | *(ushort *)(local_1c + iVar6 * 2) << 8

                ;

                *(ushort *)(*(int *)(iVar2 + 0x9c + param_1) + 2 + iVar6 * 2) =

                     *(ushort *)(local_3c + iVar6 * 2 + 3) >> 8 |

                     *(ushort *)(local_3c + iVar6 * 2 + 3) << 8;

                iVar6 = iVar6 + 2;

              } while (iVar6 < 0x40);

              local_3c = local_3c + 0x81;

              iVar6 = iVar5 + 0x81;

            }

            local_18 = 0;

            puVar4 = (undefined4 *)(param_1 + 0x9c + iVar2);

            iVar2 = *(int *)(param_1 + 0x371c + uVar3 * 8);

            local_20 = iVar5;

            if (iVar2 != 0) {

              *(char *)(param_1 + 0x3720 + uVar3 * 8) = (char)uVar3;

              local_2c = uVar3;

              local_24 = puVar4;

              local_20 = iVar6;

              if (local_28 == 0) {

                local_28 = 0;

                while( true ) {

                  *(byte *)(iVar2 + local_28) = local_1c[local_28];

                  *(byte *)(local_28 + 1 + *(int *)(param_1 + 0x371c + uVar3 * 8)) =

                       pbVar1[local_28 + 2];

                  *(byte *)(local_28 + 2 + *(int *)(param_1 + 0x371c + uVar3 * 8)) =

                       pbVar1[local_28 + 3];

                  *(byte *)(local_28 + 3 + *(int *)(param_1 + 0x371c + uVar3 * 8)) =

                       pbVar1[local_28 + 4];

                  local_28 = local_28 + 4;

                  if (0x3f < local_28) break;

                  iVar2 = *(int *)(param_1 + 0x371c + uVar3 * 8);

                }

              }

              else {

                local_18 = 0;

                while( true ) {

                  *(byte *)(iVar2 + local_18) = local_1c[local_18];

                  *(byte *)(local_18 + 1 + *(int *)(param_1 + 0x371c + uVar3 * 8)) =

                       pbVar1[local_18 + 2];

                  *(byte *)(local_18 + 2 + *(int *)(param_1 + 0x371c + uVar3 * 8)) =

                       pbVar1[local_18 + 3];

                  *(byte *)(local_18 + 3 + *(int *)(param_1 + 0x371c + uVar3 * 8)) =

                       pbVar1[local_18 + 4];

                  local_18 = local_18 + 4;

                  if (0x7f < local_18) break;

                  iVar2 = *(int *)(param_1 + 0x371c + uVar3 * 8);

                }

              }

            }

            iVar5 = iVar6;

            if (param_3 == 0) {

              FUN_0061d7d0(*puVar4);

              if (*(int *)(param_1 + 0x80) < 4) {

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

              }

            }

            else if (param_3 == 1) {

              FUN_00621640(*puVar4);

              if (*(int *)(param_1 + 0x80) < 4) {

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

              }

            }

            else {

              FUN_0061d7d0(*puVar4);

              if (*(int *)(param_1 + 0x80) < 4) {

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

              }

            }

          }

        }

      }

      else {

        iVar2 = -0x15;

      }

    }

  }

  if ((local_34 != 0) && (local_38 != (void *)0x0)) {

    operator_delete(local_38);

  }

  return iVar2;

}





// --- FUN_00642940 at 0x00642940 (size: 1425) ---


/* WARNING: Removing unreachable block (ram,0x00642ecc) */



int FUN_00642940(int param_1,undefined4 param_2)



{

  byte bVar1;

  byte bVar2;

  byte bVar3;

  byte bVar4;

  byte bVar5;

  byte bVar6;

  byte bVar7;

  byte bVar8;

  byte bVar9;

  byte bVar10;

  byte bVar11;

  byte bVar12;

  byte bVar13;

  byte bVar14;

  int iVar15;

  uint uVar16;

  uint uVar17;

  int iVar18;

  uint uVar19;

  byte *local_3c;

  void *local_38;

  int local_34;

  int local_30;

  int local_2c;

  int local_28;

  uint local_24;

  uint local_20;

  int local_1c;

  int *local_18;

  

  local_3c = (byte *)0x0;

  local_38 = (void *)0x0;

  local_34 = 0;

  iVar15 = FUN_00641860(param_2,&local_30);

  if (iVar15 == 0) {

    if (local_30 < 2) {

      iVar15 = -0x15;

    }

    else {

      local_30 = local_30 + -2;

      if (local_30 < 0x444) {

        iVar15 = FUN_00641680(param_2,local_30,&local_38,&local_3c,&local_34);

        if (iVar15 == 0) {

          for (; 0 < local_30; local_30 = (local_30 - iVar18) + -0x11) {

            uVar17 = (int)(*local_3c & 0xf0) >> 4;

            uVar16 = *local_3c & 0xf;

            if (1 < uVar17) {

              iVar15 = -6;

              break;

            }

            if (3 < uVar16) {

              iVar15 = -6;

              break;

            }

            if (*(int *)(param_1 + 0x90) <= (int)uVar16) {

              *(uint *)(param_1 + 0x90) = uVar16 + 1;

            }

            if ((*(int *)(uVar16 * 0xc + 0x373c + param_1) != 0) &&

               (*(int *)(uVar16 * 0xc + 0x3740 + param_1) != 0)) {

              local_2c = (uVar17 + uVar16 * 2) * 0xc;

              iVar15 = param_1 + local_2c;

              *(char *)(iVar15 + 0x3744) = (char)uVar17;

              *(char *)(iVar15 + 0x3745) = (char)uVar16;

              **(byte **)(iVar15 + 0x373c) = local_3c[1];

              bVar1 = local_3c[1];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 1) = local_3c[2];

              bVar2 = local_3c[2];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 2) = local_3c[3];

              bVar3 = local_3c[3];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 3) = local_3c[4];

              bVar4 = local_3c[4];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 4) = local_3c[5];

              bVar5 = local_3c[5];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 5) = local_3c[6];

              bVar6 = local_3c[6];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 6) = local_3c[7];

              bVar7 = local_3c[7];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 7) = local_3c[8];

              bVar8 = local_3c[8];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 8) = local_3c[9];

              bVar9 = local_3c[9];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 9) = local_3c[10];

              bVar10 = local_3c[10];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 10) = local_3c[0xb];

              bVar11 = local_3c[0xb];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 0xb) = local_3c[0xc];

              bVar12 = local_3c[0xc];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 0xc) = local_3c[0xd];

              bVar13 = local_3c[0xd];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 0xd) = local_3c[0xe];

              bVar14 = local_3c[0xe];

              *(byte *)(*(int *)(iVar15 + 0x373c) + 0xe) = local_3c[0xf];

              iVar18 = (uint)local_3c[0xf] +

                       (uint)bVar14 +

                       (uint)bVar13 +

                       (uint)bVar12 +

                       (uint)bVar11 +

                       (uint)bVar10 +

                       (uint)bVar9 +

                       (uint)bVar8 +

                       (uint)bVar7 +

                       (uint)bVar6 +

                       (uint)bVar5 + (uint)bVar4 + (uint)bVar3 + (uint)bVar2 + (uint)bVar1;

              *(byte *)(*(int *)(iVar15 + 0x373c) + 0xf) = local_3c[0x10];

              uVar19 = (uint)local_3c[0x10];

              local_1c = uVar19 + iVar18;

              local_28 = 0;

              if (local_1c != 0) {

                if (5 < uVar19 + iVar18) {

                  local_28 = 0;

                  do {

                    *(byte *)(local_28 + *(int *)(local_2c + 0x3740 + param_1)) =

                         local_3c[local_28 + 0x11];

                    *(byte *)(local_28 + 1 + *(int *)(local_2c + 0x3740 + param_1)) =

                         local_3c[local_28 + 0x12];

                    *(byte *)(local_28 + 2 + *(int *)(local_2c + 0x3740 + param_1)) =

                         local_3c[local_28 + 0x13];

                    *(byte *)(local_28 + 3 + *(int *)(local_2c + 0x3740 + param_1)) =

                         local_3c[local_28 + 0x14];

                    *(byte *)(local_28 + 4 + *(int *)(local_2c + 0x3740 + param_1)) =

                         local_3c[local_28 + 0x15];

                    local_28 = local_28 + 5;

                    local_24 = uVar17;

                    local_20 = uVar16;

                  } while (local_28 <= (int)((uVar19 - 6) + iVar18));

                }

                local_18 = (int *)(param_1 + 0x3740 + local_2c);

                iVar15 = local_28;

                do {

                  *(byte *)(iVar15 + *local_18) = local_3c[iVar15 + 0x11];

                  iVar15 = iVar15 + 1;

                } while (iVar15 < local_1c);

              }

            }

            if (uVar17 == 0) {

              iVar15 = FUN_0061a690(local_3c + 1,local_3c + 0x11,0,uVar16,

                                    param_1 + 0x1d24 + uVar16 * 0x670);

              if (iVar15 != 0) {

                iVar15 = -6;

                break;

              }

              if (*(int *)(param_1 + 0x8c) < 4) {

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

              }

            }

            else {

              iVar15 = FUN_0061a690(local_3c + 1,local_3c + 0x11,uVar17,uVar16,

                                    param_1 + 0x364 + uVar16 * 0x670);

              if (iVar15 != 0) {

                iVar15 = -6;

                break;

              }

              if (*(int *)(param_1 + 0x88) < 4) {

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

              }

            }

            iVar15 = 0;

            iVar18 = (uint)local_3c[0x10] +

                     (uint)local_3c[0xf] +

                     (uint)local_3c[0xe] +

                     (uint)local_3c[0xd] +

                     (uint)local_3c[0xc] +

                     (uint)local_3c[0xb] +

                     (uint)local_3c[10] +

                     (uint)local_3c[9] +

                     (uint)local_3c[8] +

                     (uint)local_3c[7] +

                     (uint)local_3c[6] +

                     (uint)local_3c[5] +

                     (uint)local_3c[4] + (uint)local_3c[3] + (uint)local_3c[2] + (uint)local_3c[1];

            local_3c = local_3c + iVar18 + 0x11;

          }

        }

      }

      else {

        iVar15 = -0x15;

      }

    }

  }

  if ((local_34 != 0) && (local_38 != (void *)0x0)) {

    operator_delete(local_38);

  }

  return iVar15;

}





// --- FUN_00642ef0 at 0x00642EF0 (size: 801) ---


int FUN_00642ef0(int param_1,int param_2,int param_3,uint *param_4)



{

  byte *pbVar1;

  int *piVar2;

  int iVar3;

  uint uVar4;

  int iVar5;

  byte *local_74;

  void *local_70;

  int local_6c;

  int local_68;

  int *local_64;

  int *local_60;

  int local_5c;

  int local_58;

  int *local_54;

  uint local_50;

  uint local_4c;

  uint local_48;

  int local_44;

  int local_34;

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_00908adc;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_74 = (byte *)0x0;

  local_70 = (void *)0x0;

  local_6c = 0;

  local_68 = 0;

  local_64 = (int *)0x0;

  local_60 = *(int **)(param_2 + 8);

  local_8 = 0;

  ExceptionList = &local_14;

  local_68 = FUN_00641860(param_2,&local_5c);

  if (local_68 == 0) {

    if (local_5c < 2) {

      local_68 = -0x15;

    }

    else {

      *local_60 = local_5c + 2;

      local_5c = local_5c + -2;

      local_68 = FUN_00641680(param_2,local_5c,&local_70,&local_74,&local_6c,&local_74);

      if (local_68 == 0) {

        *param_4 = (uint)*local_74;

        local_74 = local_74 + 1;

        uVar4 = FUN_005df0f5(*param_4 * 0x18,&local_74);

        param_4[0xd] = uVar4;

        piVar2 = (int *)param_4[0xd];

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

          local_68 = -5;

        }

        else {

          local_34 = 0;

          local_58 = 0;

          local_64 = piVar2;

          if (0 < (int)*param_4) {

            do {

              local_50 = (uint)*local_74;

              local_4c = (int)(uint)local_74[1] >> 4;

              pbVar1 = local_74 + 2;

              local_48 = local_74[1] & 0xf;

              local_74 = pbVar1;

              local_58 = local_34;

              local_54 = piVar2;

              if ((4 < local_4c) || (4 < local_48)) {

                local_68 = -0x15;

                operator_delete((void *)param_4[0xd]);

                param_4[0xd] = 0;

                goto LAB_00642f60;

              }

              local_44 = 0;

              iVar3 = *(int *)(param_3 + 0x1c);

              if (0 < iVar3) {

                do {

                  if (local_50 == *(uint *)(local_44 * 0x10 + *(int *)(param_3 + 0x28))) break;

                  local_44 = local_44 + 1;

                } while (local_44 < iVar3);

              }

              if (iVar3 <= local_44) {

LAB_006431e6:

                local_68 = -0x15;

                operator_delete((void *)param_4[0xd]);

                param_4[0xd] = 0;

                goto LAB_00642f60;

              }

              iVar5 = local_44 * 0x10;

              iVar3 = *(int *)(iVar5 + 0xc + *(int *)(param_3 + 0x28));

              if ((iVar3 < 0) || (4 < iVar3)) goto LAB_006431e6;

              *local_64 = local_44;

              local_64[1] = *(int *)(iVar5 + 4 + *(int *)(param_3 + 0x28));

              local_64[2] = *(int *)(iVar5 + 8 + *(int *)(param_3 + 0x28));

              local_64[3] = local_4c * 0x670 + 0x1d24 + param_1;

              local_64[4] = local_48 * 0x670 + 0x364 + param_1;

              local_64[5] = *(int *)(iVar5 + 0xc + *(int *)(param_3 + 0x28)) * 0xb4 + 0x94 + param_1

              ;

              *(char *)(local_34 + 0x37a0 + param_1) = (char)local_4c;

              *(char *)(param_1 + 0x379c + local_34) = (char)local_48;

              local_58 = local_34 + 1;

              local_64 = local_64 + 6;

              local_34 = local_58;

            } while (local_58 < (int)*param_4);

          }

          param_4[2] = (uint)*local_74;

          param_4[3] = (uint)local_74[1];

          param_4[4] = (int)(uint)local_74[2] >> 4;

          param_4[5] = local_74[2] & 0xf;

          local_8 = 0xffffffff;

          local_74 = local_74 + 3;

        }

      }

    }

  }

LAB_00642f60:

  if ((local_6c != 0) && (local_70 != (void *)0x0)) {

    operator_delete(local_70);

  }

  ExceptionList = local_14;

  return local_68;

}





// --- FUN_00643250 at 0x00643250 (size: 5196) ---


undefined4

FUN_00643250(int param_1,int param_2,int *param_3,int param_4,int param_5,int param_6,int param_7,

            int param_8,int param_9,int param_10,char param_11)



{

  undefined2 uVar1;

  undefined4 uVar2;

  int iVar3;

  uint uVar4;

  uint uVar5;

  int iVar6;

  undefined2 *puVar7;

  int iVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  uint uVar14;

  int iVar15;

  int iVar16;

  int iVar17;

  undefined2 *puVar18;

  undefined2 *puVar19;

  undefined4 *puVar20;

  undefined2 *puStack_50;

  undefined2 *puStack_48;

  int local_2c;

  int local_28;

  int local_20;

  

  local_28 = param_7;

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

  if (param_10 == 1) {

    iVar9 = 8;

  }

  else if (param_10 == 2) {

    iVar9 = 4;

  }

  else if (param_10 == 4) {

    iVar9 = 2;

  }

  else {

    iVar9 = 1;

  }

  local_20 = param_6 << 6;

  if ((param_4 != param_8) && (param_5 != param_9)) {

    iVar3 = *(int *)(param_1 + 0x4de0);

    if (iVar3 == 0) {

      local_2c = *param_3;

    }

    else {

      local_2c = *(int *)(param_1 + 0x37c0);

    }

    if (param_10 == 1) {

      if (0 < param_6) {

        iVar3 = 0;

        do {

          (**(code **)(iVar8 + 0x48))(param_7);

          param_7 = param_7 + 0x80;

          iVar3 = iVar3 + 1;

        } while (iVar3 < param_6);

      }

    }

    else if (param_10 == 2) {

      if (param_11 == '\0') {

        iVar3 = 0;

        if (0 < param_6) {

          do {

            (**(code **)(iVar8 + 0x4c))(param_7);

            param_7 = param_7 + 0x80;

            iVar3 = iVar3 + 1;

          } while (iVar3 < param_6);

        }

      }

      else if (0 < local_2c) {

        iVar12 = 0;

        iVar15 = 0;

        while( true ) {

          if (iVar3 == 0) {

            iVar3 = *(int *)(iVar12 * 0x18 + 4 + param_3[0xd]) *

                    *(int *)(iVar12 * 0x18 + 8 + param_3[0xd]);

          }

          else {

            iVar3 = *(int *)(iVar12 * 0x10 + 4 + *(int *)(param_1 + 0x37cc)) *

                    *(int *)(iVar12 * 0x10 + 8 + *(int *)(param_1 + 0x37cc));

          }

          if (iVar3 == 1) {

            iVar11 = iVar15 + 1;

            (**(code **)(iVar8 + 0x48))(param_7 + iVar15 * 0x80);

            local_20 = 1;

          }

          else {

            local_20 = iVar3 + -1;

            iVar11 = iVar15;

            if (iVar3 != 0) {

              do {

                iVar11 = iVar15 + 1;

                (**(code **)(iVar8 + 0x4c))(param_7 + iVar15 * 0x80);

                local_20 = local_20 + -1;

                iVar15 = iVar11;

              } while (local_20 != -1);

              local_20 = -1;

            }

          }

          iVar12 = iVar12 + 1;

          if (local_2c <= iVar12) break;

          iVar3 = *(int *)(param_1 + 0x4de0);

          iVar15 = iVar11;

        }

      }

    }

    else if (param_10 == 4) {

      if (param_11 == '\0') {

        if (0 < param_6) {

          iVar3 = 0;

          do {

            (**(code **)(iVar8 + 0x50))(param_7);

            param_7 = param_7 + 0x80;

            iVar3 = iVar3 + 1;

          } while (iVar3 < param_6);

        }

      }

      else if (0 < local_2c) {

        iVar15 = 0;

        iVar12 = 0;

        while( true ) {

          if (iVar3 == 0) {

            iVar3 = *(int *)(iVar15 * 0x18 + 4 + param_3[0xd]) *

                    *(int *)(iVar15 * 0x18 + 8 + param_3[0xd]);

          }

          else {

            iVar3 = *(int *)(iVar15 * 0x10 + 4 + *(int *)(param_1 + 0x37cc)) *

                    *(int *)(iVar15 * 0x10 + 8 + *(int *)(param_1 + 0x37cc));

          }

          if (iVar3 == 1) {

            iVar11 = iVar12 + 1;

            (**(code **)(iVar8 + 0x4c))(param_7 + iVar12 * 0x80);

            local_20 = 1;

          }

          else {

            local_20 = iVar3 + -1;

            iVar11 = iVar12;

            if (iVar3 != 0) {

              do {

                iVar11 = iVar12 + 1;

                (**(code **)(iVar8 + 0x50))(param_7 + iVar12 * 0x80);

                local_20 = local_20 + -1;

                iVar12 = iVar11;

              } while (local_20 != -1);

              local_20 = -1;

            }

          }

          iVar15 = iVar15 + 1;

          if (local_2c <= iVar15) break;

          iVar3 = *(int *)(param_1 + 0x4de0);

          iVar12 = iVar11;

        }

      }

    }

    else if (param_10 == 8) {

      if (param_11 == '\0') {

        if (0 < param_6) {

          iVar3 = 0;

          do {

            (**(code **)(iVar8 + 0x54))(param_7);

            param_7 = param_7 + 0x80;

            iVar3 = iVar3 + 1;

          } while (iVar3 < param_6);

        }

      }

      else if (0 < local_2c) {

        iVar15 = 0;

        iVar12 = 0;

        while( true ) {

          if (iVar3 == 0) {

            iVar3 = *(int *)(iVar15 * 0x18 + 4 + param_3[0xd]) *

                    *(int *)(iVar15 * 0x18 + 8 + param_3[0xd]);

          }

          else {

            iVar3 = *(int *)(iVar15 * 0x10 + 4 + *(int *)(param_1 + 0x37cc)) *

                    *(int *)(iVar15 * 0x10 + 8 + *(int *)(param_1 + 0x37cc));

          }

          if (iVar3 == 1) {

            iVar11 = iVar12 + 1;

            (**(code **)(iVar8 + 0x50))(param_7 + iVar12 * 0x80);

            local_20 = 1;

          }

          else {

            local_20 = iVar3 + -1;

            iVar11 = iVar12;

            if (iVar3 != 0) {

              do {

                iVar11 = iVar12 + 1;

                (**(code **)(iVar8 + 0x54))(param_7 + iVar12 * 0x80);

                local_20 = local_20 + -1;

                iVar12 = iVar11;

              } while (local_20 != -1);

              local_20 = -1;

            }

          }

          iVar15 = iVar15 + 1;

          if (local_2c <= iVar15) break;

          iVar3 = *(int *)(param_1 + 0x4de0);

          iVar12 = iVar11;

        }

      }

    }

    if (*(int *)(param_1 + 0x4ddc) != 0) {

      iVar8 = *(int *)(param_1 + 0x37c0);

      if (iVar8 < 1) {

        return 0;

      }

      iVar9 = *(int *)(param_1 + 0x37cc);

      iVar3 = 0;

      do {

        iVar12 = 0;

        iVar11 = iVar3 * 0x10;

        iVar15 = *(int *)(iVar11 + 8 + iVar9);

        if (0 < iVar15) {

          iVar8 = *(int *)(iVar11 + 4 + iVar9);

          do {

            iVar6 = 0;

            if (0 < iVar8) {

              while( true ) {

                iVar13 = iVar8 * param_4 * 0x10 +

                         *(int *)(*(int *)(param_1 + 0x4ddc) + 4 + iVar3 * 4) +

                         (iVar15 * param_5 + iVar12) * iVar8 * param_8 * 0x80 + iVar6 * 0x10;

                iVar15 = 0;

                do {

                  (*DAT_008f85a8)(iVar13,local_28,0x10);

                  iVar9 = *(int *)(param_1 + 0x37cc);

                  iVar8 = *(int *)(iVar11 + 4 + iVar9);

                  iVar13 = iVar13 + param_8 * 0x10 * iVar8;

                  local_28 = local_28 + 0x10;

                  iVar15 = iVar15 + 1;

                } while (iVar15 < 8);

                iVar6 = iVar6 + 1;

                if (iVar8 <= iVar6) break;

                iVar15 = *(int *)(iVar11 + 8 + iVar9);

              }

              iVar15 = *(int *)(iVar11 + 8 + iVar9);

            }

            iVar12 = iVar12 + 1;

          } while (iVar12 < iVar15);

          iVar8 = *(int *)(param_1 + 0x37c0);

        }

        iVar3 = iVar3 + 1;

      } while (iVar3 < iVar8);

      return 0;

    }

  }

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

    iVar3 = *(int *)(param_1 + 0x37b8);

    if ((iVar3 == 2) && (*(int *)(param_1 + 0x37bc) == 1)) {

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

      if (param_4 != param_8) {

        if (param_4 == param_8 + -1) {

          uVar4 = *(uint *)(param_1 + 0x4c) & 0xf;

          if (uVar4 == 0) {

            puStack_48 = *(undefined2 **)(param_1 + 0x4834);

          }

          else {

            iVar15 = (int)((uVar4 - 1) + param_10 * 2) / (param_10 * 2);

            puStack_48 = *(undefined2 **)(param_1 + 0x4834);

            if (*(int *)(param_1 + 0x74) == 0) {

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

              if (0 < iVar12) {

                iVar6 = *(int *)(param_1 + 0x37cc);

                iVar13 = 0;

                iVar11 = 0;

                do {

                  iVar16 = *(int *)(iVar13 + 4 + iVar6);

                  if (iVar16 == 1) {

                    iVar12 = 0;

                    puVar18 = puStack_48;

                    do {

                      if (iVar15 < 8) {

                        iVar6 = iVar15;

                        if (5 < 8 - iVar15) {

                          do {

                            uVar1 = puVar18[iVar6 + -1];

                            puVar18[iVar6] = uVar1;

                            puVar18[iVar6 + 1] = uVar1;

                            puVar18[iVar6 + 2] = uVar1;

                            puVar18[iVar6 + 3] = uVar1;

                            puVar18[iVar6 + 4] = uVar1;

                            iVar6 = iVar6 + 5;

                          } while (iVar6 < 2);

                        }

                        do {

                          puVar18[iVar6] = puVar18[iVar6 + -1];

                          iVar6 = iVar6 + 1;

                        } while (iVar6 < 8);

                      }

                      puVar18 = puVar18 + 8;

                      iVar12 = iVar12 + 1;

                    } while (iVar12 < 8);

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

                    iVar6 = *(int *)(param_1 + 0x37cc);

                    iVar16 = *(int *)(iVar13 + 4 + iVar6);

                  }

                  puStack_48 = puStack_48 + iVar16 * 0x40;

                  iVar13 = iVar13 + 0x10;

                  iVar11 = iVar11 + 1;

                } while (iVar11 < iVar12);

                puStack_48 = *(undefined2 **)(param_1 + 0x4834);

              }

            }

            else if (*(int *)(param_3[0xd] + 4) == 1) {

              iVar12 = 0;

              do {

                if (iVar15 < 8) {

                  iVar11 = iVar15;

                  if (5 < 8 - iVar15) {

                    do {

                      uVar1 = puStack_48[iVar11 + -1];

                      puStack_48[iVar11] = uVar1;

                      puStack_48[iVar11 + 1] = uVar1;

                      puStack_48[iVar11 + 2] = uVar1;

                      puStack_48[iVar11 + 3] = uVar1;

                      puStack_48[iVar11 + 4] = uVar1;

                      iVar11 = iVar11 + 5;

                    } while (iVar11 < 2);

                  }

                  do {

                    puStack_48[iVar11] = puStack_48[iVar11 + -1];

                    iVar11 = iVar11 + 1;

                  } while (iVar11 < 8);

                }

                puStack_48 = puStack_48 + 8;

                iVar12 = iVar12 + 1;

              } while (iVar12 < 8);

              puStack_48 = *(undefined2 **)(param_1 + 0x4834);

            }

          }

        }

        else {

          puStack_48 = *(undefined2 **)(param_1 + 0x4834);

        }

        puVar18 = (undefined2 *)

                  (param_4 * 2 * local_20 + *(int *)(*(int *)(param_1 + 0x4dec) + 4) + local_20 * 2)

        ;

        iVar15 = local_20 + -1;

        if (local_20 != 0) {

          do {

            uVar1 = *puStack_48;

            iVar15 = iVar15 + -1;

            puStack_48 = puStack_48 + 1;

            *puVar18 = uVar1;

            puVar18 = puVar18 + 1;

          } while (iVar15 != -1);

        }

        if (param_4 == 0) {

          puVar18 = (undefined2 *)(*(int *)(*(int *)(param_1 + 0x4dec) + 4) + -2 + iVar9 * 2);

          puVar19 = *(undefined2 **)(param_1 + 0x4834);

          iVar15 = param_6 + -1;

          if (param_6 != 0) {

            do {

              iVar12 = 7;

              do {

                uVar1 = *puVar19;

                puVar19 = puVar19 + 8;

                iVar12 = iVar12 + -1;

                *puVar18 = uVar1;

                puVar18 = puVar18 + 8;

              } while (iVar12 != -1);

              iVar15 = iVar15 + -1;

            } while (iVar15 != -1);

          }

        }

      }

      if (param_4 <= iVar3 / (iVar9 * 2)) {

        return 0;

      }

      puVar19 = (undefined2 *)(param_4 * 2 * local_20 + *(int *)(*(int *)(param_1 + 0x4dec) + 4));

      puVar18 = *(undefined2 **)(param_1 + 0x4834);

      iVar3 = local_20 + -1;

      if (local_20 != 0) {

        do {

          uVar1 = *puVar19;

          iVar3 = iVar3 + -1;

          puVar19 = puVar19 + 1;

          *puVar18 = uVar1;

          puVar18 = puVar18 + 1;

        } while (iVar3 != -1);

      }

      param_4 = param_4 + -1;

      iVar3 = *(int *)(param_1 + 0x37b8);

    }

    if ((iVar3 == 2) && (*(int *)(param_1 + 0x37bc) == 2)) {

      if (param_10 != 1) goto LAB_0064381c;

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

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

      puVar20 = *(undefined4 **)(param_1 + 0x4dec);

      if (param_5 != puVar20[4]) {

        uVar2 = *puVar20;

        *puVar20 = puVar20[1];

        *(undefined4 *)(*(int *)(param_1 + 0x4dec) + 4) =

             *(undefined4 *)(*(int *)(param_1 + 0x4dec) + 8);

        if (param_5 == param_9) {

          *(undefined4 *)(*(int *)(param_1 + 0x4dec) + 8) =

               *(undefined4 *)(*(int *)(param_1 + 0x4dec) + 0xc);

          *(undefined4 *)(*(int *)(param_1 + 0x4dec) + 0xc) = uVar2;

          puVar20 = *(undefined4 **)(param_1 + 0x4dec);

        }

        else {

          *(undefined4 *)(*(int *)(param_1 + 0x4dec) + 8) = uVar2;

          puVar20 = *(undefined4 **)(param_1 + 0x4dec);

        }

      }

      puVar20[4] = param_5;

      if ((param_4 != param_8) && (param_5 != param_9)) {

        iVar12 = param_8 + -1;

        if (param_4 == iVar12) {

          uVar4 = *(uint *)(param_1 + 0x4c) & 0xf;

          if (uVar4 == 0) {

            puStack_50 = *(undefined2 **)(param_1 + 0x4834);

          }

          else {

            uVar4 = (uVar4 + 1) / 2;

            puStack_50 = *(undefined2 **)(param_1 + 0x4834);

            if (*(int *)(param_1 + 0x74) == 0) {

              local_2c = *(int *)(param_1 + 0x54);

              if (0 < local_2c) {

                iVar6 = *(int *)(param_1 + 0x37cc);

                iVar13 = 0;

                iVar11 = 0;

                do {

                  iVar16 = iVar6 + iVar13;

                  iVar10 = *(int *)(iVar16 + 4);

                  if (iVar10 == 1) {

                    iVar6 = 0;

                    puVar18 = puStack_50;

                    do {

                      if (uVar4 < 8) {

                        uVar14 = uVar4;

                        if (5 < (int)(8 - uVar4)) {

                          do {

                            uVar1 = puVar18[uVar14 - 1];

                            puVar18[uVar14] = uVar1;

                            puVar18[uVar14 + 1] = uVar1;

                            puVar18[uVar14 + 2] = uVar1;

                            puVar18[uVar14 + 3] = uVar1;

                            puVar18[uVar14 + 4] = uVar1;

                            uVar14 = uVar14 + 5;

                          } while ((int)uVar14 < 2);

                        }

                        do {

                          puVar18[uVar14] = puVar18[uVar14 - 1];

                          uVar14 = uVar14 + 1;

                        } while ((int)uVar14 < 8);

                      }

                      puVar18 = puVar18 + 8;

                      iVar6 = iVar6 + 1;

                    } while (iVar6 < 8);

                    local_2c = *(int *)(param_1 + 0x54);

                    iVar6 = *(int *)(param_1 + 0x37cc);

                    iVar16 = iVar6 + iVar13;

                    iVar10 = *(int *)(iVar16 + 4);

                  }

                  iVar13 = iVar13 + 0x10;

                  iVar11 = iVar11 + 1;

                  puStack_50 = (undefined2 *)

                               ((int)puStack_50 + iVar10 * 0x80 * *(int *)(iVar16 + 8));

                } while (iVar11 < local_2c);

                puStack_50 = *(undefined2 **)(param_1 + 0x4834);

              }

            }

            else if (*(int *)(param_3[0xd] + 4) == 1) {

              iVar11 = 0;

              do {

                if (uVar4 < 8) {

                  uVar14 = uVar4;

                  if (5 < (int)(8 - uVar4)) {

                    do {

                      uVar1 = puStack_50[uVar14 - 1];

                      puStack_50[uVar14] = uVar1;

                      puStack_50[uVar14 + 1] = uVar1;

                      puStack_50[uVar14 + 2] = uVar1;

                      puStack_50[uVar14 + 3] = uVar1;

                      puStack_50[uVar14 + 4] = uVar1;

                      uVar14 = uVar14 + 5;

                    } while ((int)uVar14 < 2);

                  }

                  do {

                    puStack_50[uVar14] = puStack_50[uVar14 - 1];

                    uVar14 = uVar14 + 1;

                  } while ((int)uVar14 < 8);

                }

                puStack_50 = puStack_50 + 8;

                iVar11 = iVar11 + 1;

              } while (iVar11 < 8);

              puStack_50 = *(undefined2 **)(param_1 + 0x4834);

            }

          }

        }

        else {

          puStack_50 = *(undefined2 **)(param_1 + 0x4834);

        }

        if ((param_5 == param_9 + -1) && (uVar4 = *(uint *)(param_1 + 0x50) & 0xf, uVar4 != 0)) {

          uVar4 = (uVar4 + 1) / 2;

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

          if (0 < iVar11) {

            iVar13 = *(int *)(param_1 + 0x37cc);

            uVar14 = uVar4 * 8;

            iVar16 = 0;

            iVar6 = 0;

            do {

              iVar10 = iVar13 + iVar16;

              iVar17 = *(int *)(iVar10 + 8);

              if (iVar17 == 1) {

                iVar11 = 0;

                puVar18 = puStack_50;

                do {

                  if (uVar14 < 0x40) {

                    uVar5 = uVar14;

                    if (0x2f < (int)(uVar4 * -8 + 0x40)) {

                      do {

                        uVar1 = puVar18[uVar5 - 8];

                        puVar18[uVar5] = uVar1;

                        puVar18[uVar5 + 8] = uVar1;

                        puVar18[uVar5 + 0x10] = uVar1;

                        puVar18[uVar5 + 0x18] = uVar1;

                        puVar18[uVar5 + 0x20] = uVar1;

                        uVar5 = uVar5 + 0x28;

                      } while ((int)uVar5 < 0x10);

                    }

                    do {

                      puVar18[uVar5] = puVar18[uVar5 - 8];

                      uVar5 = uVar5 + 8;

                    } while ((int)uVar5 < 0x40);

                  }

                  puVar18 = puVar18 + 1;

                  iVar11 = iVar11 + 1;

                } while (iVar11 < 8);

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

                iVar13 = *(int *)(param_1 + 0x37cc);

                iVar10 = iVar13 + iVar16;

                iVar17 = *(int *)(iVar10 + 8);

              }

              puStack_50 = (undefined2 *)((int)puStack_50 + iVar17 * *(int *)(iVar10 + 4) * 0x80);

              iVar16 = iVar16 + 0x10;

              iVar6 = iVar6 + 1;

            } while (iVar6 < iVar11);

            puStack_50 = *(undefined2 **)(param_1 + 0x4834);

          }

        }

        iVar13 = local_20 * 2 * param_4;

        iVar6 = local_20 * 2;

        puVar18 = (undefined2 *)(*(int *)(*(int *)(param_1 + 0x4dec) + 8) + local_20 * 2 + iVar13);

        iVar11 = local_20 + -1;

        if (local_20 != 0) {

          do {

            uVar1 = *puStack_50;

            iVar11 = iVar11 + -1;

            puStack_50 = puStack_50 + 1;

            *puVar18 = uVar1;

            puVar18 = puVar18 + 1;

          } while (iVar11 != -1);

        }

        if (param_4 == 0) {

          puVar19 = (undefined2 *)(*(int *)(*(int *)(param_1 + 0x4dec) + 8) + 0xe);

          puVar18 = *(undefined2 **)(param_1 + 0x4834);

          iVar11 = param_6 + -1;

          if (param_6 != 0) {

            do {

              iVar16 = 7;

              do {

                uVar1 = *puVar18;

                puVar18 = puVar18 + 8;

                iVar16 = iVar16 + -1;

                *puVar19 = uVar1;

                puVar19 = puVar19 + 8;

              } while (iVar16 != -1);

              iVar11 = iVar11 + -1;

            } while (iVar11 != -1);

          }

        }

        if (param_4 == iVar12) {

          puVar19 = (undefined2 *)(*(int *)(param_1 + 0x4834) + 0xe);

          puVar18 = (undefined2 *)

                    (param_8 * 2 * local_20 + *(int *)(*(int *)(param_1 + 0x4dec) + 8) + iVar6);

          iVar11 = param_6 + -1;

          if (param_6 != 0) {

            do {

              iVar16 = 7;

              do {

                uVar1 = *puVar19;

                puVar19 = puVar19 + 8;

                iVar16 = iVar16 + -1;

                *puVar18 = uVar1;

                puVar18 = puVar18 + 8;

              } while (iVar16 != -1);

              iVar11 = iVar11 + -1;

            } while (iVar11 != -1);

          }

        }

        if (param_5 == 0) {

          puVar18 = *(undefined2 **)(param_1 + 0x4834);

          puVar19 = (undefined2 *)(*(int *)(*(int *)(param_1 + 0x4dec) + 4) + iVar6 + iVar13);

          iVar11 = param_6 + -1;

          iVar16 = iVar11;

          if (param_6 != 0) {

            do {

              puVar19 = puVar19 + 0x38;

              iVar10 = 7;

              do {

                puVar7 = puVar18;

                iVar10 = iVar10 + -1;

                *puVar19 = *puVar7;

                puVar19 = puVar19 + 1;

                puVar18 = puVar7 + 1;

              } while (iVar10 != -1);

              puVar18 = puVar7 + 0x39;

              iVar16 = iVar16 + -1;

            } while (iVar16 != -1);

          }

          if (param_4 == 0) {

            puVar19 = (undefined2 *)(*(int *)(*(int *)(param_1 + 0x4dec) + 4) + 0x7e);

            puVar18 = *(undefined2 **)(param_1 + 0x4834);

            iVar16 = iVar11;

            if (param_6 != 0) {

              do {

                uVar1 = *puVar18;

                puVar18 = puVar18 + 0x40;

                iVar16 = iVar16 + -1;

                *puVar19 = uVar1;

                puVar19 = puVar19 + 0x40;

              } while (iVar16 != -1);

            }

          }

          if (param_4 == iVar12) {

            puVar19 = (undefined2 *)(*(int *)(param_1 + 0x4834) + 0xe);

            puVar18 = (undefined2 *)

                      (param_8 * 2 * local_20 + *(int *)(*(int *)(param_1 + 0x4dec) + 4) + 0x70 +

                      iVar6);

            if (param_6 != 0) {

              do {

                uVar1 = *puVar19;

                puVar19 = puVar19 + 0x40;

                iVar11 = iVar11 + -1;

                *puVar18 = uVar1;

                puVar18 = puVar18 + 0x40;

              } while (iVar11 != -1);

            }

          }

        }

        if (param_5 == param_9 + -1) {

          puVar18 = *(undefined2 **)(param_1 + 0x4834);

          puVar19 = (undefined2 *)(*(int *)(*(int *)(param_1 + 0x4dec) + 0xc) + iVar6 + iVar13);

          iVar11 = param_6 + -1;

          iVar13 = iVar11;

          if (param_6 != 0) {

            do {

              puVar18 = puVar18 + 0x38;

              iVar16 = 7;

              do {

                puVar7 = puVar19;

                uVar1 = *puVar18;

                puVar18 = puVar18 + 1;

                iVar16 = iVar16 + -1;

                *puVar7 = uVar1;

                puVar19 = puVar7 + 1;

              } while (iVar16 != -1);

              puVar19 = puVar7 + 0x39;

              iVar13 = iVar13 + -1;

            } while (iVar13 != -1);

          }

          if (param_4 == 0) {

            puVar18 = (undefined2 *)(*(int *)(*(int *)(param_1 + 0x4dec) + 0xc) + 0xe);

            puVar19 = (undefined2 *)(*(int *)(param_1 + 0x4834) + 0x70);

            iVar13 = iVar11;

            if (param_6 != 0) {

              do {

                uVar1 = *puVar19;

                puVar19 = puVar19 + 0x40;

                iVar13 = iVar13 + -1;

                *puVar18 = uVar1;

                puVar18 = puVar18 + 0x40;

              } while (iVar13 != -1);

            }

          }

          if (param_4 == iVar12) {

            puVar19 = (undefined2 *)(*(int *)(param_1 + 0x4834) + 0x7e);

            puVar18 = (undefined2 *)

                      (param_8 * 2 * local_20 + *(int *)(*(int *)(param_1 + 0x4dec) + 0xc) + iVar6);

            if (param_6 != 0) {

              do {

                uVar1 = *puVar19;

                puVar19 = puVar19 + 0x40;

                iVar11 = iVar11 + -1;

                *puVar18 = uVar1;

                puVar18 = puVar18 + 0x40;

              } while (iVar11 != -1);

            }

          }

        }

      }

      if ((param_4 <= iVar3 >> 4) || (param_5 <= iVar15 >> 4)) {

        return 0;

      }

      puVar19 = (undefined2 *)(local_20 * 2 * param_4 + *(int *)(*(int *)(param_1 + 0x4dec) + 4));

      puVar18 = *(undefined2 **)(param_1 + 0x4834);

      iVar3 = local_20 + -1;

      if (local_20 != 0) {

        do {

          uVar1 = *puVar19;

          iVar3 = iVar3 + -1;

          puVar19 = puVar19 + 1;

          *puVar18 = uVar1;

          puVar18 = puVar18 + 1;

        } while (iVar3 != -1);

      }

      param_4 = param_4 + -1;

      param_5 = param_5 + -1;

    }

  }

  if (param_10 == 1) {

    (**(code **)(iVar8 + 0xa0))(param_1,param_4,param_5);

    return 0;

  }

LAB_0064381c:

  FUN_00632ba0(param_1,param_2,param_3,param_4,param_5,iVar9,param_11);

  return 0;

}





// --- FUN_006446e0 at 0x006446E0 (size: 266) ---


undefined4 FUN_006446e0(int param_1,undefined4 *param_2,int param_3,int *param_4)



{

  undefined4 uVar1;

  int iVar2;

  

  param_1 = param_1 * 0x28;

  uVar1 = *(undefined4 *)(param_4[0x120c] + 0x1c + param_1);

  *param_2 = *(undefined4 *)(param_4[0x120c] + 0x18 + param_1);

  param_2[1] = uVar1;

  param_2[3] = *(undefined4 *)(param_4[0x120c] + 0x20 + param_1);

  *(undefined1 *)(param_2 + 0xc) = *(undefined1 *)(param_4[0x120c] + 0x24 + param_1);

  *(undefined4 *)(param_3 + 0x24) = *(undefined4 *)(param_4[0x120c] + 4 + param_1);

  *(undefined4 *)(param_3 + 0x28) = *(undefined4 *)(param_4[0x120c] + 8 + param_1);

  *(undefined4 *)(param_3 + 0x2c) = *(undefined4 *)(param_4[0x120c] + 0xc + param_1);

  *(undefined4 *)(param_3 + 0x30) = *(undefined4 *)(param_4[0x120c] + 0x10 + param_1);

  iVar2 = *param_4;

  if ((((iVar2 == 2) || (iVar2 == 6)) || (iVar2 == 0xe)) || ((iVar2 == 0x12 || (iVar2 == 0x10)))) {

    uVar1 = *(undefined4 *)(param_4[0x120c] + param_1);

    param_2[7] = uVar1;

    iVar2 = FUN_00619570(param_2[0xf],uVar1,0);

    if (iVar2 == 0) {

      return 0xffffffe9;

    }

    iVar2 = FUN_00649570(param_2);

    if (iVar2 != 0) {

      return 0xffffffe9;

    }

  }

  else {

    iVar2 = *(int *)(param_4[0x120c] + param_1);

    param_2[4] = iVar2;

    iVar2 = iVar2 - param_4[0x11];

    param_2[7] = iVar2;

    param_2[9] = param_2[8] - iVar2;

  }

  return 0;

}





// --- FUN_006447f0 at 0x006447F0 (size: 184) ---


void FUN_006447f0(int param_1,undefined4 *param_2,int param_3,int *param_4)



{

  undefined4 uVar1;

  int iVar2;

  

  param_1 = param_1 * 0x28;

  *(undefined4 *)(param_4[0x120c] + 4 + param_1) = *(undefined4 *)(param_3 + 0x24);

  *(undefined4 *)(param_4[0x120c] + 8 + param_1) = *(undefined4 *)(param_3 + 0x28);

  *(undefined4 *)(param_4[0x120c] + 0xc + param_1) = *(undefined4 *)(param_3 + 0x2c);

  *(undefined4 *)(param_4[0x120c] + 0x10 + param_1) = *(undefined4 *)(param_3 + 0x30);

  uVar1 = param_2[1];

  iVar2 = param_4[0x120c];

  *(undefined4 *)(iVar2 + 0x18 + param_1) = *param_2;

  *(undefined4 *)(iVar2 + 0x1c + param_1) = uVar1;

  *(undefined4 *)(param_4[0x120c] + 0x20 + param_1) = param_2[3];

  *(undefined1 *)(param_4[0x120c] + 0x24 + param_1) = *(undefined1 *)(param_2 + 0xc);

  iVar2 = *param_4;

  if ((((iVar2 != 2) && (iVar2 != 0xe)) && (iVar2 != 0x10)) && ((iVar2 != 6 && (iVar2 != 0x12)))) {

    *(undefined4 *)(param_4[0x120c] + param_1) = param_2[4];

    return;

  }

  *(undefined4 *)(param_4[0x120c] + param_1) = param_2[7];

  return;

}





// --- FUN_006448b0 at 0x006448B0 (size: 128) ---


int FUN_006448b0(int param_1,int param_2,int param_3,int param_4,int param_5,int param_6)



{

  uint uVar1;

  int iVar2;

  undefined1 local_14 [4];

  

  if (((*(uint *)(param_2 + 0x18) != 0) &&

      (uVar1 = param_5 + 1 + param_6 * param_3, uVar1 % *(uint *)(param_2 + 0x18) == 0)) &&

     ((int)uVar1 < param_4 * param_3)) {

    *(undefined4 *)(param_2 + 0x24) = 0;

    *(undefined4 *)(param_2 + 0x28) = 0;

    *(undefined4 *)(param_2 + 0x2c) = 0;

    *(undefined4 *)(param_2 + 0x30) = 0;

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

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

      iVar2 = FUN_006418e0(param_1,local_14);

      if (iVar2 != 0) {

        return iVar2;

      }

    }

    else {

      *(undefined1 *)(param_1 + 0x30) = 0;

    }

  }

  return 0;

}





// --- FUN_00644930 at 0x00644930 (size: 4853) ---


undefined4 FUN_00644930(int param_1,int *param_2,int param_3,undefined4 param_4)



{

  int iVar1;

  int iVar2;

  int *piVar3;

  int iVar4;

  int iVar5;

  int *piVar6;

  int iVar7;

  int iVar8;

  int iVar9;

  undefined4 local_94 [4];

  undefined4 auStack_84 [4];

  int aiStack_74 [4];

  short asStack_64 [2];

  int local_60;

  int local_5c;

  int local_58;

  int local_54;

  int local_50;

  int local_4c;

  int local_48;

  int local_44;

  int local_40;

  int local_3c;

  int local_38;

  int *local_34;

  int local_30;

  int *local_2c;

  int local_28;

  int *local_24;

  int local_20;

  char local_1c;

  int local_18;

  int local_14;

  

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

  iVar5 = 0;

  local_18 = 0;

  iVar2 = *param_2;

  if (0 < iVar2) {

    iVar4 = param_2[0xd];

    iVar1 = 0;

    do {

      local_94[iVar5] = *(undefined4 *)(iVar1 + 0x10 + iVar4);

      auStack_84[iVar5] = *(undefined4 *)(iVar1 + 0xc + iVar4);

      aiStack_74[iVar5] = *(int *)(iVar1 + 4 + iVar4) * *(int *)(iVar1 + 8 + iVar4);

      iVar1 = iVar1 + 0x18;

      iVar5 = iVar5 + 1;

    } while (iVar5 < iVar2);

  }

  iVar5 = 0;

  iVar2 = *(int *)(param_3 + 0x37c0);

  if (0 < iVar2) {

    iVar1 = 0;

    do {

      iVar5 = iVar5 + 1;

      local_18 = local_18 +

                 *(int *)(iVar1 + 4 + *(int *)(param_3 + 0x37cc)) *

                 *(int *)(iVar1 + 8 + *(int *)(param_3 + 0x37cc));

      iVar1 = iVar1 + 0x10;

    } while (iVar5 < iVar2);

  }

  iVar5 = *(int *)(param_3 + 0x37b8);

  if ((iVar5 == 1) && (*(int *)(param_3 + 0x37bc) == 1)) {

    local_1c = '\0';

  }

  else {

    iVar1 = 0;

    local_1c = '\x01';

    if (0 < iVar2) {

      iVar4 = 0;

      local_24 = (int *)iVar5;

      local_1c = '\x01';

      do {

        if (local_1c == '\0') {

          goto LAB_00644a63;

        }

        iVar8 = *(int *)(*(int *)(param_3 + 0x37cc) + 4 + iVar4);

        if (iVar8 != *(int *)(*(int *)(param_3 + 0x37cc) + 8 + iVar4)) {

          local_1c = '\0';

        }

        if ((iVar8 != 1) && (iVar8 != 2)) {

          local_1c = '\0';

        }

        iVar4 = iVar4 + 0x10;

        iVar1 = iVar1 + 1;

      } while (iVar1 < iVar2);

    }

  }

LAB_00644a63:

  if (((iVar5 == 2) && (*(int *)(param_3 + 0x37bc) < 3)) && (*(int *)(param_3 + 0x4de8) == 1)) {

    local_44 = 1;

  }

  else {

    local_44 = 0;

  }

  if (((iVar5 == 2) && (*(int *)(param_3 + 0x37bc) == 2)) && (*(int *)(param_3 + 0x4de8) == 1)) {

    local_14 = 1;

  }

  else {

    local_14 = 0;

  }

  if ((param_2[2] == 0) || (param_2[3] == 0)) {

    iVar2 = param_2[8];

    iVar5 = *(int *)(param_3 + 0x7c);

    if (iVar2 < iVar5) {

      local_50 = local_18 << 7;

      local_4c = local_18 << 7;

      local_48 = iVar2;

      do {

        iVar2 = param_2[7];

        iVar1 = *(int *)(param_3 + 0x78);

        if (iVar2 < iVar1) {

          local_58 = local_48 << 7;

          do {

            iVar5 = 0;

            local_3c = *(int *)param_2[0xd];

            iVar4 = (iVar1 * local_48 + iVar2) * local_4c + *(int *)(param_3 + 0x4de4);

            if (0 < local_3c) {

              local_5c = *(int *)(param_3 + 0x37cc);

              iVar8 = 0;

              local_40 = 0;

              local_60 = iVar1;

              do {

                iVar5 = iVar5 + 1;

                iVar4 = iVar4 + *(int *)(iVar8 + 4 + local_5c) * 0x80 *

                                *(int *)(iVar8 + 8 + local_5c);

                iVar8 = iVar8 + 0x10;

                local_54 = iVar2;

              } while (iVar5 < local_3c);

            }

            if (param_2[4] == 0) {

              iVar5 = *param_2;

              if (0 < iVar5) {

                local_54 = iVar2;

                iVar2 = 0;

                do {

                  if (0 < aiStack_74[iVar2]) {

                    iVar5 = 0;

                    do {

                      (*DAT_008f85a4)(iVar4,0x80);

                      asStack_64[0] = (short)param_2[iVar2 + 9];

                      FUN_00621030(param_1,auStack_84[iVar2],iVar4,asStack_64,param_2[5]);

                      iVar4 = iVar4 + 0x80;

                      iVar5 = iVar5 + 1;

                      param_2[iVar2 + 9] = (int)asStack_64[0];

                    } while (iVar5 < aiStack_74[iVar2]);

                    iVar5 = *param_2;

                  }

                  iVar2 = iVar2 + 1;

                } while (iVar2 < iVar5);

                iVar1 = *(int *)(param_3 + 0x78);

                iVar2 = local_54;

              }

            }

            else {

              iVar8 = 0;

              iVar5 = *param_2;

              if (0 < iVar5) {

                local_54 = iVar2;

                do {

                  iVar2 = 0;

                  if (0 < aiStack_74[iVar8]) {

                    do {

                      local_3c = iVar8;

                      FUN_00621110(param_1,iVar4,param_2[5]);

                      iVar4 = iVar4 + 0x80;

                      iVar2 = iVar2 + 1;

                      iVar8 = local_3c;

                    } while (iVar2 < aiStack_74[local_3c]);

                    iVar5 = *param_2;

                  }

                  iVar8 = iVar8 + 1;

                } while (iVar8 < iVar5);

                iVar1 = *(int *)(param_3 + 0x78);

                iVar2 = local_54;

              }

            }

            iVar5 = FUN_006448b0(param_1,param_2,iVar1,*(undefined4 *)(param_3 + 0x7c),iVar2,

                                 local_48);

            if (iVar5 != 0) {

              return 0xffffffe7;

            }

            iVar5 = *(int *)(param_3 + 0x37c0);

            if (*(int *)(param_3 + 0x37d4) < iVar5) {

              iVar1 = *(int *)(param_3 + 0x78);

            }

            else if (*(int *)(param_3 + 0x37d8) < iVar5) {

              iVar1 = *(int *)(param_3 + 0x78);

            }

            else {

              iVar1 = *(int *)(param_3 + 0x78);

              iVar4 = (iVar1 * local_48 + iVar2) * local_4c + *(int *)(param_3 + 0x4de4);

              if ((*(int **)(param_3 + 0x4ddc) == (int *)0x0) || (**(int **)(param_3 + 0x4ddc) == 0)

                 ) {

                local_5c = *(int *)(param_3 + 0x4834);

                (*DAT_008f85a8)(local_5c,iVar4,local_50);

                iVar1 = 0;

                iVar5 = *(int *)(param_3 + 0x37c0);

                if (0 < iVar5) {

                  local_60 = local_5c;

                  local_54 = iVar2;

                  do {

                    iVar8 = iVar1 * 0x10 + *(int *)(param_3 + 0x37cc);

                    iVar9 = 0;

                    iVar7 = *(int *)(iVar8 + 4) * *(int *)(iVar8 + 8);

                    iVar2 = local_60;

                    iVar4 = iVar1 * 0x10;

                    if (0 < iVar7) {

                      while( true ) {

                        local_3c = iVar4;

                        local_40 = iVar1;

                        (**(code **)(local_20 + 0x110))

                                  (iVar2,*(undefined4 *)

                                          (*(int *)(iVar8 + 0xc) * 0xb4 + 0x9c + param_3));

                        iVar9 = iVar9 + 1;

                        iVar1 = local_40;

                        if (iVar7 <= iVar9) break;

                        iVar8 = *(int *)(param_3 + 0x37cc) + local_3c;

                        iVar2 = iVar2 + 0x80;

                        iVar4 = local_3c;

                      }

                      iVar5 = *(int *)(param_3 + 0x37c0);

                      local_60 = iVar2 + 0x80;

                    }

                    iVar1 = iVar1 + 1;

                    iVar2 = local_54;

                  } while (iVar1 < iVar5);

                }

                FUN_00643250(param_3,param_1,param_2,iVar2,local_48,local_18,local_5c,

                             *(undefined4 *)(param_3 + 0x78),*(undefined4 *)(param_3 + 0x7c),param_4

                             ,local_1c);

                iVar1 = *(int *)(param_3 + 0x78);

              }

              else {

                local_3c = 0;

                if (0 < iVar5) {

                  iVar9 = *(int *)(param_3 + 0x37cc);

                  iVar8 = 0;

                  local_5c = iVar9;

                  local_40 = iVar2 << 4;

                  local_28 = iVar4;

                  local_60 = iVar1;

                  local_54 = iVar2;

                  do {

                    iVar1 = 0;

                    piVar6 = (int *)(iVar8 * 0x10);

                    iVar2 = *(int *)((int)piVar6 + 8 + iVar9);

                    if (0 < iVar2) {

                      local_24 = (int *)(iVar8 * 2);

                      iVar5 = *(int *)((int)piVar6 + 4 + iVar9);

                      local_3c = iVar8;

                      do {

                        iVar4 = 0;

                        if (0 < iVar5) {

                          local_34 = (int *)(iVar1 << 7);

                          iVar8 = local_60;

                          local_38 = iVar1;

                          local_2c = piVar6;

                          while( true ) {

                            iVar1 = 0;

                            iVar7 = iVar4 * 0x10 +

                                    *(int *)(*(int *)(param_3 + 0x4ddc) + 4 + (int)local_24 * 2) +

                                    iVar2 * local_58 * iVar8 * iVar5 + iVar8 * iVar5 * (int)local_34

                                    + iVar5 * local_40;

                            iVar2 = local_28;

                            local_30 = iVar4;

                            do {

                              (*DAT_008f85a8)(iVar7,iVar2,0x10);

                              iVar9 = *(int *)(param_3 + 0x37cc);

                              iVar8 = *(int *)(param_3 + 0x78);

                              iVar5 = *(int *)((int)local_2c + 4 + iVar9);

                              iVar7 = iVar7 + iVar8 * 0x10 * iVar5;

                              iVar2 = iVar2 + 0x10;

                              iVar1 = iVar1 + 1;

                            } while (iVar1 < 8);

                            local_28 = iVar2;

                            iVar4 = local_30 + 1;

                            if (iVar5 <= iVar4) break;

                            iVar2 = *(int *)((int)local_2c + 8 + iVar9);

                          }

                          local_60 = iVar8;

                          iVar2 = *(int *)((int)local_2c + 8 + iVar9);

                          iVar1 = local_38;

                          piVar6 = local_2c;

                        }

                        iVar1 = iVar1 + 1;

                      } while (iVar1 < iVar2);

                      iVar5 = *(int *)(param_3 + 0x37c0);

                      iVar8 = local_3c;

                    }

                    iVar8 = iVar8 + 1;

                    iVar1 = local_60;

                    iVar2 = local_54;

                  } while (iVar8 < iVar5);

                }

              }

            }

            if (((*(int *)(param_3 + 0x1c) != 0) && ((local_44 == 0 || (iVar2 != 0)))) &&

               ((local_14 == 0 || (local_48 != 0)))) {

              iVar5 = (iVar2 + 1) % (iVar1 + local_44);

              param_2[7] = iVar5;

              if (iVar5 == 0) {

                param_2[8] = local_48 + 1;

                if (local_48 + 1 == local_14 + *(int *)(param_3 + 0x7c)) {

                  param_2[8] = 0;

                  return 0;

                }

              }

              else {

                param_2[8] = local_48;

              }

              *(int *)(param_3 + 0xc) = iVar2 - local_44;

              *(int *)(param_3 + 0x10) = local_48 - local_14;

              *(int *)(param_3 + 4) = iVar2 - local_44;

              *(int *)(param_3 + 8) = local_48 - local_14;

              return 1;

            }

            iVar2 = iVar2 + 1;

          } while (iVar2 < iVar1);

          iVar5 = *(int *)(param_3 + 0x7c);

        }

        if (local_44 != 0) {

          FUN_00643250(param_3,param_1,param_2,iVar2,local_48,local_18,

                       *(undefined4 *)(param_3 + 0x4834),iVar1,iVar5,param_4,local_1c);

          if (*(int *)(param_3 + 0x1c) == 0) {

            iVar5 = *(int *)(param_3 + 0x7c);

          }

          else if (iVar2 == 0) {

            iVar5 = *(int *)(param_3 + 0x7c);

          }

          else {

            if ((local_14 == 0) || (local_48 != 0)) {

              iVar5 = (iVar2 + 1) % (local_44 + *(int *)(param_3 + 0x78));

              param_2[7] = iVar5;

              if (iVar5 == 0) {

                iVar5 = local_48 + 1;

                param_2[8] = iVar5;

              }

              else {

                param_2[8] = local_48;

                iVar5 = local_48;

              }

              if (iVar5 != local_14 + *(int *)(param_3 + 0x7c)) {

                *(int *)(param_3 + 0xc) = iVar2 - local_44;

                *(int *)(param_3 + 0x10) = local_48 - local_14;

                *(int *)(param_3 + 4) = iVar2 - local_44;

                *(int *)(param_3 + 8) = local_48 - local_14;

                return 1;

              }

              param_2[8] = 0;

              return 0;

            }

            iVar5 = *(int *)(param_3 + 0x7c);

          }

        }

        iVar2 = local_48 + 1;

        local_48 = iVar2;

      } while (iVar2 < iVar5);

    }

    if (local_14 != 0) {

      iVar1 = param_2[7];

      iVar4 = *(int *)(param_3 + 0x78);

      local_24 = (int *)iVar1;

      if (iVar1 <= iVar4) {

        while( true ) {

          FUN_00643250(param_3,param_1,param_2,iVar1,iVar2,local_18,

                       *(undefined4 *)(param_3 + 0x4834),iVar4,iVar5,param_4,local_1c);

          if (((*(int *)(param_3 + 0x1c) != 0) && ((local_44 == 0 || (iVar1 != 0)))) &&

             ((local_14 == 0 || (iVar2 != 0)))) {

            iVar5 = (iVar1 + 1) % (local_44 + *(int *)(param_3 + 0x78));

            param_2[7] = iVar5;

            if (iVar5 == 0) {

              param_2[8] = iVar2 + 1;

              if (iVar2 + 1 == local_14 + *(int *)(param_3 + 0x7c)) {

                param_2[8] = 0;

                return 0;

              }

            }

            else {

              param_2[8] = iVar2;

            }

            *(int *)(param_3 + 0xc) = iVar1 - local_44;

            *(int *)(param_3 + 0x10) = iVar2 - local_14;

            *(int *)(param_3 + 4) = iVar1 - local_44;

            *(int *)(param_3 + 8) = iVar2 - local_14;

            return 1;

          }

          iVar1 = iVar1 + 1;

          iVar4 = *(int *)(param_3 + 0x78);

          if (iVar4 < iVar1) break;

          iVar5 = *(int *)(param_3 + 0x7c);

        }

      }

    }

  }

  else {

    piVar6 = (int *)param_2[0xd];

    local_30 = (iVar5 * 8) / piVar6[1];

    piVar3 = (int *)piVar6[2];

    iVar1 = (*(int *)(param_3 + 0x37bc) * 8) / (int)piVar3;

    local_30 = (local_30 + -1 + *(int *)(param_3 + 0x4c)) / local_30;

    iVar2 = param_2[8];

    local_28 = *(int *)(param_3 + 0x7c);

    local_2c = piVar6;

    iVar5 = local_28;

    local_24 = piVar3;

    if (iVar2 < local_28) {

      local_44 = local_18 << 7;

      local_48 = local_18 << 7;

      local_3c = (iVar1 + -1 + *(int *)(param_3 + 0x50)) / iVar1;

      do {

        if (0 < (int)piVar3) {

          local_50 = iVar2 << 3;

          iVar5 = 0;

          iVar1 = 0;

          local_40 = iVar2;

          do {

            iVar2 = local_40;

            if (*(int *)(param_3 + 0x50) <= (int)piVar3 * local_50 + iVar5) break;

            iVar2 = param_2[7];

            iVar4 = *(int *)(param_3 + 0x78);

            if (iVar2 < iVar4) {

              iVar8 = piVar6[1];

              local_54 = iVar5;

              local_4c = iVar1;

              local_2c = piVar6;

              do {

                iVar5 = 0;

                local_24 = (int *)*local_2c;

                iVar1 = (iVar4 * local_40 + iVar2) * local_44 + *(int *)(param_3 + 0x4de4);

                if (0 < (int)local_24) {

                  local_34 = *(int **)(param_3 + 0x37cc);

                  iVar9 = 0;

                  local_28 = 0;

                  do {

                    iVar5 = iVar5 + 1;

                    iVar1 = iVar1 + *(int *)(iVar9 + 4 + (int)local_34) * 0x80 *

                                    *(int *)(iVar9 + 8 + (int)local_34);

                    iVar9 = iVar9 + 0x10;

                    local_5c = iVar8;

                    local_58 = iVar4;

                    local_38 = iVar2;

                  } while (iVar5 < (int)local_24);

                }

                iVar1 = iVar8 * 0x80 * local_4c + iVar1;

                if (0 < iVar8) {

                  iVar5 = 0;

                  iVar4 = 0;

                  local_38 = iVar2;

                  do {

                    if (*(int *)(param_3 + 0x4c) <= iVar8 * 8 * local_38 + iVar5) {

                      iVar4 = *(int *)(param_3 + 0x78);

                      iVar2 = local_38;

                      goto LAB_00644d54;

                    }

                    if (param_2[4] == 0) {

                      FUN_00621180(param_1,iVar1,local_94[0],param_2[2],param_2[3],param_2[5]);

                    }

                    else {

                      FUN_00621330(param_1,iVar1,local_94[0],param_2[2],param_2[3],param_2[5]);

                    }

                    iVar1 = iVar1 + 0x80;

                    iVar2 = FUN_006448b0(param_1,param_2,local_30,local_3c,

                                         local_38 * *(int *)(param_2[0xd] + 4) + iVar4,

                                         local_40 * *(int *)(param_2[0xd] + 8) + local_4c);

                    if (iVar2 != 0) {

                      return 0xffffffe7;

                    }

                    iVar5 = iVar5 + 8;

                    iVar4 = iVar4 + 1;

                    local_2c = (int *)param_2[0xd];

                    iVar8 = local_2c[1];

                  } while (iVar4 < iVar8);

                  iVar4 = *(int *)(param_3 + 0x78);

                  iVar2 = local_38;

                }

LAB_00644d54:

                iVar2 = iVar2 + 1;

              } while (iVar2 < iVar4);

              piVar3 = (int *)local_2c[2];

              piVar6 = local_2c;

              iVar1 = local_4c;

              iVar5 = local_54;

            }

            iVar5 = iVar5 + 8;

            iVar1 = iVar1 + 1;

            iVar2 = local_40;

          } while (iVar1 < (int)piVar3);

        }

        iVar5 = *(int *)(param_3 + 0x37c0);

        if ((iVar5 <= *(int *)(param_3 + 0x37d4)) && (iVar5 <= *(int *)(param_3 + 0x37d8))) {

          piVar6 = *(int **)(param_3 + 0x4ddc);

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

            iVar1 = 0;

            piVar3 = *(int **)(param_3 + 0x78);

            if (0 < (int)piVar3) {

              do {

                piVar6 = *(int **)(param_3 + 0x4834);

                (*DAT_008f85a8)(piVar6,((int)piVar3 * iVar2 + iVar1) * local_44 +

                                       *(int *)(param_3 + 0x4de4),local_48);

                iVar4 = 0;

                iVar5 = *(int *)(param_3 + 0x37c0);

                piVar3 = piVar6;

                if (0 < iVar5) {

                  do {

                    local_2c = piVar6;

                    local_34 = piVar3;

                    local_38 = iVar1;

                    local_40 = iVar2;

                    iVar2 = iVar4 * 0x10 + *(int *)(param_3 + 0x37cc);

                    iVar1 = 0;

                    iVar8 = *(int *)(iVar2 + 4) * *(int *)(iVar2 + 8);

                    piVar6 = local_34;

                    piVar3 = (int *)(iVar4 * 0x10);

                    if (0 < iVar8) {

                      while( true ) {

                        local_24 = piVar3;

                        local_28 = iVar4;

                        (**(code **)(local_20 + 0x110))

                                  (piVar6,*(undefined4 *)

                                           (*(int *)(iVar2 + 0xc) * 0xb4 + 0x9c + param_3));

                        iVar1 = iVar1 + 1;

                        iVar4 = local_28;

                        if (iVar8 <= iVar1) break;

                        iVar2 = *(int *)(param_3 + 0x37cc) + (int)local_24;

                        piVar6 = piVar6 + 0x20;

                        piVar3 = local_24;

                      }

                      iVar5 = *(int *)(param_3 + 0x37c0);

                      local_34 = piVar6 + 0x20;

                    }

                    iVar4 = iVar4 + 1;

                    iVar1 = local_38;

                    iVar2 = local_40;

                    piVar6 = local_2c;

                    piVar3 = local_34;

                  } while (iVar4 < iVar5);

                }

                FUN_00643250(param_3,param_1,param_2,iVar1,iVar2,local_18,piVar6,

                             *(undefined4 *)(param_3 + 0x78),*(undefined4 *)(param_3 + 0x7c),param_4

                             ,local_1c);

                iVar1 = iVar1 + 1;

                piVar3 = *(int **)(param_3 + 0x78);

              } while (iVar1 < (int)piVar3);

              piVar6 = *(int **)(param_3 + 0x4ddc);

            }

          }

          else {

            iVar1 = 0;

            piVar3 = *(int **)(param_3 + 0x78);

            if (0 < (int)piVar3) {

              local_4c = iVar2 << 7;

              local_40 = iVar2;

              local_34 = piVar3;

              local_24 = piVar6;

              do {

                iVar2 = 0;

                if (0 < iVar5) {

                  iVar4 = *(int *)(param_3 + 0x37cc);

                  local_50 = iVar1 << 4;

                  local_38 = iVar1;

                  local_2c = (int *)(((int)local_34 * local_40 + iVar1) * local_44 +

                                    *(int *)(param_3 + 0x4de4));

                  do {

                    iVar8 = 0;

                    iVar9 = iVar2 * 0x10;

                    iVar1 = *(int *)(iVar9 + 8 + iVar4);

                    if (0 < iVar1) {

                      local_28 = iVar2 * 2;

                      iVar5 = *(int *)(iVar9 + 4 + iVar4);

                      piVar6 = local_24;

                      local_60 = iVar9;

                      local_54 = iVar2;

                      do {

                        iVar2 = 0;

                        piVar3 = local_34;

                        if (0 < iVar5) {

                          while( true ) {

                            local_5c = iVar8;

                            iVar1 = iVar1 * local_4c * (int)piVar3 * iVar5 +

                                    *(int *)((int)piVar6 + local_28 * 2 + 4) + local_50 * iVar5 +

                                    iVar5 * (int)piVar3 * 0x80 * local_5c + iVar2 * 0x10;

                            iVar8 = 0;

                            piVar6 = local_2c;

                            local_58 = iVar2;

                            do {

                              (*DAT_008f85a8)(iVar1,piVar6,0x10);

                              iVar4 = *(int *)(param_3 + 0x37cc);

                              piVar3 = *(int **)(param_3 + 0x78);

                              iVar5 = *(int *)(local_60 + 4 + iVar4);

                              iVar1 = iVar1 + (int)piVar3 * 0x10 * iVar5;

                              piVar6 = piVar6 + 4;

                              iVar8 = iVar8 + 1;

                            } while (iVar8 < 8);

                            iVar2 = local_58 + 1;

                            iVar8 = local_5c;

                            local_2c = piVar6;

                            if (iVar5 <= iVar2) break;

                            piVar6 = *(int **)(param_3 + 0x4ddc);

                            iVar1 = *(int *)(local_60 + 8 + iVar4);

                          }

                          piVar6 = *(int **)(param_3 + 0x4ddc);

                          iVar1 = *(int *)(local_60 + 8 + iVar4);

                          local_34 = piVar3;

                        }

                        iVar8 = iVar8 + 1;

                      } while (iVar8 < iVar1);

                      iVar5 = *(int *)(param_3 + 0x37c0);

                      iVar2 = local_54;

                      local_24 = piVar6;

                    }

                    iVar2 = iVar2 + 1;

                    iVar1 = local_38;

                  } while (iVar2 < iVar5);

                }

                iVar1 = iVar1 + 1;

                piVar6 = local_24;

                piVar3 = local_34;

                iVar2 = local_40;

              } while (iVar1 < (int)local_34);

            }

          }

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

            FUN_00643250(param_3,param_1,param_2,iVar1,iVar2,local_18,

                         *(undefined4 *)(param_3 + 0x4834),piVar3,*(undefined4 *)(param_3 + 0x7c),

                         param_4,local_1c);

          }

        }

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

          param_2[8] = iVar2 + 1;

          param_2[7] = 0;

          if (iVar2 + 1 != local_14 + *(int *)(param_3 + 0x7c)) {

            iVar5 = *(int *)(param_3 + 0x78) + -1;

            *(int *)(param_3 + 0xc) = iVar5;

            *(int *)(param_3 + 0x10) = iVar2;

            *(int *)(param_3 + 4) = iVar5;

            *(int *)(param_3 + 8) = iVar2;

            return 1;

          }

          param_2[8] = 0;

          return 0;

        }

        iVar2 = iVar2 + 1;

        iVar5 = *(int *)(param_3 + 0x7c);

        if (*(int *)(param_3 + 0x7c) <= iVar2) break;

        piVar6 = (int *)param_2[0xd];

        piVar3 = (int *)piVar6[2];

      } while( true );

    }

    local_28 = iVar5;

    if ((*(int **)(param_3 + 0x4ddc) == (int *)0x0) || (**(int **)(param_3 + 0x4ddc) != 0)) {

      iVar4 = 0;

      iVar5 = *(int *)(param_3 + 0x78);

      iVar1 = local_28;

      if (iVar5 != -1 && -1 < iVar5 + 1) {

        while( true ) {

          FUN_00643250(param_3,param_1,param_2,iVar4,iVar2,local_18,

                       *(undefined4 *)(param_3 + 0x4834),iVar5,iVar1,param_4,local_1c);

          iVar4 = iVar4 + 1;

          iVar5 = *(int *)(param_3 + 0x78);

          if (iVar5 + 1 <= iVar4) break;

          iVar1 = *(int *)(param_3 + 0x7c);

        }

      }

    }

  }

  return 0;

}





// --- FUN_00645ce0 at 0x00645CE0 (size: 4771) ---


undefined4 FUN_00645ce0(int param_1,int *param_2,int param_3,int param_4)



{

  bool bVar1;

  int iVar2;

  int iVar3;

  int *piVar4;

  int iVar5;

  int iVar6;

  uint uVar7;

  int iVar8;

  int iVar9;

  int iVar10;

  undefined4 local_ac [4];

  undefined4 auStack_9c [4];

  int local_8c [4];

  short asStack_7c [2];

  int local_78;

  int *local_74;

  int local_70;

  int local_6c;

  int local_68;

  int local_64;

  int local_60;

  int local_5c;

  int local_58;

  int local_54;

  int local_50;

  int local_4c;

  int local_48;

  int local_44;

  int local_40;

  bool local_3c;

  int local_38;

  int local_34;

  int local_30;

  int local_2c;

  int local_28;

  int local_24;

  int local_20;

  int local_1c;

  int local_18;

  

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

  iVar6 = 0;

  local_4c = 0;

  iVar5 = *param_2;

  if (0 < iVar5) {

    iVar2 = 0;

    do {

      if (*(int *)(param_3 + 0x37e0) == 0) {

        param_2[iVar6 + 9] = 0;

        iVar5 = *param_2;

      }

      iVar8 = param_2[0xd];

      local_ac[iVar6] = *(undefined4 *)(iVar2 + 0x10 + iVar8);

      auStack_9c[iVar6] = *(undefined4 *)(iVar2 + 0xc + iVar8);

      iVar9 = iVar2 + 4;

      iVar3 = iVar2 + 8;

      iVar2 = iVar2 + 0x18;

      local_8c[iVar6] = *(int *)(iVar9 + iVar8) * *(int *)(iVar3 + iVar8);

      iVar6 = iVar6 + 1;

    } while (iVar6 < iVar5);

  }

  if (iVar5 == 1) {

    local_8c[0] = 1;

  }

  local_2c = *(int *)(param_3 + 0x37b8);

  if (local_2c == 1) {

    local_34 = *(int *)(param_3 + 0x37bc);

    if (*(int *)(param_3 + 0x37bc) == 1) {

      iVar5 = *(int *)(param_3 + 0x37c0);

      local_3c = false;

      goto LAB_00645dde;

    }

  }

  else {

    local_34 = *(int *)(param_3 + 0x37bc);

  }

  bVar1 = true;

  iVar6 = 0;

  iVar5 = *(int *)(param_3 + 0x37c0);

  local_3c = true;

  if (0 < iVar5) {

    iVar2 = 0;

    do {

      if (!bVar1) {

        local_3c = bVar1;

        goto LAB_00645dde;

      }

      iVar9 = *(int *)(*(int *)(param_3 + 0x37cc) + 4 + iVar2);

      if (iVar9 != *(int *)(*(int *)(param_3 + 0x37cc) + 8 + iVar2)) {

        bVar1 = false;

      }

      if ((iVar9 != 1) && (iVar9 != 2)) {

        bVar1 = false;

      }

      iVar2 = iVar2 + 0x10;

      iVar6 = iVar6 + 1;

    } while (iVar6 < iVar5);

    local_3c = bVar1;

  }

LAB_00645dde:

  local_28 = (int)(8 / (longlong)param_4);

  local_44 = local_2c * local_28;

  local_40 = *(int *)(param_3 + 4) / local_44;

  local_44 = (*(int *)(param_3 + 0xc) + -1 + local_44) / local_44;

  local_1c = local_34 * local_28;

  local_20 = *(int *)(param_3 + 8) / local_1c;

  local_1c = (*(int *)(param_3 + 0x10) + -1 + local_1c) / local_1c;

  if ((*(int *)(param_3 + 0x4de8) == 1) && (local_2c == 2)) {

    local_18 = 1;

  }

  else {

    local_18 = 0;

  }

  if ((*(int *)(param_3 + 0x4de8) == 1) && (local_34 == 2)) {

    local_48 = 1;

  }

  else {

    local_48 = 0;

  }

  if (local_40 != 0) {

    local_40 = local_40 - local_18;

  }

  if (local_20 != 0) {

    local_20 = local_20 - local_48;

  }

  iVar6 = *(int *)(param_3 + 0x78);

  if (local_44 < iVar6) {

    local_44 = local_44 + local_18;

  }

  iVar2 = *(int *)(param_3 + 0x7c);

  local_60 = iVar2;

  if (local_1c < iVar2) {

    local_1c = local_1c + local_48;

  }

  iVar9 = 0;

  if (0 < iVar5) {

    iVar3 = 0;

    local_50 = iVar6;

    do {

      iVar9 = iVar9 + 1;

      local_4c = local_4c +

                 *(int *)(iVar3 + 4 + *(int *)(param_3 + 0x37cc)) *

                 *(int *)(iVar3 + 8 + *(int *)(param_3 + 0x37cc));

      iVar3 = iVar3 + 0x10;

    } while (iVar9 < iVar5);

  }

  if ((param_2[2] == 0) || (param_2[3] == 0)) {

    local_6c = param_2[8];

    if (local_6c < iVar2) {

      local_74 = (int *)(local_4c << 7);

      local_70 = local_4c << 7;

      do {

        iVar5 = param_2[7];

        if (iVar5 < iVar6) {

          local_78 = local_6c << 7;

          do {

            iVar2 = 0;

            local_30 = *(int *)param_2[0xd];

            iVar9 = (iVar6 * local_6c + iVar5) * local_70 + *(int *)(param_3 + 0x4de4);

            if (0 < local_30) {

              local_54 = *(int *)(param_3 + 0x37cc);

              iVar3 = 0;

              local_34 = 0;

              local_50 = iVar6;

              do {

                iVar2 = iVar2 + 1;

                iVar9 = iVar9 + *(int *)(iVar3 + 4 + local_54) * 0x80 *

                                *(int *)(iVar3 + 8 + local_54);

                iVar3 = iVar3 + 0x10;

                local_38 = iVar5;

              } while (iVar2 < local_30);

            }

            if (param_2[4] == 0) {

              iVar2 = *param_2;

              if (0 < iVar2) {

                local_38 = iVar5;

                iVar5 = 0;

                do {

                  iVar6 = 0;

                  if (0 < local_8c[iVar5]) {

                    do {

                      (*DAT_008f85a4)(iVar9,0x80);

                      asStack_7c[0] = (short)param_2[iVar5 + 9];

                      FUN_00621030(param_1,auStack_9c[iVar5],iVar9,asStack_7c,param_2[5]);

                      iVar9 = iVar9 + 0x80;

                      iVar6 = iVar6 + 1;

                      param_2[iVar5 + 9] = (int)asStack_7c[0];

                    } while (iVar6 < local_8c[iVar5]);

                    iVar2 = *param_2;

                  }

                  iVar5 = iVar5 + 1;

                } while (iVar5 < iVar2);

                iVar6 = *(int *)(param_3 + 0x78);

                iVar5 = local_38;

              }

            }

            else {

              iVar3 = 0;

              iVar2 = *param_2;

              if (0 < iVar2) {

                local_38 = iVar5;

                do {

                  if (0 < local_8c[iVar3]) {

                    iVar5 = 0;

                    local_30 = iVar3;

                    do {

                      FUN_00621110(param_1,iVar9,param_2[5]);

                      iVar9 = iVar9 + 0x80;

                      iVar5 = iVar5 + 1;

                    } while (iVar5 < local_8c[local_30]);

                    iVar2 = *param_2;

                    iVar3 = local_30;

                  }

                  iVar3 = iVar3 + 1;

                } while (iVar3 < iVar2);

                iVar6 = *(int *)(param_3 + 0x78);

                iVar5 = local_38;

              }

            }

            iVar6 = FUN_006448b0(param_1,param_2,iVar6,*(undefined4 *)(param_3 + 0x7c),iVar5,

                                 local_6c);

            if (iVar6 != 0) {

              return 0xffffffe7;

            }

            if (iVar5 < local_40) {

              iVar6 = *(int *)(param_3 + 0x78);

            }

            else if (iVar5 < local_44) {

              if (local_6c < local_20) {

                iVar6 = *(int *)(param_3 + 0x78);

              }

              else if (local_6c < local_1c) {

                iVar2 = *(int *)(param_3 + 0x37c0);

                if (*(int *)(param_3 + 0x37d4) < iVar2) {

                  iVar6 = *(int *)(param_3 + 0x78);

                }

                else if (*(int *)(param_3 + 0x37d8) < iVar2) {

                  iVar6 = *(int *)(param_3 + 0x78);

                }

                else {

                  iVar6 = *(int *)(param_3 + 0x78);

                  local_68 = (iVar6 * local_6c + iVar5) * local_70 + *(int *)(param_3 + 0x4de4);

                  if ((*(int **)(param_3 + 0x4ddc) == (int *)0x0) ||

                     (**(int **)(param_3 + 0x4ddc) != 0)) {

                    iVar6 = *(int *)(param_3 + 0x4834);

                    (*DAT_008f85a8)(iVar6,local_68,local_74);

                    iVar9 = 0;

                    iVar2 = *(int *)(param_3 + 0x37c0);

                    iVar3 = *(int *)(param_3 + 0x4834);

                    if (0 < iVar2) {

                      do {

                        local_30 = iVar6;

                        local_34 = iVar3;

                        local_38 = iVar5;

                        iVar3 = iVar9 * 0x10 + *(int *)(param_3 + 0x37cc);

                        iVar8 = 0;

                        iVar10 = *(int *)(iVar3 + 4) * *(int *)(iVar3 + 8);

                        iVar5 = local_34;

                        iVar6 = iVar9 * 0x10;

                        if (0 < iVar10) {

                          while( true ) {

                            local_28 = iVar6;

                            local_2c = iVar9;

                            (**(code **)(local_24 + 0x110))

                                      (iVar5,*(undefined4 *)

                                              (*(int *)(iVar3 + 0xc) * 0xb4 + 0x9c + param_3));

                            iVar8 = iVar8 + 1;

                            iVar9 = local_2c;

                            if (iVar10 <= iVar8) break;

                            iVar3 = *(int *)(param_3 + 0x37cc) + local_28;

                            iVar5 = iVar5 + 0x80;

                            iVar6 = local_28;

                          }

                          iVar2 = *(int *)(param_3 + 0x37c0);

                          local_34 = iVar5 + 0x80;

                        }

                        iVar9 = iVar9 + 1;

                        iVar6 = local_30;

                        iVar5 = local_38;

                        iVar3 = local_34;

                      } while (iVar9 < iVar2);

                    }

                    FUN_00643250(param_3,param_1,param_2,iVar5,local_6c,local_4c,iVar6,

                                 *(undefined4 *)(param_3 + 0x78),*(undefined4 *)(param_3 + 0x7c),

                                 param_4,local_3c);

                    iVar6 = *(int *)(param_3 + 0x78);

                  }

                  else {

                    iVar9 = 0;

                    if (0 < iVar2) {

                      iVar3 = *(int *)(param_3 + 0x37cc);

                      local_50 = iVar6;

                      local_38 = iVar5;

                      do {

                        iVar6 = 0;

                        iVar8 = iVar9 * 0x10;

                        iVar5 = *(int *)(iVar8 + 8 + iVar3);

                        if (0 < iVar5) {

                          local_34 = iVar9 * 2;

                          iVar2 = *(int *)(iVar8 + 4 + iVar3);

                          local_30 = local_38 << 4;

                          local_54 = iVar9;

                          do {

                            iVar9 = 0;

                            if (0 < iVar2) {

                              local_5c = iVar6 << 7;

                              iVar10 = local_50;

                              local_64 = iVar8;

                              local_58 = iVar6;

                              while( true ) {

                                iVar8 = iVar9 * 0x10 +

                                        *(int *)(*(int *)(param_3 + 0x4ddc) + 4 + local_34 * 2) +

                                        iVar5 * local_78 * iVar10 * iVar2 +

                                        iVar10 * iVar2 * local_5c + iVar2 * local_30;

                                iVar6 = 0;

                                iVar5 = local_68;

                                local_60 = iVar9;

                                do {

                                  (*DAT_008f85a8)(iVar8,iVar5,0x10);

                                  iVar3 = *(int *)(param_3 + 0x37cc);

                                  iVar10 = *(int *)(param_3 + 0x78);

                                  iVar2 = *(int *)(local_64 + 4 + iVar3);

                                  iVar8 = iVar8 + iVar10 * 0x10 * iVar2;

                                  iVar5 = iVar5 + 0x10;

                                  iVar6 = iVar6 + 1;

                                } while (iVar6 < 8);

                                local_68 = iVar5;

                                iVar9 = local_60 + 1;

                                if (iVar2 <= iVar9) break;

                                iVar5 = *(int *)(local_64 + 8 + iVar3);

                              }

                              local_50 = iVar10;

                              iVar5 = *(int *)(local_64 + 8 + iVar3);

                              iVar6 = local_58;

                              iVar8 = local_64;

                            }

                            iVar6 = iVar6 + 1;

                          } while (iVar6 < iVar5);

                          iVar2 = *(int *)(param_3 + 0x37c0);

                          iVar9 = local_54;

                        }

                        iVar9 = iVar9 + 1;

                        iVar6 = local_50;

                        iVar5 = local_38;

                      } while (iVar9 < iVar2);

                    }

                  }

                }

              }

              else {

                iVar6 = *(int *)(param_3 + 0x78);

              }

            }

            else {

              iVar6 = *(int *)(param_3 + 0x78);

            }

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

              iVar6 = (iVar5 + 1) % iVar6;

              param_2[7] = iVar6;

              if (iVar6 == 0) {

                param_2[8] = local_6c + 1;

                if (local_6c + 1 == *(int *)(param_3 + 0x7c)) {

                  param_2[8] = 0;

                  return 0;

                }

              }

              else {

                param_2[8] = local_6c;

              }

              *(int *)(param_3 + 0xc) = iVar5 - local_18;

              *(int *)(param_3 + 0x10) = local_6c - local_48;

              *(int *)(param_3 + 4) = iVar5 - local_18;

              *(int *)(param_3 + 8) = local_6c - local_48;

              return 1;

            }

            iVar5 = iVar5 + 1;

          } while (iVar5 < iVar6);

          iVar2 = *(int *)(param_3 + 0x7c);

        }

        local_6c = local_6c + 1;

      } while (local_6c < iVar2);

      iVar5 = *(int *)(param_3 + 0x37c0);

    }

  }

  else {

    local_30 = (local_2c * 8) / *(int *)(param_2[0xd] + 4);

    local_34 = (local_34 * 8) / *(int *)(param_2[0xd] + 8);

    local_2c = (local_30 + -1 + *(int *)(param_3 + 0x4c)) / local_30;

    uVar7 = (int)*(uint *)(param_3 + 0x50) >> 0x1f;

    iVar6 = param_2[8];

    iVar2 = local_60;

    if (iVar6 < iVar2) {

      local_58 = local_4c << 7;

      local_5c = local_4c << 7;

      local_50 = (int)(local_34 + -1 + ((*(uint *)(param_3 + 0x50) ^ uVar7) - uVar7)) / local_34;

      do {

        if (*(int *)(param_3 + 0x37d8) <= iVar5) {

          piVar4 = (int *)param_2[0xd];

          iVar2 = piVar4[2];

          if (0 < iVar2) {

            local_68 = iVar6 << 3;

            iVar5 = 0;

            iVar9 = 0;

            local_54 = iVar6;

            do {

              if (*(int *)(param_3 + 0x50) <= iVar2 * local_68 + iVar5) {

                iVar5 = *(int *)(param_3 + 0x37c0);

                iVar6 = local_54;

                goto LAB_0064622b;

              }

              iVar6 = param_2[7];

              iVar3 = *(int *)(param_3 + 0x78);

              if (iVar6 < iVar3) {

                iVar2 = piVar4[1];

                local_74 = piVar4;

                local_6c = iVar5;

                local_64 = iVar9;

                do {

                  iVar5 = 0;

                  local_30 = *local_74;

                  iVar9 = (iVar3 * local_54 + iVar6) * local_58 + *(int *)(param_3 + 0x4de4);

                  if (0 < local_30) {

                    local_38 = *(int *)(param_3 + 0x37cc);

                    local_34 = 0;

                    iVar8 = 0;

                    do {

                      iVar5 = iVar5 + 1;

                      iVar9 = iVar9 + *(int *)(iVar8 + 4 + local_38) * 0x80 *

                                      *(int *)(iVar8 + 8 + local_38);

                      iVar8 = iVar8 + 0x10;

                      local_78 = iVar2;

                      local_70 = iVar3;

                      local_60 = iVar6;

                    } while (iVar5 < local_30);

                  }

                  iVar9 = iVar2 * 0x80 * local_64 + iVar9;

                  iVar5 = 0;

                  if (0 < iVar2) {

                    iVar3 = 0;

                    local_60 = iVar6;

                    do {

                      if (*(int *)(param_3 + 0x4c) <= iVar2 * 8 * local_60 + iVar3) {

                        iVar3 = *(int *)(param_3 + 0x78);

                        iVar6 = local_60;

                        goto LAB_006461fa;

                      }

                      if (param_2[4] == 0) {

                        FUN_00621180(param_1,iVar9,local_ac[0],param_2[2],param_2[3],param_2[5]);

                      }

                      else {

                        FUN_00621330(param_1,iVar9,local_ac[0],param_2[2],param_2[3],param_2[5]);

                      }

                      iVar9 = iVar9 + 0x80;

                      iVar6 = FUN_006448b0(param_1,param_2,local_2c,local_50,

                                           local_60 * *(int *)(param_2[0xd] + 4) + iVar5,

                                           local_54 * *(int *)(param_2[0xd] + 8) + local_64);

                      if (iVar6 != 0) {

                        return 0xffffffe7;

                      }

                      iVar3 = iVar3 + 8;

                      iVar5 = iVar5 + 1;

                      local_74 = (int *)param_2[0xd];

                      iVar2 = local_74[1];

                    } while (iVar5 < iVar2);

                    iVar3 = *(int *)(param_3 + 0x78);

                    iVar6 = local_60;

                  }

LAB_006461fa:

                  iVar6 = iVar6 + 1;

                } while (iVar6 < iVar3);

                iVar2 = local_74[2];

                piVar4 = local_74;

                iVar5 = local_6c;

                iVar9 = local_64;

              }

              iVar5 = iVar5 + 8;

              iVar9 = iVar9 + 1;

            } while (iVar9 < iVar2);

            iVar5 = *(int *)(param_3 + 0x37c0);

            iVar6 = local_54;

          }

        }

LAB_0064622b:

        if ((((iVar5 <= *(int *)(param_3 + 0x37d4)) && (iVar5 <= *(int *)(param_3 + 0x37d8))) &&

            (local_20 <= iVar6)) && (iVar6 < local_1c)) {

          if ((*(int **)(param_3 + 0x4ddc) == (int *)0x0) || (**(int **)(param_3 + 0x4ddc) != 0)) {

            iVar5 = param_2[7] - local_40;

            if (iVar5 < 1) {

              iVar5 = 0;

            }

            *(int *)(param_1 + 0x2c) =

                 ((iVar6 - local_20) * *(int *)(param_3 + 0x37bc) * *(int *)(param_3 + 0x3c) +

                 iVar5 * *(int *)(param_3 + 0x30) * *(int *)(param_3 + 0x37b8)) * local_28 +

                 *(int *)(param_3 + 0x20);

            iVar5 = local_40;

            if (local_40 < local_44) {

              do {

                iVar2 = *(int *)(param_3 + 0x4834);

                (*DAT_008f85a8)(iVar2,(iVar6 * *(int *)(param_3 + 0x78) + iVar5) * local_58 +

                                      *(int *)(param_3 + 0x4de4),local_5c);

                iVar3 = 0;

                iVar9 = *(int *)(param_3 + 0x37c0);

                iVar8 = iVar2;

                if (0 < iVar9) {

                  do {

                    local_30 = iVar8;

                    local_34 = iVar2;

                    local_38 = iVar5;

                    local_54 = iVar6;

                    iVar2 = iVar3 * 0x10 + *(int *)(param_3 + 0x37cc);

                    iVar8 = 0;

                    iVar10 = *(int *)(iVar2 + 4) * *(int *)(iVar2 + 8);

                    iVar5 = local_30;

                    iVar6 = iVar3 * 0x10;

                    if (0 < iVar10) {

                      while( true ) {

                        local_60 = iVar3;

                        local_64 = iVar6;

                        (**(code **)(local_24 + 0x110))

                                  (iVar5,*(undefined4 *)

                                          (*(int *)(iVar2 + 0xc) * 0xb4 + 0x9c + param_3));

                        iVar8 = iVar8 + 1;

                        iVar3 = local_60;

                        if (iVar10 <= iVar8) break;

                        iVar2 = *(int *)(param_3 + 0x37cc) + local_64;

                        iVar5 = iVar5 + 0x80;

                        iVar6 = local_64;

                      }

                      iVar9 = *(int *)(param_3 + 0x37c0);

                      local_30 = iVar5 + 0x80;

                    }

                    iVar3 = iVar3 + 1;

                    iVar5 = local_38;

                    iVar6 = local_54;

                    iVar2 = local_34;

                    iVar8 = local_30;

                  } while (iVar3 < iVar9);

                }

                FUN_00643250(param_3,param_1,param_2,iVar5,iVar6,local_4c,iVar2,

                             *(undefined4 *)(param_3 + 0x78),*(undefined4 *)(param_3 + 0x7c),param_4

                             ,local_3c);

                iVar5 = iVar5 + 1;

              } while (iVar5 < local_44);

            }

            if ((local_18 != 0) && (iVar5 == local_44)) {

              FUN_00643250(param_3,param_1,param_2,iVar5,iVar6,local_4c,

                           *(undefined4 *)(param_3 + 0x4834),*(undefined4 *)(param_3 + 0x78),

                           *(undefined4 *)(param_3 + 0x7c),param_4,local_3c);

            }

          }

          else if (local_40 < local_44) {

            local_64 = *(int *)(param_3 + 0x78);

            iVar2 = local_40;

            local_54 = iVar6;

            do {

              piVar4 = (int *)0x0;

              if (0 < iVar5) {

                iVar6 = *(int *)(param_3 + 0x37cc);

                local_6c = local_54 << 7;

                local_70 = iVar2 << 4;

                local_68 = (local_64 * local_54 + iVar2) * local_58 + *(int *)(param_3 + 0x4de4);

                local_60 = iVar2;

                do {

                  iVar9 = 0;

                  iVar3 = (int)piVar4 * 0x10;

                  iVar2 = *(int *)(iVar3 + 8 + iVar6);

                  if (0 < iVar2) {

                    local_78 = (int)piVar4 * 2;

                    iVar5 = *(int *)(iVar3 + 4 + iVar6);

                    local_74 = piVar4;

                    do {

                      iVar10 = 0;

                      iVar8 = local_64;

                      if (0 < iVar5) {

                        while( true ) {

                          local_30 = iVar3;

                          local_34 = iVar9;

                          iVar9 = 0;

                          iVar3 = iVar2 * local_6c * iVar8 * iVar5 +

                                  *(int *)(*(int *)(param_3 + 0x4ddc) + 4 + local_78 * 2) +

                                  local_70 * iVar5 + iVar5 * iVar8 * 0x80 * local_34 + iVar10 * 0x10

                          ;

                          iVar2 = local_68;

                          local_38 = iVar10;

                          do {

                            (*DAT_008f85a8)(iVar3,iVar2,0x10);

                            iVar6 = *(int *)(param_3 + 0x37cc);

                            iVar8 = *(int *)(param_3 + 0x78);

                            iVar5 = *(int *)(local_30 + 4 + iVar6);

                            iVar3 = iVar3 + iVar8 * 0x10 * iVar5;

                            iVar2 = iVar2 + 0x10;

                            iVar9 = iVar9 + 1;

                          } while (iVar9 < 8);

                          iVar10 = local_38 + 1;

                          iVar9 = local_34;

                          iVar3 = local_30;

                          local_68 = iVar2;

                          if (iVar5 <= iVar10) break;

                          iVar2 = *(int *)(local_30 + 8 + iVar6);

                        }

                        iVar2 = *(int *)(local_30 + 8 + iVar6);

                        local_64 = iVar8;

                      }

                      iVar9 = iVar9 + 1;

                    } while (iVar9 < iVar2);

                    iVar5 = *(int *)(param_3 + 0x37c0);

                    piVar4 = local_74;

                  }

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

                  iVar2 = local_60;

                } while ((int)piVar4 < iVar5);

              }

              iVar2 = iVar2 + 1;

              iVar6 = local_54;

            } while (iVar2 < local_44);

          }

        }

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

          param_2[8] = iVar6 + 1;

          param_2[7] = 0;

          if (iVar6 + 1 != local_48 + *(int *)(param_3 + 0x7c)) {

            iVar5 = *(int *)(param_3 + 0x78) + -1;

            *(int *)(param_3 + 0xc) = iVar5;

            *(int *)(param_3 + 0x10) = iVar6 - local_48;

            *(int *)(param_3 + 4) = iVar5;

            *(int *)(param_3 + 8) = iVar6 - local_48;

            return 1;

          }

          param_2[8] = 0;

          return 0;

        }

        iVar6 = iVar6 + 1;

        iVar2 = *(int *)(param_3 + 0x7c);

        if (*(int *)(param_3 + 0x7c) <= iVar6) break;

        iVar5 = *(int *)(param_3 + 0x37c0);

      } while( true );

    }

    local_60 = iVar2;

    if ((*(int **)(param_3 + 0x4ddc) == (int *)0x0) || (**(int **)(param_3 + 0x4ddc) != 0)) {

      if (local_48 == 0) {

        iVar5 = *(int *)(param_3 + 0x37c0);

      }

      else {

        iVar5 = local_60;

        iVar6 = local_40;

        if (local_40 <= local_44) {

          while( true ) {

            FUN_00643250(param_3,param_1,param_2,iVar6,iVar5,local_4c,

                         *(undefined4 *)(param_3 + 0x4834),*(undefined4 *)(param_3 + 0x78),iVar5,

                         param_4,local_3c);

            if (local_44 < iVar6 + 1) break;

            iVar5 = *(int *)(param_3 + 0x7c);

            iVar6 = iVar6 + 1;

          }

        }

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

          param_2[7] = 0;

          param_2[8] = 0;

          return 0;

        }

        iVar5 = *(int *)(param_3 + 0x37c0);

      }

    }

    else {

      iVar5 = *(int *)(param_3 + 0x37c0);

    }

  }

  if ((iVar5 <= *(int *)(param_3 + 0x37d4)) && (iVar5 <= *(int *)(param_3 + 0x37d8))) {

    return 2;

  }

  return 0;

}





// --- FUN_00647040 at 0x00647040 (size: 2809) ---


int FUN_00647040(int param_1,int *param_2,int param_3,undefined4 param_4)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  uint uVar5;

  int iVar6;

  int iVar7;

  undefined4 auStack_ac [4];

  undefined4 auStack_9c [4];

  undefined4 auStack_8c [4];

  int local_7c [4];

  short asStack_6c [2];

  short local_68 [2];

  int local_64;

  int local_60;

  int local_5c;

  int local_58;

  char local_54;

  int local_50;

  int iStack_4c;

  int local_48;

  int local_44;

  int local_40;

  int local_3c;

  int local_38;

  int local_34;

  int local_30;

  int local_2c;

  int local_28;

  int local_24;

  int local_20;

  int local_1c;

  int local_18;

  

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

  iVar3 = 0;

  iVar2 = *param_2;

  local_58 = 0;

  if (0 < iVar2) {

    iVar4 = param_2[0xd];

    iVar1 = 0;

    iVar6 = 0;

    do {

      auStack_ac[iVar3] = *(undefined4 *)(iVar1 + 0x10 + iVar4);

      auStack_9c[iVar3] = *(undefined4 *)(iVar1 + 0xc + iVar4);

      auStack_8c[iVar3] = *(undefined4 *)(*(int *)(iVar1 + 0x14 + iVar4) + 8);

      iVar7 = *(int *)(iVar1 + 4 + iVar4) * *(int *)(iVar1 + 8 + iVar4);

      iVar6 = iVar6 + iVar7;

      iVar1 = iVar1 + 0x18;

      local_7c[iVar3] = iVar7;

      iVar3 = iVar3 + 1;

    } while (iVar3 < iVar2);

    local_58 = iVar6;

  }

  iVar3 = *(int *)(param_3 + 0x37b8);

  if (iVar2 == 1) {

    iVar2 = (iVar3 * 8) / *(int *)(param_2[0xd] + 4);

    iVar1 = (*(int *)(param_3 + 0x37bc) * 8) / *(int *)(param_2[0xd] + 8);

    iVar2 = (*(int *)(param_3 + 0x4c) + -1 + iVar2) / iVar2;

    uVar5 = (int)*(uint *)(param_3 + 0x50) >> 0x1f;

    local_18 = (int)(((*(uint *)(param_3 + 0x50) ^ uVar5) - uVar5) + -1 + iVar1) / iVar1;

    local_58 = 1;

    local_7c[0] = 1;

  }

  else {

    iVar2 = *(int *)(param_3 + 0x78);

    local_18 = *(int *)(param_3 + 0x7c);

  }

  if ((iVar3 == 1) && (*(int *)(param_3 + 0x37bc) == 1)) {

    local_54 = '\0';

  }

  else {

    iVar1 = 0;

    local_54 = '\x01';

    if (0 < *(int *)(param_3 + 0x37c0)) {

      iVar4 = 0;

      local_54 = '\x01';

      do {

        local_64 = iVar2;

        local_60 = iVar3;

        if (local_54 == '\0') {

          goto LAB_00647177;

        }

        iVar6 = *(int *)(*(int *)(param_3 + 0x37cc) + 4 + iVar4);

        if (iVar6 != *(int *)(*(int *)(param_3 + 0x37cc) + 8 + iVar4)) {

          local_54 = '\0';

        }

        if ((iVar6 != 1) && (iVar6 != 2)) {

          local_54 = '\0';

        }

        iVar4 = iVar4 + 0x10;

        iVar1 = iVar1 + 1;

      } while (iVar1 < *(int *)(param_3 + 0x37c0));

    }

  }

LAB_00647177:

  if (((iVar3 == 2) && (*(int *)(param_3 + 0x37bc) < 3)) && (*(int *)(param_3 + 0x4de8) == 1)) {

    local_1c = 1;

  }

  else {

    local_1c = 0;

  }

  if (((iVar3 == 2) && (*(int *)(param_3 + 0x37bc) == 2)) && (*(int *)(param_3 + 0x4de8) == 1)) {

    local_28 = 1;

  }

  else {

    local_28 = 0;

  }

  iVar3 = param_2[8];

  if (iVar3 < local_18) {

    local_20 = iVar2 << 4;

    local_24 = iVar2 << 7;

    local_60 = iVar3;

    local_64 = iVar2;

    do {

      iVar2 = param_2[7];

      if (iVar2 < local_64) {

        do {

          iVar1 = 0;

          local_5c = *(int *)(param_3 + 0x4834);

          iVar3 = *param_2;

          if (0 < iVar3) {

            local_2c = iVar2 << 4;

            local_30 = iVar2;

            do {

              if ((*(int **)(param_3 + 0x4ddc) == (int *)0x0) || (**(int **)(param_3 + 0x4ddc) != 0)

                 ) {

                iVar4 = 0;

                iVar2 = local_5c;

                if (0 < local_7c[iVar1]) {

                  do {

                    asStack_6c[0] = (short)param_2[iVar1 + 9];

                    iVar3 = (**(code **)(local_50 + 0xf4))

                                      (param_1,auStack_9c[iVar1],auStack_ac[iVar1],asStack_6c,iVar2)

                    ;

                    param_2[iVar1 + 9] = (int)asStack_6c[0];

                    if (iVar3 < 0) {

                      return iVar3;

                    }

                    (**(code **)(local_50 + 0x110))(iVar2,auStack_8c[iVar1]);

                    iVar2 = iVar2 + 0x80;

                    iVar4 = iVar4 + 1;

                  } while (iVar4 < local_7c[iVar1]);

                  local_5c = iVar2;

                  iVar3 = *param_2;

                }

              }

              else {

                local_38 = 0;

                iVar4 = iVar1 * 0x18;

                iVar2 = *(int *)(iVar4 + 8 + param_2[0xd]);

                if (0 < iVar2) {

                  iVar6 = *(int *)(iVar4 + 4 + param_2[0xd]);

                  iVar3 = 0;

                  local_44 = iVar1 * 2;

                  local_48 = iVar1;

                  do {

                    if (0 < iVar6) {

                      local_38 = iVar3;

                      local_3c = 0;

                      local_40 = 0;

                      local_34 = iVar4;

                      do {

                        local_68[0] = (short)*(undefined4 *)((int)param_2 + local_44 * 2 + 0x24);

                        iVar2 = (**(code **)(local_50 + 0xf4))

                                          (param_1,auStack_9c[local_48],auStack_ac[local_48],

                                           local_68,local_5c);

                        *(int *)((int)param_2 + local_44 * 2 + 0x24) = (int)local_68[0];

                        if (iVar2 < 0) {

                          return iVar2;

                        }

                        iVar2 = *(int *)(local_34 + 4 + param_2[0xd]);

                        iVar3 = 0;

                        iVar1 = iVar2 * local_2c +

                                *(int *)(*(int *)(param_3 + 0x4ddc) + 4 + local_44 * 2) +

                                (local_60 * *(int *)(local_34 + 8 + param_2[0xd]) + local_38) *

                                iVar2 * local_24 + local_3c;

                        iVar2 = local_5c;

                        do {

                          (*DAT_008f85a8)(iVar1,iVar2,0x10);

                          iVar4 = param_2[0xd];

                          iVar6 = *(int *)(local_34 + 4 + iVar4);

                          iVar1 = iVar1 + local_20 * iVar6;

                          iVar2 = iVar2 + 0x10;

                          iVar3 = iVar3 + 1;

                        } while (iVar3 < 8);

                        iStack_4c = iVar4;

                        local_40 = local_40 + 1;

                        local_5c = iVar2;

                        local_3c = local_3c + 0x10;

                      } while (local_40 < iVar6);

                      iVar2 = *(int *)(local_34 + 8 + iVar4);

                      iVar3 = local_38;

                      iVar4 = local_34;

                    }

                    iVar3 = iVar3 + 1;

                  } while (iVar3 < iVar2);

                  iVar3 = *param_2;

                  iVar1 = local_48;

                }

              }

              iVar1 = iVar1 + 1;

              iVar2 = local_30;

            } while (iVar1 < iVar3);

          }

          iVar3 = FUN_006448b0(param_1,param_2,local_64,local_18,iVar2,local_60);

          if (iVar3 != 0) {

            return iVar3;

          }

          if ((*(int **)(param_3 + 0x4ddc) == (int *)0x0) || (**(int **)(param_3 + 0x4ddc) != 0)) {

            FUN_00643250(param_3,param_1,param_2,iVar2,local_60,local_58,

                         *(undefined4 *)(param_3 + 0x4834),local_64,local_18,param_4,local_54);

          }

          if (((*(int *)(param_3 + 0x1c) != 0) && ((local_1c == 0 || (iVar2 != 0)))) &&

             ((local_28 == 0 || (local_60 != 0)))) {

            iVar3 = (iVar2 + 1) % (local_64 + local_1c);

            param_2[7] = iVar3;

            if (iVar3 == 0) {

              if (local_60 + 1 == local_18 + local_28) {

                param_2[8] = 0;

                return 0;

              }

              param_2[8] = local_60 + 1;

            }

            else {

              param_2[8] = local_60;

            }

            *(int *)(param_3 + 0xc) = iVar2 - local_1c;

            *(int *)(param_3 + 0x10) = local_60 - local_28;

            *(int *)(param_3 + 4) = iVar2 - local_1c;

            *(int *)(param_3 + 8) = local_60 - local_28;

            return 1;

          }

          iVar2 = iVar2 + 1;

        } while (iVar2 < local_64);

      }

      if ((local_1c != 0) &&

         (((*(int **)(param_3 + 0x4ddc) == (int *)0x0 || (**(int **)(param_3 + 0x4ddc) != 0)) &&

          (FUN_00643250(param_3,param_1,param_2,iVar2,local_60,local_58,

                        *(undefined4 *)(param_3 + 0x4834),local_64,local_18,param_4,local_54),

          *(int *)(param_3 + 0x1c) != 0)))) {

        iVar3 = (iVar2 + 1) % (local_64 + local_1c);

        param_2[7] = iVar3;

        if (iVar3 == 0) {

          if (local_60 + 1 == local_18 + local_28) {

            param_2[8] = 0;

            return 0;

          }

          param_2[8] = local_60 + 1;

        }

        else {

          param_2[8] = local_60;

        }

        *(int *)(param_3 + 0xc) = iVar2 - local_1c;

        *(int *)(param_3 + 0x10) = local_60 - local_28;

        *(int *)(param_3 + 4) = iVar2 - local_1c;

        *(int *)(param_3 + 8) = local_60 - local_28;

        return 1;

      }

      iVar3 = local_60 + 1;

      local_60 = iVar3;

      iVar2 = local_64;

    } while (iVar3 < local_18);

  }

  if (local_28 != 0) {

    iVar1 = param_2[7];

    local_5c = iVar1;

    iVar4 = local_18;

    for (; local_18 = iVar4, iVar1 < iVar2; iVar1 = iVar1 + 1) {

      local_60 = iVar3;

      FUN_00643250(param_3,param_1,param_2,iVar1,iVar3,local_58,*(undefined4 *)(param_3 + 0x4834),

                   iVar2,iVar4,param_4,local_54);

      if (((*(int *)(param_3 + 0x1c) != 0) && ((local_1c == 0 || (iVar1 != 0)))) &&

         ((local_28 == 0 || (local_60 != 0)))) {

        iVar2 = (iVar1 + 1) % (iVar2 + local_1c);

        param_2[7] = iVar2;

        if (iVar2 == 0) {

          if (local_60 + 1 == local_18 + local_28) {

            param_2[8] = 0;

            return 0;

          }

          param_2[8] = local_60 + 1;

        }

        else {

          param_2[8] = local_60;

        }

        *(int *)(param_3 + 0xc) = iVar1 - local_1c;

        *(int *)(param_3 + 0x10) = local_60 - local_28;

        *(int *)(param_3 + 4) = iVar1 - local_1c;

        *(int *)(param_3 + 8) = local_60 - local_28;

        return 1;

      }

      iVar3 = local_60;

      iVar4 = local_18;

    }

    if ((local_1c != 0) &&

       (local_5c = iVar1,

       FUN_00643250(param_3,param_1,param_2,iVar1,iVar3,local_58,*(undefined4 *)(param_3 + 0x4834),

                    iVar2,iVar4,param_4,local_54), *(int *)(param_3 + 0x1c) != 0)) {

      iVar2 = (local_5c + 1) % (iVar2 + local_1c);

      param_2[7] = iVar2;

      if (iVar2 == 0) {

        if (iVar3 + 1 == iVar4 + local_28) {

          param_2[8] = 0;

          return 0;

        }

        param_2[8] = iVar3 + 1;

      }

      else {

        param_2[8] = iVar3;

      }

      *(int *)(param_3 + 0xc) = local_5c - local_1c;

      *(int *)(param_3 + 0x10) = iVar3 - local_28;

      *(int *)(param_3 + 4) = local_5c - local_1c;

      *(int *)(param_3 + 8) = iVar3 - local_28;

      return 1;

    }

  }

  return 0;

}





// --- FUN_00647b40 at 0x00647B40 (size: 5173) ---


int FUN_00647b40(int param_1,int *param_2,int param_3,int param_4)



{

  int iVar1;

  int iVar2;

  int iVar3;

  uint uVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  undefined4 auStack_dc [4];

  undefined4 auStack_cc [4];

  undefined4 auStack_bc [4];

  int local_ac [4];

  short local_9c [2];

  short local_98 [2];

  short asStack_94 [2];

  short asStack_90 [2];

  short asStack_8c [2];

  short asStack_88 [2];

  short asStack_84 [2];

  int local_80;

  int local_7c;

  int local_78;

  int local_74;

  int local_70;

  int local_6c;

  int local_68;

  int iStack_64;

  int iStack_60;

  int local_5c;

  int local_58;

  int local_54;

  int local_50;

  int local_4c;

  char local_48;

  int iStack_44;

  int iStack_40;

  int iStack_3c;

  int iStack_38;

  int iStack_34;

  int local_30;

  int local_2c;

  int local_28;

  int local_24;

  int local_20;

  int local_1c;

  int local_18;

  int local_14;

  

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

  iVar7 = *param_2;

  local_18 = 0;

  if (iVar7 < 1) {

    local_2c = *(int *)(param_3 + 0x74);

  }

  else {

    local_2c = *(int *)(param_3 + 0x74);

    iVar1 = 0;

    iVar5 = 0;

    iVar2 = 0;

    do {

      if ((*(int *)(param_3 + 0x37e0) == 0) && (local_2c != 1)) {

        param_2[iVar2 + 9] = 0;

        iVar7 = *param_2;

        local_2c = *(int *)(param_3 + 0x74);

      }

      iVar6 = param_2[0xd];

      auStack_dc[iVar2] = *(undefined4 *)(iVar1 + 0x10 + iVar6);

      iVar3 = iVar2 + 1;

      auStack_cc[iVar2] = *(undefined4 *)(iVar1 + 0xc + iVar6);

      auStack_bc[iVar2] = *(undefined4 *)(*(int *)(iVar1 + 0x14 + iVar6) + 8);

      iVar6 = *(int *)(iVar1 + 4 + iVar6) * *(int *)(iVar1 + 8 + iVar6);

      iVar5 = iVar5 + iVar6;

      iVar1 = iVar1 + 0x18;

      local_ac[iVar2] = iVar6;

      iVar2 = iVar3;

    } while (iVar3 < iVar7);

    local_18 = iVar5;

  }

  local_54 = *(int *)(param_3 + 0x37b8);

  iVar1 = *(int *)(param_3 + 0x37bc);

  if (iVar7 == 1) {

    local_24 = (local_54 * 8) / *(int *)(param_2[0xd] + 4);

    local_50 = (iVar1 * 8) / *(int *)(param_2[0xd] + 8);

    local_1c = *(int *)(param_3 + 0x3c) * local_50;

    local_6c = (*(int *)(param_3 + 0x4c) + -1 + local_24) / local_24;

    uVar4 = (int)*(uint *)(param_3 + 0x50) >> 0x1f;

    local_20 = (int)(((*(uint *)(param_3 + 0x50) ^ uVar4) - uVar4) + -1 + local_50) / local_50;

    local_18 = 1;

    local_ac[0] = 1;

  }

  else {

    local_24 = local_54 * 8;

    local_50 = iVar1 * 8;

    local_1c = *(int *)(param_3 + 0x3c) * local_50;

    local_6c = *(int *)(param_3 + 0x78);

    local_20 = *(int *)(param_3 + 0x7c);

  }

  if ((local_54 == 1) && (iVar1 == 1)) {

    local_48 = '\0';

  }

  else {

    iVar7 = 0;

    local_48 = '\x01';

    if (0 < *(int *)(param_3 + 0x37c0)) {

      iVar5 = 0;

      local_48 = '\x01';

      do {

        local_80 = local_50;

        local_7c = local_24;

        if (local_48 == '\0') {

          goto LAB_00647cf3;

        }

        iVar2 = *(int *)(*(int *)(param_3 + 0x37cc) + 4 + iVar5);

        if (iVar2 != *(int *)(*(int *)(param_3 + 0x37cc) + 8 + iVar5)) {

          local_48 = '\0';

        }

        if ((iVar2 != 1) && (iVar2 != 2)) {

          local_48 = '\0';

        }

        iVar5 = iVar5 + 0x10;

        iVar7 = iVar7 + 1;

      } while (iVar7 < *(int *)(param_3 + 0x37c0));

    }

  }

LAB_00647cf3:

  local_24 = local_24 / param_4;

  local_28 = *(int *)(param_3 + 4) / local_24;

  iVar7 = (local_24 + -1 + *(int *)(param_3 + 0xc)) / local_24;

  local_50 = local_50 / param_4;

  iVar5 = *(int *)(param_3 + 8) / local_50;

  local_50 = (local_50 + -1 + *(int *)(param_3 + 0x10)) / local_50;

  if ((*(int *)(param_3 + 0x4de8) == 1) && (local_54 == 2)) {

    local_58 = 1;

  }

  else {

    local_58 = 0;

  }

  if ((*(int *)(param_3 + 0x4de8) == 1) && (iVar1 == 2)) {

    local_4c = 1;

  }

  else {

    local_4c = 0;

  }

  if (local_28 != 0) {

    local_28 = local_28 - local_58;

  }

  if (iVar5 != 0) {

    iVar5 = iVar5 - local_4c;

  }

  if (iVar7 < local_6c) {

    iVar7 = iVar7 + local_58;

  }

  if (local_50 < local_20) {

    local_50 = local_50 + local_4c;

  }

  iVar1 = param_2[8];

  if (param_2[8] <= iVar5) {

    iVar1 = iVar5;

  }

  if ((local_2c == 1) && (*(int *)(param_1 + 0x38) != 0)) {

    if ((param_2[7] == 0) && (iVar2 = 0, 0 < iVar1)) {

      local_80 = *(int *)(param_3 + 0x4834);

      local_74 = iVar5;

      local_70 = iVar7;

      iVar7 = local_6c;

      do {

        iVar5 = 0;

        if (0 < iVar7) {

          local_7c = iVar2;

          local_78 = iVar1;

          do {

            iVar2 = local_80;

            iVar1 = *param_2;

            if (0 < iVar1) {

              local_68 = iVar5;

              local_6c = iVar7;

              iVar6 = 0;

              do {

                iVar7 = 0;

                if (0 < local_ac[iVar6]) {

                  iVar1 = param_2[iVar6 + 9];

                  do {

                    local_98[0] = (short)iVar1;

                    iVar5 = (**(code **)(local_14 + 0xf8))

                                      (param_1,auStack_cc[iVar6],auStack_dc[iVar6],local_98,iVar2);

                    iVar1 = (int)local_98[0];

                    param_2[iVar6 + 9] = iVar1;

                    if (iVar5 < 0) {

                      return -0x15;

                    }

                    iVar7 = iVar7 + 1;

                  } while (iVar7 < local_ac[iVar6]);

                  iVar1 = *param_2;

                }

                iVar6 = iVar6 + 1;

                iVar7 = local_6c;

                iVar5 = local_68;

              } while (iVar6 < iVar1);

            }

            iVar1 = FUN_006448b0(param_1,param_2,iVar7,local_20,iVar5,local_7c);

            if (iVar1 != 0) {

              return -0x19;

            }

            iVar5 = iVar5 + 1;

            iVar1 = local_78;

            iVar2 = local_7c;

          } while (iVar5 < iVar7);

        }

        iVar2 = iVar2 + 1;

      } while (iVar2 < iVar1);

      local_6c = iVar7;

      iVar7 = local_70;

      iVar5 = local_74;

    }

  }

  else if (param_2[7] == 0) {

    local_5c = *(int *)(param_3 + 0x4830);

    if (*(int *)(local_5c + iVar1 * 0x28) == -1) {

      iVar2 = iVar1 * 0x28;

      local_54 = iVar1;

      do {

        iVar2 = iVar2 + -0x28;

        local_54 = local_54 + -1;

      } while (*(int *)(local_5c + iVar2) == -1);

      iVar2 = FUN_006446e0(local_54,param_1,param_2,param_3);

      if (iVar2 != 0) {

        return iVar2;

      }

      if (local_54 < iVar1) {

        local_30 = *(int *)(param_3 + 0x4834);

        local_78 = iVar1;

        local_74 = iVar5;

        local_70 = iVar7;

        iVar7 = local_6c;

        do {

          if (0 < iVar7) {

            iVar1 = 0;

            do {

              iVar2 = local_30;

              iVar5 = *param_2;

              if (0 < iVar5) {

                local_2c = iVar1;

                iVar6 = 0;

                local_6c = iVar7;

                do {

                  if (0 < local_ac[iVar6]) {

                    iVar7 = param_2[iVar6 + 9];

                    iVar1 = 0;

                    do {

                      local_9c[0] = (short)iVar7;

                      iVar5 = (**(code **)(local_14 + 0xf8))

                                        (param_1,auStack_cc[iVar6],auStack_dc[iVar6],local_9c,iVar2)

                      ;

                      iVar7 = (int)local_9c[0];

                      param_2[iVar6 + 9] = iVar7;

                      if (iVar5 < 0) {

                        return -0x15;

                      }

                      iVar1 = iVar1 + 1;

                    } while (iVar1 < local_ac[iVar6]);

                    iVar5 = *param_2;

                  }

                  iVar6 = iVar6 + 1;

                  iVar1 = local_2c;

                  iVar7 = local_6c;

                } while (iVar6 < iVar5);

              }

              iVar5 = FUN_006448b0(param_1,param_2,iVar7,local_20,iVar1,local_54);

              if (iVar5 != 0) {

                return -0x19;

              }

              iVar1 = iVar1 + 1;

            } while (iVar1 < iVar7);

          }

          local_54 = local_54 + 1;

          FUN_006447f0(local_54,param_1,param_2,param_3);

        } while (local_54 < local_78);

        local_6c = iVar7;

        iVar1 = local_78;

        iVar7 = local_70;

        iVar5 = local_74;

      }

    }

    else {

      iVar2 = FUN_006446e0(iVar1,param_1,param_2,param_3);

      if (iVar2 != 0) {

        return iVar2;

      }

    }

  }

  if (iVar1 < local_50) {

    local_54 = local_58 + iVar7;

    local_68 = local_6c << 4;

    local_7c = local_6c << 7;

    local_80 = local_58 + -1 + iVar7;

    local_78 = iVar1;

    local_74 = iVar5;

    local_70 = iVar7;

    do {

      iVar7 = param_2[7];

      if (iVar7 < local_28) {

        local_30 = *(int *)(param_3 + 0x4834);

        iVar1 = local_6c;

        do {

          iVar2 = local_30;

          iVar5 = *param_2;

          if (0 < iVar5) {

            local_2c = iVar7;

            iVar6 = 0;

            do {

              if (0 < local_ac[iVar6]) {

                iVar7 = param_2[iVar6 + 9];

                iVar1 = 0;

                do {

                  asStack_94[0] = (short)iVar7;

                  iVar5 = (**(code **)(local_14 + 0xf8))

                                    (param_1,auStack_cc[iVar6],auStack_dc[iVar6],asStack_94,iVar2);

                  iVar7 = (int)asStack_94[0];

                  param_2[iVar6 + 9] = iVar7;

                  if (iVar5 < 0) {

                    return -0x15;

                  }

                  iVar1 = iVar1 + 1;

                } while (iVar1 < local_ac[iVar6]);

                iVar5 = *param_2;

              }

              iVar6 = iVar6 + 1;

              iVar1 = local_6c;

              iVar7 = local_2c;

            } while (iVar6 < iVar5);

          }

          iVar5 = FUN_006448b0(param_1,param_2,iVar1,local_20,iVar7,local_78);

          if (iVar5 != 0) {

            return -0x19;

          }

          iVar7 = iVar7 + 1;

        } while (iVar7 < local_28);

        iVar7 = param_2[7];

      }

      if (*(int *)(param_3 + 0x4ddc) == 0) {

        iVar7 = iVar7 - local_28;

        if (iVar7 < 1) {

          iVar7 = 0;

        }

        *(int *)(param_1 + 0x2c) =

             (local_78 - local_74) * (local_1c / param_4) + *(int *)(param_3 + 0x20) +

             iVar7 * *(int *)(param_3 + 0x30) * local_24;

        iVar7 = param_2[7];

      }

      if (iVar7 <= local_28) {

        iVar7 = local_28;

      }

      if (iVar7 < local_70) {

        do {

          iVar5 = 0;

          local_5c = *(int *)(param_3 + 0x4834);

          iVar1 = *param_2;

          if (0 < iVar1) {

            local_2c = iVar7;

            local_30 = iVar7 << 4;

            do {

              if ((*(int **)(param_3 + 0x4ddc) == (int *)0x0) || (**(int **)(param_3 + 0x4ddc) != 0)

                 ) {

                iVar7 = 0;

                if (0 < local_ac[iVar5]) {

                  iStack_34 = iVar5 * 2;

                  iVar1 = local_5c;

                  do {

                    asStack_90[0] = (short)*(undefined4 *)((int)param_2 + iStack_34 * 2 + 0x24);

                    iVar2 = (**(code **)(local_14 + 0xf4))

                                      (param_1,auStack_cc[iVar5],auStack_dc[iVar5],asStack_90,iVar1)

                    ;

                    *(int *)((int)param_2 + iStack_34 * 2 + 0x24) = (int)asStack_90[0];

                    (**(code **)(local_14 + 0x110))(iVar1,auStack_bc[iVar5]);

                    if (iVar2 < 0) {

                      return -0x15;

                    }

                    iVar1 = iVar1 + 0x80;

                    iVar7 = iVar7 + 1;

                  } while (iVar7 < local_ac[iVar5]);

                  local_5c = iVar1;

                  iVar1 = *param_2;

                }

              }

              else {

                iStack_38 = 0;

                iVar2 = iVar5 * 0x18;

                iVar7 = *(int *)(iVar2 + 8 + param_2[0xd]);

                if (0 < iVar7) {

                  iVar6 = *(int *)(iVar2 + 4 + param_2[0xd]);

                  iVar1 = 0;

                  iStack_44 = iVar5 * 2;

                  iStack_64 = iVar5;

                  do {

                    if (0 < iVar6) {

                      iStack_38 = iVar1;

                      iStack_3c = 0;

                      iStack_40 = 0;

                      iStack_34 = iVar2;

                      do {

                        asStack_8c[0] = (short)*(undefined4 *)((int)param_2 + iStack_44 * 2 + 0x24);

                        iVar7 = (**(code **)(local_14 + 0xf4))

                                          (param_1,auStack_cc[iStack_64],auStack_dc[iStack_64],

                                           asStack_8c,local_5c);

                        *(int *)((int)param_2 + iStack_44 * 2 + 0x24) = (int)asStack_8c[0];

                        if (iVar7 < 0) {

                          return -0x15;

                        }

                        iVar7 = *(int *)(iStack_34 + 4 + param_2[0xd]);

                        iVar1 = 0;

                        iVar5 = iVar7 * local_30 +

                                *(int *)(*(int *)(param_3 + 0x4ddc) + 4 + iStack_44 * 2) +

                                (local_78 * *(int *)(iStack_34 + 8 + param_2[0xd]) + iStack_38) *

                                iVar7 * local_7c + iStack_3c;

                        iVar7 = local_5c;

                        do {

                          (*DAT_008f85a8)(iVar5,iVar7,0x10);

                          iVar2 = param_2[0xd];

                          iVar6 = *(int *)(iStack_34 + 4 + iVar2);

                          iVar5 = iVar5 + local_68 * iVar6;

                          iVar7 = iVar7 + 0x10;

                          iVar1 = iVar1 + 1;

                        } while (iVar1 < 8);

                        iStack_60 = iVar2;

                        iStack_40 = iStack_40 + 1;

                        local_5c = iVar7;

                        iStack_3c = iStack_3c + 0x10;

                      } while (iStack_40 < iVar6);

                      iVar7 = *(int *)(iStack_34 + 8 + iVar2);

                      iVar2 = iStack_34;

                      iVar1 = iStack_38;

                    }

                    iVar1 = iVar1 + 1;

                  } while (iVar1 < iVar7);

                  iVar1 = *param_2;

                  iVar5 = iStack_64;

                }

              }

              iVar5 = iVar5 + 1;

              iVar7 = local_2c;

            } while (iVar5 < iVar1);

          }

          iVar1 = FUN_006448b0(param_1,param_2,local_6c,local_20,iVar7,local_78);

          if (iVar1 != 0) {

            return -0x19;

          }

          if ((*(int **)(param_3 + 0x4ddc) == (int *)0x0) || (**(int **)(param_3 + 0x4ddc) != 0)) {

            FUN_00643250(param_3,param_1,param_2,iVar7,local_78,local_18,

                         *(undefined4 *)(param_3 + 0x4834),local_6c,local_20,param_4,local_48);

          }

          if ((((*(int *)(param_3 + 0x1c) != 0) && (*(int *)(param_3 + 0x74) != 1)) &&

              ((local_58 == 0 || (iVar7 != local_28)))) &&

             ((local_4c == 0 || (local_78 != local_74)))) {

            if (iVar7 != local_80) {

              param_2[7] = (iVar7 + 1) % local_54;

              param_2[8] = local_78;

              *(int *)(param_3 + 0xc) = iVar7 - local_58;

              *(int *)(param_3 + 0x10) = local_78 - local_4c;

              *(int *)(param_3 + 4) = iVar7 - local_58;

              *(int *)(param_3 + 8) = local_78 - local_4c;

              return 1;

            }

            param_2[7] = 0;

            param_2[8] = 0;

          }

          iVar7 = iVar7 + 1;

        } while (iVar7 < local_70);

      }

      if (((local_58 != 0) &&

          (FUN_00643250(param_3,param_1,param_2,iVar7,local_78,local_18,

                        *(undefined4 *)(param_3 + 0x4834),local_20,local_20,param_4,local_48),

          *(int *)(param_3 + 0x1c) != 0)) && (*(int *)(param_3 + 0x74) != 1)) {

        param_2[7] = 0;

        param_2[8] = 0;

      }

      iVar1 = local_78 + 1;

      if (iVar1 < local_20) {

        if ((*(int *)(param_3 + 0x74) == 1) && (*(int *)(param_1 + 0x38) != 0)) {

          if (local_70 < local_6c) {

            local_30 = *(int *)(param_3 + 0x4834);

            iStack_60 = iVar1;

            iVar7 = local_6c;

            iVar1 = local_70;

            do {

              iVar2 = local_30;

              iVar5 = *param_2;

              if (0 < iVar5) {

                local_2c = iVar1;

                iVar6 = 0;

                local_6c = iVar7;

                do {

                  if (0 < local_ac[iVar6]) {

                    iVar7 = param_2[iVar6 + 9];

                    iVar1 = 0;

                    do {

                      asStack_84[0] = (short)iVar7;

                      iVar5 = (**(code **)(local_14 + 0xf8))

                                        (param_1,auStack_cc[iVar6],auStack_dc[iVar6],asStack_84,

                                         iVar2);

                      iVar7 = (int)asStack_84[0];

                      param_2[iVar6 + 9] = iVar7;

                      if (iVar5 < 0) {

                        return -0x15;

                      }

                      iVar1 = iVar1 + 1;

                    } while (iVar1 < local_ac[iVar6]);

                    iVar5 = *param_2;

                  }

                  iVar6 = iVar6 + 1;

                  iVar7 = local_6c;

                  iVar1 = local_2c;

                } while (iVar6 < iVar5);

              }

              iVar5 = FUN_006448b0(param_1,param_2,iVar7,local_20,iVar1,local_78);

              if (iVar5 != 0) {

                return -0x19;

              }

              iVar1 = iVar1 + 1;

            } while (iVar1 < iVar7);

            local_6c = iVar7;

            iVar1 = iStack_60;

          }

        }

        else if (*(int *)(*(int *)(param_3 + 0x4830) + 0x28 + local_78 * 0x28) == -1) {

          if (local_70 < local_6c) {

            iStack_64 = *(int *)(param_3 + 0x4834);

            iStack_60 = iVar1;

            iVar7 = local_6c;

            iVar5 = local_70;

            do {

              iVar2 = iStack_64;

              iVar1 = *param_2;

              if (0 < iVar1) {

                local_5c = iVar5;

                iVar6 = 0;

                do {

                  iVar7 = 0;

                  if (0 < local_ac[iVar6]) {

                    iVar1 = param_2[iVar6 + 9];

                    do {

                      asStack_88[0] = (short)iVar1;

                      iVar5 = (**(code **)(local_14 + 0xf8))

                                        (param_1,auStack_cc[iVar6],auStack_dc[iVar6],asStack_88,

                                         iVar2);

                      iVar1 = (int)asStack_88[0];

                      param_2[iVar6 + 9] = iVar1;

                      if (iVar5 < 0) {

                        return -0x15;

                      }

                      iVar7 = iVar7 + 1;

                    } while (iVar7 < local_ac[iVar6]);

                    iVar1 = *param_2;

                  }

                  iVar6 = iVar6 + 1;

                  iVar7 = local_6c;

                  iVar5 = local_5c;

                } while (iVar6 < iVar1);

              }

              iVar1 = FUN_006448b0(param_1,param_2,iVar7,local_20,iVar5,local_78);

              if (iVar1 != 0) {

                return -0x19;

              }

              iVar5 = iVar5 + 1;

              iVar1 = iStack_60;

            } while (iVar5 < iVar7);

          }

          FUN_006447f0(iVar1,param_1,param_2,param_3);

        }

        else {

          iVar7 = FUN_006446e0(iVar1,param_1,param_2,param_3);

          if (iVar7 != 0) {

            return iVar7;

          }

        }

      }

      local_78 = iVar1;

      iVar7 = local_70;

    } while (iVar1 < local_50);

  }

  iVar5 = local_6c;

  if ((local_4c != 0) && (local_58 = local_58 + iVar7, iVar7 = local_28, local_28 < local_58)) {

    do {

      local_78 = iVar1;

      FUN_00643250(param_3,param_1,param_2,iVar7,local_78,local_18,*(undefined4 *)(param_3 + 0x4834)

                   ,iVar5,local_20,param_4,local_48);

      iVar7 = iVar7 + 1;

      iVar1 = local_78;

    } while (iVar7 < local_58);

  }

  (**(code **)(local_14 + 0x18))();

  if ((*(int *)(param_3 + 0x37d8) < *(int *)(param_3 + 0x37c0)) && (*(int *)(param_3 + 0x74) == 1))

  {

    return 0;

  }

  return 2;

}





// --- FUN_00648fe0 at 0x00648FE0 (size: 1341) ---


int FUN_00648fe0(undefined4 *param_1,int param_2,undefined4 param_3,int *param_4)



{

  int iVar1;

  int iVar2;

  undefined4 *puVar3;

  int iVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  int local_14;

  

  iVar1 = *(int *)(param_2 + 8);

  *param_1 = 0;

  if (param_4[5] == 0) {

    *(undefined4 *)(iVar1 + 0x48) = *(undefined4 *)(iVar1 + 0x24);

    *(undefined4 *)(iVar1 + 0x4c) = *(undefined4 *)(iVar1 + 0x28);

    *(undefined4 *)(iVar1 + 0x50) = *(undefined4 *)(iVar1 + 0x2c);

    *(undefined4 *)(iVar1 + 0x54) = *(undefined4 *)(iVar1 + 0x30);

    *(undefined4 *)(iVar1 + 0x110) = *(undefined4 *)(iVar1 + 0x108);

  }

  else if (param_4[5] == 1) {

    *(undefined4 *)(iVar1 + 0x48) = *(undefined4 *)(iVar1 + 0x34);

    *(undefined4 *)(iVar1 + 0x4c) = *(undefined4 *)(iVar1 + 0x38);

    *(undefined4 *)(iVar1 + 0x50) = *(undefined4 *)(iVar1 + 0x3c);

    *(undefined4 *)(iVar1 + 0x54) = *(undefined4 *)(iVar1 + 0x40);

    *(undefined4 *)(iVar1 + 0x110) = *(undefined4 *)(iVar1 + 0x10c);

  }

  else {

    *(undefined4 *)(iVar1 + 0x48) = *(undefined4 *)(iVar1 + 0x24);

    *(undefined4 *)(iVar1 + 0x4c) = *(undefined4 *)(iVar1 + 0x28);

    *(undefined4 *)(iVar1 + 0x50) = *(undefined4 *)(iVar1 + 0x2c);

    *(undefined4 *)(iVar1 + 0x54) = *(undefined4 *)(iVar1 + 0x30);

    *(undefined4 *)(iVar1 + 0x110) = *(undefined4 *)(iVar1 + 0x108);

  }

  iVar2 = param_4[3];

  iVar6 = param_4[0x13];

  if ((iVar2 < iVar6) && (iVar2 != 0)) {

    local_14 = param_4[4];

    iVar5 = param_4[0x14];

    iVar7 = param_4[2];

    iVar4 = param_4[1];

  }

  else {

    local_14 = param_4[4];

    iVar5 = param_4[0x14];

    if ((local_14 < iVar5) && (local_14 != 0)) {

      iVar7 = param_4[2];

      iVar4 = param_4[1];

    }

    else {

      iVar7 = param_4[2];

      if (iVar7 < 1) {

        iVar4 = param_4[1];

        if (iVar4 < 1) {

          iVar2 = *param_4;

          if ((iVar2 == 0x12) || (iVar2 == 0x13)) {

            if (param_4[0x1378] == 0) {

              iVar2 = FUN_00647040(param_2,param_3,param_4,8);

            }

            else {

              iVar2 = FUN_00644930(param_2,param_3,param_4,8);

            }

          }

          else if ((iVar2 == 0x10) || (iVar2 == 0x11)) {

            if (param_4[0x1378] == 0) {

              iVar2 = FUN_00647040(param_2,param_3,param_4,4);

            }

            else {

              iVar2 = FUN_00644930(param_2,param_3,param_4,4);

            }

          }

          else if ((iVar2 == 0xe) || (iVar2 == 0xf)) {

            if (param_4[0x1378] == 0) {

              iVar2 = FUN_00647040(param_2,param_3,param_4,2);

            }

            else {

              iVar2 = FUN_00644930(param_2,param_3,param_4,2);

            }

          }

          else if (param_4[0x1378] == 0) {

            iVar2 = FUN_00647040(param_2,param_3,param_4,1);

          }

          else {

            iVar2 = FUN_00644930(param_2,param_3,param_4,1);

          }

          goto LAB_006491b6;

        }

      }

      else {

        iVar4 = param_4[1];

      }

    }

  }

  if (iVar2 <= iVar6) {

    iVar6 = iVar2;

  }

  param_4[3] = iVar6;

  if (local_14 <= iVar5) {

    iVar5 = local_14;

  }

  param_4[4] = iVar5;

  if (iVar4 < 0) {

    iVar4 = 0;

  }

  param_4[1] = iVar4;

  if (iVar7 < 0) {

    iVar7 = 0;

  }

  param_4[2] = iVar7;

  if (param_4[0x120c] == 0) {

    puVar3 = (undefined4 *)FUN_005df0f5(0x50000);

    param_4[0x120c] = (int)puVar3;

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

      return -5;

    }

    iVar2 = *param_4;

    if ((((iVar2 == 2) || (iVar2 == 6)) || (iVar2 == 0xe)) || ((iVar2 == 0x10 || (iVar2 == 0x12))))

    {

      *puVar3 = *(undefined4 *)(param_2 + 0x1c);

    }

    else {

      *puVar3 = *(undefined4 *)(param_2 + 0x10);

    }

    *(undefined4 *)(param_4[0x120c] + 4) = 0;

    *(undefined4 *)(param_4[0x120c] + 8) = 0;

    *(undefined4 *)(param_4[0x120c] + 0xc) = 0;

    *(undefined4 *)(param_4[0x120c] + 0x10) = 0;

    iVar2 = param_4[0x120c];

    *(undefined4 *)(iVar2 + 0x18) = 0;

    *(undefined4 *)(iVar2 + 0x1c) = 0;

    *(undefined4 *)(param_4[0x120c] + 0x20) = 0;

    *(undefined1 *)(param_4[0x120c] + 0x24) = *(undefined1 *)(param_2 + 0x30);

    iVar6 = 1;

    iVar2 = 0x28;

    do {

      iVar6 = iVar6 + 5;

      *(undefined4 *)(iVar2 + param_4[0x120c]) = 0xffffffff;

      *(undefined4 *)(iVar2 + 0x28 + param_4[0x120c]) = 0xffffffff;

      *(undefined4 *)(iVar2 + 0x50 + param_4[0x120c]) = 0xffffffff;

      *(undefined4 *)(iVar2 + 0x78 + param_4[0x120c]) = 0xffffffff;

      *(undefined4 *)(iVar2 + 0xa0 + param_4[0x120c]) = 0xffffffff;

      iVar2 = iVar2 + 200;

    } while (iVar6 < 0x1ffb);

    *(undefined4 *)(iVar6 * 0x28 + param_4[0x120c]) = 0xffffffff;

  }

  iVar2 = *param_4;

  if ((iVar2 == 0x12) || (iVar2 == 0x13)) {

    if (param_4[0x1378] == 0) {

      iVar2 = FUN_00647b40(param_2,param_3,param_4,8);

    }

    else {

      iVar2 = FUN_00645ce0(param_2,param_3,param_4,8);

    }

  }

  else if ((iVar2 == 0x10) || (iVar2 == 0x11)) {

    if (param_4[0x1378] == 0) {

      iVar2 = FUN_00647b40(param_2,param_3,param_4,4);

    }

    else {

      iVar2 = FUN_00645ce0(param_2,param_3,param_4,4);

    }

  }

  else if ((iVar2 == 0xe) || (iVar2 == 0xf)) {

    if (param_4[0x1378] == 0) {

      iVar2 = FUN_00647b40(param_2,param_3,param_4,2);

    }

    else {

      iVar2 = FUN_00645ce0(param_2,param_3,param_4,2);

    }

  }

  else if (param_4[0x1378] == 0) {

    iVar2 = FUN_00647b40(param_2,param_3,param_4,1);

  }

  else {

    iVar2 = FUN_00645ce0(param_2,param_3,param_4,1);

  }

LAB_006491b6:

  if (iVar2 == 0) {

    FUN_00649650(param_2);

  }

  (**(code **)(iVar1 + 0x18))();

  return iVar2;

}





// --- FUN_00649520 at 0x00649520 (size: 66) ---


void FUN_00649520(undefined4 *param_1)



{

  if (param_1[0xf] == 0) {

    param_1[4] = param_1[5];

    param_1[6] = param_1[5] + param_1[8];

    param_1[9] = param_1[8];

  }

  else {

    param_1[4] = param_1 + 0x410;

    param_1[6] = param_1 + 0x410;

    param_1[9] = 0;

  }

  param_1[3] = 0;

  *(undefined1 *)(param_1 + 0xc) = 0;

  *param_1 = 0;

  param_1[1] = 0;

  param_1[0xe] = 0;

  return;

}





// --- FUN_00649570 at 0x00649570 (size: 91) ---


undefined4 FUN_00649570(int param_1)



{

  int iVar1;

  undefined4 uVar2;

  int local_14 [2];

  

  uVar2 = 0;

  iVar1 = FUN_00619530(*(undefined4 *)(param_1 + 0x3c),param_1 + 0x40,0x1000,local_14);

  if ((iVar1 == 0) || (local_14[0] != 0)) {

    *(int *)(param_1 + 0x24) = local_14[0];

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

    *(int *)(param_1 + 0x18) = local_14[0] + 0x40 + param_1;

  }

  else {

    uVar2 = 0xffffffe9;

  }

  return uVar2;

}





// --- FUN_006495d0 at 0x006495D0 (size: 119) ---


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



{

  int iVar1;

  uint uVar2;

  

  *param_3 = 0;

  if (*(int *)(param_1 + 0x3c) == 0) {

    uVar2 = *(uint *)(param_1 + 0x24);

  }

  else {

    uVar2 = *(uint *)(param_1 + 0x24);

    if (uVar2 < param_2) {

      iVar1 = FUN_00649570(param_1);

      if (iVar1 != 0) {

        return iVar1;

      }

      uVar2 = *(uint *)(param_1 + 0x24);

      if (uVar2 < param_2) {

        return -0x18;

      }

    }

  }

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

  if (param_2 <= uVar2) {

    *(uint *)(param_1 + 0x10) = param_2 + iVar1;

    *(int *)(param_1 + 0x1c) = *(int *)(param_1 + 0x1c) + param_2;

    *(uint *)(param_1 + 0x24) = uVar2 - param_2;

    *param_3 = iVar1;

    return 0;

  }

  return -5;

}





// --- FUN_00649650 at 0x00649650 (size: 12) ---


void FUN_00649650(int param_1)



{

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

  return;

}





// --- FUN_00649660 at 0x00649660 (size: 190) ---


int FUN_00649660(int param_1)



{

  bool bVar1;

  int iVar2;

  int iVar3;

  char *pcVar4;

  

  pcVar4 = *(char **)(param_1 + 0x10);

  do {

    while( true ) {

      if (*(char **)(param_1 + 0x18) <= pcVar4) {

        if (*(int *)(param_1 + 0x3c) == 0) {

          return -5;

        }

        iVar2 = FUN_00649570(param_1);

        if (iVar2 != 0) {

          return iVar2;

        }

      }

      bVar1 = false;

      iVar2 = *(int *)(param_1 + 0x24);

      if (0 < iVar2) {

        iVar3 = *(int *)(param_1 + 0x1c);

        pcVar4 = *(char **)(param_1 + 0x10);

        do {

          iVar2 = iVar2 + -1;

          iVar3 = iVar3 + 1;

          *(int *)(param_1 + 0x24) = iVar2;

          *(int *)(param_1 + 0x1c) = iVar3;

          *(char **)(param_1 + 0x10) = pcVar4 + 1;

          if (*pcVar4 == -1) {

            bVar1 = true;

          }

        } while ((0 < iVar2) && (pcVar4 = pcVar4 + 1, !bVar1));

      }

      if (iVar2 < 1) break;

LAB_006496c7:

      pcVar4 = *(char **)(param_1 + 0x10);

      if (*pcVar4 != -1) {

        if (*pcVar4 != '\0') {

          return 0;

        }

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

        pcVar4 = pcVar4 + 1;

        *(char **)(param_1 + 0x10) = pcVar4;

        *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + -1;

      }

    }

    if (*(int *)(param_1 + 0x3c) == 0) {

      return -5;

    }

    iVar2 = FUN_00649570(param_1);

    if (iVar2 != 0) {

      return iVar2;

    }

    if (bVar1) goto LAB_006496c7;

    pcVar4 = *(char **)(param_1 + 0x10);

  } while( true );

}





// --- FUN_00649730 at 0x00649730 (size: 3438) ---


/* WARNING: Removing unreachable block (ram,0x006499f2) */



undefined4 FUN_00649730(int param_1)



{

  int iVar1;

  int iVar2;

  int iVar3;

  bool bVar4;

  bool bVar5;

  int iVar6;

  int iVar7;

  int iVar8;

  int iVar9;

  int iVar10;

  int local_28;

  

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

  iVar2 = *(int *)(param_1 + 0x58);

  bVar5 = true;

  if ((((iVar2 == 4) || (iVar2 == 1)) || (iVar2 == 5)) ||

     (((iVar2 == 0xff || (*(int *)(param_1 + 0x34) == 4)) || (*(int *)(param_1 + 0x34) == 3)))) {

    bVar5 = false;

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

  }

  else {

    *(undefined4 *)(param_1 + 0x68) = 1;

  }

  iVar10 = 0;

  bVar4 = false;

  local_28 = 0;

  iVar8 = *(int *)(param_1 + 0x37c0);

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

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

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

  if (0 < iVar8) {

    iVar6 = *(int *)(param_1 + 0x37cc);

    iVar9 = 0;

    local_28 = 0;

    iVar7 = 0;

    do {

      iVar3 = *(int *)(iVar9 + 4 + iVar6);

      if (local_28 < iVar3) {

        *(int *)(param_1 + 0x37b8) = iVar3;

        local_28 = iVar3;

      }

      iVar3 = *(int *)(iVar9 + 8 + iVar6);

      if (iVar10 < iVar3) {

        *(int *)(param_1 + 0x37bc) = iVar3;

        iVar10 = iVar3;

      }

      if ((*(int *)(iVar9 + 4 + iVar6) != 1) || (*(int *)(iVar9 + 8 + iVar6) != 1)) {

        if (*(int *)(param_1 + 0x34) == 3) {

          bVar4 = false;

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

        }

        else {

          bVar4 = true;

          *(undefined4 *)(param_1 + 0x6c) = 1;

        }

      }

      iVar9 = iVar9 + 0x10;

      iVar7 = iVar7 + 1;

    } while (iVar7 < iVar8);

  }

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

    *(undefined4 *)(param_1 + 0x37b0) = 8;

    *(undefined4 *)(param_1 + 0x37b4) = 8;

  }

  else {

    *(int *)(param_1 + 0x37b4) = local_28 * 8;

    *(int *)(param_1 + 0x37b0) = iVar10 * 8;

  }

  iVar6 = (*(int *)(param_1 + 0x4c) + -1 + local_28 * 8) / (local_28 * 8);

  *(int *)(param_1 + 0x78) = iVar6;

  iVar10 = (*(int *)(param_1 + 0x50) + -1 + iVar10 * 8) / (iVar10 * 8);

  *(int *)(param_1 + 0x7c) = iVar10;

  *(int *)(param_1 + 0x37c4) = iVar6;

  *(int *)(param_1 + 0x37c8) = iVar10 * iVar6;

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

  if ((((iVar8 == 3) && (iVar2 == 3)) && (*(int *)(param_1 + 0x34) == 3)) &&

     (((iVar2 = *(int *)(param_1 + 0x37cc), *(int *)(iVar2 + 4) != 2 || (*(int *)(iVar2 + 8) != 1))

      || (((*(int *)(iVar2 + 0x14) != 1 ||

           ((*(int *)(iVar2 + 0x18) != 1 || (*(int *)(iVar2 + 0x24) != 1)))) ||

          (*(int *)(iVar2 + 0x28) != 1)))))) {

    return 0xfffffff8;

  }

  if ((0 < iVar8) && (iVar8 < 0x100)) {

    if ((*(int *)(param_1 + 0x74) == 0) || (*(int *)(param_1 + 0x4de0) != 0)) {

      if ((bVar4) && (bVar5)) {

        if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 3)) {

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

            iVar2 = *(int *)(param_1 + 0x37cc);

            if (((((*(int *)(iVar2 + 4) == 2) && (*(int *)(iVar2 + 8) == 2)) &&

                 (*(int *)(iVar2 + 0x14) == 1)) &&

                ((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)))) &&

               (*(int *)(iVar2 + 0x28) == 1)) {

              if (*(int *)(param_1 + 0x4de8) == 0) {

                *(undefined4 *)(param_1 + 0x18) = 3;

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00635780;

              }

              else if (*(int *)(param_1 + 0x4de8) == 1) {

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

              }

            }

            else if (((*(int *)(iVar2 + 4) == 2) && (*(int *)(iVar2 + 8) == 1)) &&

                    ((*(int *)(iVar2 + 0x14) == 1 &&

                     (((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)) &&

                      (*(int *)(iVar2 + 0x28) == 1)))))) {

              if (*(int *)(param_1 + 0x4de8) == 0) {

                *(undefined4 *)(param_1 + 0x18) = 5;

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00637d10;

              }

              else if (*(int *)(param_1 + 0x4de8) == 1) {

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

              }

            }

            else {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

            }

          }

          else if (*(int *)(param_1 + 0x34) == 2) {

            iVar2 = *(int *)(param_1 + 0x37cc);

            if ((((*(int *)(iVar2 + 4) == 2) && (*(int *)(iVar2 + 8) == 2)) &&

                ((*(int *)(iVar2 + 0x14) == 1 &&

                 ((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)))))) &&

               (*(int *)(iVar2 + 0x28) == 1)) {

              if (*(int *)(param_1 + 0x4de8) == 0) {

                *(undefined4 *)(param_1 + 0x18) = 4;

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00636820;

              }

              else if (*(int *)(param_1 + 0x4de8) == 1) {

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

              }

            }

            else if (((((*(int *)(iVar2 + 4) == 2) && (*(int *)(iVar2 + 8) == 1)) &&

                      (*(int *)(iVar2 + 0x14) == 1)) &&

                     ((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)))) &&

                    (*(int *)(iVar2 + 0x28) == 1)) {

              if (*(int *)(param_1 + 0x4de8) == 0) {

                *(undefined4 *)(param_1 + 0x18) = 6;

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00638850;

              }

              else if (*(int *)(param_1 + 0x4de8) == 1) {

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

              }

            }

            else {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

            }

          }

        }

        else if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 4)) {

          if (*(int *)(param_1 + 0x34) == 5) {

            iVar2 = *(int *)(param_1 + 0x37cc);

            if (((*(int *)(iVar2 + 4) == 2) && (*(int *)(iVar2 + 8) == 2)) &&

               ((*(int *)(iVar2 + 0x14) == 1 &&

                (((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)) &&

                 (*(int *)(iVar2 + 0x28) == 1)))))) {

              if (*(int *)(param_1 + 0x4de8) == 0) {

                *(undefined4 *)(param_1 + 0x18) = 8;

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063ab70;

              }

              else if (*(int *)(param_1 + 0x4de8) == 1) {

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

              }

            }

            else if (((((*(int *)(iVar2 + 4) == 2) && (*(int *)(iVar2 + 8) == 1)) &&

                      (*(int *)(iVar2 + 0x14) == 1)) &&

                     ((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)))) &&

                    (*(int *)(iVar2 + 0x28) == 1)) {

              if (*(int *)(param_1 + 0x4de8) == 0) {

                *(undefined4 *)(param_1 + 0x18) = 9;

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00639ce0;

              }

              else if (*(int *)(param_1 + 0x4de8) == 1) {

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

              }

            }

            else {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

            }

          }

        }

        else if (((iVar8 == 4) && (*(int *)(param_1 + 0x30) == 4)) &&

                (*(int *)(param_1 + 0x34) == 5)) {

          iVar2 = *(int *)(param_1 + 0x37cc);

          if (((((*(int *)(iVar2 + 4) == 2) && (*(int *)(iVar2 + 8) == 1)) &&

               (*(int *)(iVar2 + 0x14) == 1)) &&

              ((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)))) &&

             ((*(int *)(iVar2 + 0x28) == 1 &&

              ((*(int *)(iVar2 + 0x34) == 2 && (*(int *)(iVar2 + 0x38) == 1)))))) {

            if (*(int *)(param_1 + 0x4de8) == 0) {

              *(undefined4 *)(param_1 + 0x18) = 0xc;

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063c510;

            }

            else if (*(int *)(param_1 + 0x4de8) == 1) {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

            }

          }

          else if (((*(int *)(iVar2 + 4) == 2) &&

                   (((*(int *)(iVar2 + 8) == 2 && (*(int *)(iVar2 + 0x14) == 1)) &&

                    (*(int *)(iVar2 + 0x18) == 1)))) &&

                  (((*(int *)(iVar2 + 0x24) == 1 && (*(int *)(iVar2 + 0x28) == 1)) &&

                   ((*(int *)(iVar2 + 0x34) == 2 && (*(int *)(iVar2 + 0x38) == 2)))))) {

            if (*(int *)(param_1 + 0x4de8) == 0) {

              *(undefined4 *)(param_1 + 0x18) = 0xb;

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063d690;

            }

            else if (*(int *)(param_1 + 0x4de8) == 1) {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

            }

          }

          else {

            *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640f80;

          }

        }

      }

      else if ((!bVar4) || (bVar5)) {

        if ((bVar4) || (!bVar5)) {

          if ((!bVar4) && (!bVar5)) {

            if ((iVar8 == 1) && (*(int *)(param_1 + 0x30) == 1)) {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063f760;

              iVar8 = *(int *)(param_1 + 0x37c0);

            }

            if ((iVar8 == 1) && (*(int *)(param_1 + 0x30) != 1)) {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063f8d0;

            }

            else if (iVar8 == 2) {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063f8d0;

            }

            else if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 1)) {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063f8d0;

            }

            else if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 2)) {

              iVar2 = *(int *)(param_1 + 0x37cc);

              if (((((*(int *)(iVar2 + 4) == 2) && (*(int *)(iVar2 + 8) == 1)) &&

                   (*(int *)(iVar2 + 0x14) == 1)) &&

                  ((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)))) &&

                 (*(int *)(iVar2 + 0x28) == 1)) {

                *(undefined4 *)(param_1 + 0x18) = 0x13;

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063f350;

              }

            }

            else if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 3)) {

              if (*(int *)(param_1 + 0x34) == 2) {

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

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063f8d0;

              }

              else {

                *(undefined4 *)(param_1 + 0x18) = 0xf;

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063e3f0;

              }

            }

            else if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 4)) {

              if (*(int *)(param_1 + 0x34) == 5) {

                *(undefined4 *)(param_1 + 0x18) = 0xd;

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063dcb0;

              }

              else {

                *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063f8d0;

              }

            }

            else if ((iVar8 == 4) && (*(int *)(param_1 + 0x30) == 3)) {

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

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063f8d0;

            }

            else if ((iVar8 == 4) && (*(int *)(param_1 + 0x30) == 4)) {

              *(undefined4 *)(param_1 + 0x18) = 0xe;

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063e090;

            }

          }

        }

        else if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 3)) {

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

            *(undefined4 *)(param_1 + 0x18) = 1;

            *(undefined1 **)(iVar1 + 0xa0) = &LAB_00636e80;

          }

          else if (*(int *)(param_1 + 0x34) == 2) {

            *(undefined4 *)(param_1 + 0x18) = 2;

            *(undefined1 **)(iVar1 + 0xa0) = &LAB_006372a0;

          }

        }

        else if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 4)) {

          if (*(int *)(param_1 + 0x34) == 5) {

            *(undefined4 *)(param_1 + 0x18) = 7;

            *(undefined1 **)(iVar1 + 0xa0) = &LAB_006392a0;

          }

        }

        else if (((iVar8 == 4) && (*(int *)(param_1 + 0x30) == 4)) &&

                (*(int *)(param_1 + 0x34) == 5)) {

          *(undefined4 *)(param_1 + 0x18) = 10;

          *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063b920;

        }

      }

      else if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 1)) {

        if (*(int *)(param_1 + 0x4de0) == 0) {

          *(code **)(iVar1 + 0xa0) = FUN_0063fc40;

        }

        else {

          *(code **)(iVar1 + 0xa0) = FUN_00633470;

        }

      }

      else if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 3)) {

        if (*(int *)(param_1 + 0x34) == 2) {

          if (*(int *)(param_1 + 0x4de0) == 0) {

            *(code **)(iVar1 + 0xa0) = FUN_0063fc40;

          }

          else {

            *(code **)(iVar1 + 0xa0) = FUN_00633470;

          }

        }

        else {

          iVar2 = *(int *)(param_1 + 0x37cc);

          if ((((*(int *)(iVar2 + 4) == 2) && (*(int *)(iVar2 + 8) == 2)) &&

              (*(int *)(iVar2 + 0x14) == 1)) &&

             (((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)) &&

              (*(int *)(iVar2 + 0x28) == 1)))) {

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

            if (*(int *)(param_1 + 0x4de8) == 0) {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063e8c0;

            }

            else if (*(int *)(param_1 + 0x4de8) == 1) {

              if (*(int *)(param_1 + 0x4de0) == 0) {

                *(code **)(iVar1 + 0xa0) = FUN_0063fc40;

              }

              else {

                *(code **)(iVar1 + 0xa0) = FUN_00633470;

              }

            }

          }

          else if (((*(int *)(iVar2 + 4) == 2) && (*(int *)(iVar2 + 8) == 1)) &&

                  ((*(int *)(iVar2 + 0x14) == 1 &&

                   (((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)) &&

                    (*(int *)(iVar2 + 0x28) == 1)))))) {

            *(undefined4 *)(param_1 + 0x18) = 0x11;

            if (*(int *)(param_1 + 0x4de8) == 0) {

              *(undefined1 **)(iVar1 + 0xa0) = &LAB_0063eed0;

            }

            else if (*(int *)(param_1 + 0x4de8) == 1) {

              if (*(int *)(param_1 + 0x4de0) == 0) {

                *(code **)(iVar1 + 0xa0) = FUN_0063fc40;

              }

              else {

                *(code **)(iVar1 + 0xa0) = FUN_00633470;

              }

            }

          }

          else if (*(int *)(param_1 + 0x4de0) == 0) {

            *(code **)(iVar1 + 0xa0) = FUN_0063fc40;

          }

          else {

            *(code **)(iVar1 + 0xa0) = FUN_00633470;

          }

        }

      }

      else if ((iVar8 == 3) && (*(int *)(param_1 + 0x30) == 4)) {

        if (*(int *)(param_1 + 0x4de0) == 0) {

          *(code **)(iVar1 + 0xa0) = FUN_0063fc40;

        }

        else {

          *(code **)(iVar1 + 0xa0) = FUN_00633470;

        }

      }

      else if ((iVar8 == 4) && (*(int *)(param_1 + 0x30) == 3)) {

        if (*(int *)(param_1 + 0x4de0) == 0) {

          *(code **)(iVar1 + 0xa0) = FUN_0063fc40;

        }

        else {

          *(code **)(iVar1 + 0xa0) = FUN_00633470;

        }

      }

      else if ((iVar8 == 4) && (*(int *)(param_1 + 0x30) == 4)) {

        if (*(int *)(param_1 + 0x4de0) == 0) {

          *(code **)(iVar1 + 0xa0) = FUN_0063fc40;

        }

        else {

          *(code **)(iVar1 + 0xa0) = FUN_00633470;

        }

      }

    }

    else if (*(int *)(param_1 + 0x34) == 3) {

      *(undefined1 **)(iVar1 + 0xa0) = &LAB_00640fe0;

    }

    else {

      *(code **)(iVar1 + 0xa0) = FUN_0063fc40;

    }

    return 0;

  }

  return 0xfffffff2;

}





// --- FUN_0064a4c0 at 0x0064A4C0 (size: 28) ---


void FUN_0064a4c0(undefined1 param_1,int *param_2)



{

  undefined1 *puVar1;

  

  puVar1 = (undefined1 *)*param_2;

  *param_2 = (int)(puVar1 + 1);

  *puVar1 = 0xff;

  puVar1 = (undefined1 *)*param_2;

  *param_2 = (int)(puVar1 + 1);

  *puVar1 = param_1;

  return;

}





// --- FUN_0064a4e0 at 0x0064A4E0 (size: 40) ---


void FUN_0064a4e0(undefined4 param_1,int *param_2)



{

  undefined1 *puVar1;

  

  puVar1 = (undefined1 *)*param_2;

  *param_2 = (int)(puVar1 + 1);

  *puVar1 = (char)((uint)param_1 >> 8);

  puVar1 = (undefined1 *)*param_2;

  *param_2 = (int)(puVar1 + 1);

  *puVar1 = (char)param_1;

  return;

}





// --- FUN_0064a510 at 0x0064A510 (size: 283) ---


void FUN_0064a510(int param_1)



{

  int iVar1;

  undefined1 *puVar2;

  undefined1 *local_24;

  undefined1 local_20 [24];

  

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

  local_24 = local_20;

  FUN_0064a4c0(0xe0,&local_24);

  FUN_0064a4e0(0x10,&local_24);

  puVar2 = local_24 + 1;

  *local_24 = 0x4a;

  local_24 = puVar2;

  puVar2 = local_24 + 1;

  *local_24 = 0x46;

  local_24 = puVar2;

  puVar2 = local_24 + 1;

  *local_24 = 0x49;

  local_24 = puVar2;

  puVar2 = local_24 + 1;

  *local_24 = 0x46;

  local_24 = puVar2;

  puVar2 = local_24 + 1;

  *local_24 = 0;

  local_24 = puVar2;

  FUN_0064a4e0(*(undefined2 *)(param_1 + 0x4dfc),&local_24);

  puVar2 = local_24 + 1;

  *local_24 = *(undefined1 *)(param_1 + 0x4dfe);

  local_24 = puVar2;

  FUN_0064a4e0(*(undefined2 *)(param_1 + 0x4e00),&local_24);

  FUN_0064a4e0(*(undefined2 *)(param_1 + 0x4e02),&local_24);

  puVar2 = local_24 + 1;

  *local_24 = 0;

  local_24 = puVar2;

  puVar2 = local_24 + 1;

  *local_24 = 0;

  local_24 = puVar2;

  (**(code **)(iVar1 + 0x5c))(local_20,0x12,param_1 + 0x37e8);

  return;

}





// --- FUN_0064a630 at 0x0064A630 (size: 632) ---


int FUN_0064a630(int param_1)



{

  int iVar1;

  uint uVar2;

  int local_a4;

  undefined1 *local_a0;

  int local_9c;

  int local_98;

  undefined1 *local_94;

  int local_90;

  char *local_8c;

  undefined1 local_88 [80];

  int local_38;

  int local_34;

  int local_30;

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_00908b0c;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_a4 = *(int *)(param_1 + 0x37f0);

  local_8 = 0;

  local_a0 = (undefined1 *)0x0;

  local_9c = 0;

  if (*(int *)(param_1 + 0x4e04) == 0) {

    local_8c = s_Intel_R__JPEG_Library__version___00908b40;

    local_a0 = local_88;

    ExceptionList = &local_14;

    (*DAT_008f85a4)(local_a0,0x50);

    local_38 = FUN_0061d320();

    local_34 = lstrlenA(local_8c);

    local_30 = (*DAT_008f85b8)(local_a0 + 4,local_8c,*(undefined4 *)(local_38 + 0x14),&local_a4);

    local_98 = local_30 + 5;

    FUN_0064a4c0(0xfe,&local_a0);

    FUN_0064a4e0(local_98 + -2,&local_a0);

    if (local_34 < local_30) {

      local_9c = (**(code **)(local_a4 + 0x5c))(local_88,local_98,param_1 + 0x37e8,&local_a4);

    }

  }

  else {

    uVar2 = (uint)*(ushort *)(param_1 + 0x4e08);

    if (uVar2 != 0) {

      ExceptionList = &local_14;

      if (0xfffb < uVar2) {

        ExceptionList = &local_14;

        *(undefined2 *)(param_1 + 0x4e08) = 0xfffb;

        uVar2 = 0xfffb;

      }

      local_98 = uVar2 + 4;

      local_a0 = (undefined1 *)FUN_005df0f5(local_98,&local_a4);

      if (local_a0 == (undefined1 *)0x0) {

        local_9c = -5;

      }

      else {

        local_94 = local_a0;

        (*DAT_008f85a4)(local_a0,local_98);

        FUN_0064a4c0(0xfe,&local_94);

        FUN_0064a4e0(local_98 + -2,&local_94);

        iVar1 = 0;

        local_90 = 0;

        if (*(short *)(param_1 + 0x4e08) != 0) {

          do {

            local_94[iVar1] = *(undefined1 *)(iVar1 + *(int *)(param_1 + 0x4e04));

            iVar1 = iVar1 + 1;

            local_90 = iVar1;

          } while (iVar1 < (int)(uint)*(ushort *)(param_1 + 0x4e08));

        }

        local_9c = (**(code **)(local_a4 + 0x5c))(local_a0,local_98,param_1 + 0x37e8,&local_a4);

        if (local_9c == 0) {

          operator_delete(local_a0);

        }

      }

    }

  }

  ExceptionList = local_14;

  return local_9c;

}





// --- FUN_0064a8d0 at 0x0064A8D0 (size: 68) ---


void FUN_0064a8d0(int param_1)



{

  int iVar1;

  undefined1 *local_14;

  undefined1 local_10 [8];

  

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

  local_14 = local_10;

  FUN_0064a4c0(0xd8,&local_14);

  (**(code **)(iVar1 + 0x5c))(local_10,2,param_1);

  return;

}





// --- FUN_0064a920 at 0x0064A920 (size: 68) ---


void FUN_0064a920(int param_1)



{

  int iVar1;

  undefined1 *local_14;

  undefined1 local_10 [8];

  

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

  local_14 = local_10;

  FUN_0064a4c0(0xd9,&local_14);

  (**(code **)(iVar1 + 0x5c))(local_10,2,param_1);

  return;

}





// --- FUN_0064a970 at 0x0064A970 (size: 488) ---


void FUN_0064a970(int param_1,int param_2)



{

  int iVar1;

  char *pcVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  char local_324 [780];

  char *local_18;

  int local_14;

  

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

  local_18 = local_324;

  iVar1 = *(int *)(param_2 + 0x1c) * 3;

  FUN_0064a4c0(0xc0,&local_18);

  FUN_0064a4e0(iVar1 + 8,&local_18);

  pcVar2 = local_18 + 1;

  *local_18 = '\b';

  local_18 = pcVar2;

  FUN_0064a4e0(*(undefined4 *)(param_2 + 8),&local_18);

  FUN_0064a4e0(*(undefined4 *)(param_2 + 4),&local_18);

  pcVar2 = local_18 + 1;

  *local_18 = *(char *)(param_2 + 0x1c);

  local_18 = pcVar2;

  if (*(int *)(param_2 + 0x1c) == 1) {

    pcVar2 = local_18 + 1;

    *local_18 = '\0';

    local_18 = pcVar2;

    pcVar2 = local_18 + 1;

    *local_18 = '\x11';

    local_18 = pcVar2;

    pcVar2 = local_18 + 1;

    *local_18 = *(char *)(*(int *)(param_2 + 0x28) + 0xc);

    local_18 = pcVar2;

  }

  else {

    pcVar2 = local_18 + 1;

    *local_18 = '\x01';

    local_18 = pcVar2;

    pcVar2 = local_18 + 1;

    *local_18 = (char)(*(int *)(*(int *)(param_2 + 0x28) + 4) << 4) +

                (char)*(undefined4 *)(*(int *)(param_2 + 0x28) + 8);

    local_18 = pcVar2;

    pcVar2 = local_18 + 1;

    *local_18 = *(char *)(*(int *)(param_2 + 0x28) + 0xc);

    local_18 = pcVar2;

    iVar3 = 2;

    if (1 < *(int *)(param_2 + 0x1c)) {

      iVar5 = 0x20;

      local_14 = iVar4;

      do {

        pcVar2 = local_18 + 1;

        *local_18 = (char)iVar3;

        local_18 = pcVar2;

        iVar3 = iVar3 + 1;

        pcVar2 = local_18 + 1;

        *local_18 = (char)(*(int *)(iVar5 + -0xc + *(int *)(param_2 + 0x28)) << 4) +

                    (char)*(undefined4 *)(iVar5 + -8 + *(int *)(param_2 + 0x28));

        local_18 = pcVar2;

        iVar4 = iVar5 + -4;

        iVar5 = iVar5 + 0x10;

        pcVar2 = local_18 + 1;

        *local_18 = *(char *)(iVar4 + *(int *)(param_2 + 0x28));

        local_18 = pcVar2;

        iVar4 = local_14;

      } while (iVar3 <= *(int *)(param_2 + 0x1c));

    }

  }

  (**(code **)(iVar4 + 0x5c))(local_324,iVar1 + 10,param_1);

  return;

}





// --- FUN_0064ab60 at 0x0064AB60 (size: 408) ---


void FUN_0064ab60(int param_1,int param_2)



{

  int iVar1;

  char *pcVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  char local_324 [780];

  char *local_18;

  int local_14;

  

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

  local_18 = local_324;

  iVar1 = *(int *)(param_2 + 0x1c) * 3;

  FUN_0064a4c0(0xc2,&local_18);

  FUN_0064a4e0(iVar1 + 8,&local_18);

  pcVar2 = local_18 + 1;

  *local_18 = '\b';

  local_18 = pcVar2;

  FUN_0064a4e0(*(undefined4 *)(param_2 + 8),&local_18);

  FUN_0064a4e0(*(undefined4 *)(param_2 + 4),&local_18);

  pcVar2 = local_18 + 1;

  *local_18 = *(char *)(param_2 + 0x1c);

  local_18 = pcVar2;

  if (*(int *)(param_2 + 0x1c) == 1) {

    pcVar2 = local_18 + 1;

    *local_18 = '\0';

    local_18 = pcVar2;

    pcVar2 = local_18 + 1;

    *local_18 = '\x11';

    local_18 = pcVar2;

    pcVar2 = local_18 + 1;

    *local_18 = *(char *)(*(int *)(param_2 + 0x28) + 0xc);

    local_18 = pcVar2;

  }

  else {

    iVar3 = 0;

    if (0 < *(int *)(param_2 + 0x1c)) {

      iVar5 = 0;

      local_14 = iVar4;

      do {

        pcVar2 = local_18 + 1;

        *local_18 = (char)iVar3;

        local_18 = pcVar2;

        iVar3 = iVar3 + 1;

        pcVar2 = local_18 + 1;

        *local_18 = (char)(*(int *)(iVar5 + 4 + *(int *)(param_2 + 0x28)) << 4) +

                    (char)*(undefined4 *)(iVar5 + 8 + *(int *)(param_2 + 0x28));

        local_18 = pcVar2;

        iVar4 = iVar5 + 0xc;

        iVar5 = iVar5 + 0x10;

        pcVar2 = local_18 + 1;

        *local_18 = *(char *)(iVar4 + *(int *)(param_2 + 0x28));

        local_18 = pcVar2;

        iVar4 = local_14;

      } while (iVar3 < *(int *)(param_2 + 0x1c));

    }

  }

  (**(code **)(iVar4 + 0x5c))(local_324,iVar1 + 10,param_1);

  return;

}





// --- FUN_0064ad00 at 0x0064AD00 (size: 356) ---


void FUN_0064ad00(int param_1,int param_2,char param_3,undefined2 *param_4)



{

  char *pcVar1;

  undefined2 *puVar2;

  undefined2 uVar3;

  int iVar4;

  int iVar5;

  char *local_a4;

  char local_a0 [136];

  int local_18;

  

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

  if (param_2 == 0) {

    iVar5 = 0x43;

  }

  else {

    iVar5 = 0x83;

  }

  local_a4 = local_a0;

  FUN_0064a4c0(0xdb,&local_a4);

  FUN_0064a4e0(iVar5,&local_a4);

  pcVar1 = local_a4 + 1;

  *local_a4 = (char)(param_2 << 4) + param_3;

  local_a4 = pcVar1;

  local_18 = iVar4;

  if (param_2 == 0) {

    iVar4 = 0;

    do {

      local_a4[iVar4] = *(char *)(param_4 + iVar4);

      local_a4[iVar4 + 1] = *(char *)(param_4 + iVar4 + 1);

      local_a4[iVar4 + 2] = *(char *)(param_4 + iVar4 + 2);

      local_a4[iVar4 + 3] = *(char *)(param_4 + iVar4 + 3);

      iVar4 = iVar4 + 4;

    } while (iVar4 < 0x40);

  }

  else {

    puVar2 = param_4 + 0x40;

    do {

      uVar3 = *param_4;

      *local_a4 = (char)((ushort)uVar3 >> 8);

      local_a4[1] = (char)uVar3;

      uVar3 = param_4[1];

      pcVar1 = local_a4 + 3;

      param_4 = param_4 + 2;

      local_a4[2] = (char)((ushort)uVar3 >> 8);

      local_a4 = local_a4 + 4;

      *pcVar1 = (char)uVar3;

    } while ((int)param_4 < (int)puVar2);

  }

  (**(code **)(local_18 + 0x5c))(local_a0,iVar5 + 2,param_1);

  return;

}





// --- FUN_0064ae70 at 0x0064AE70 (size: 741) ---


undefined4 FUN_0064ae70(int param_1,byte *param_2,int param_3,char param_4,char param_5)



{

  byte *pbVar1;

  byte *pbVar2;

  int iVar3;

  int iVar4;

  undefined4 uVar5;

  int iVar6;

  uint uVar7;

  uint uVar8;

  byte *local_16c;

  byte local_168 [324];

  int local_24;

  int local_20;

  int local_1c;

  uint local_18;

  

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

  local_16c = local_168;

  FUN_0064a4c0(0xc4,&local_16c);

  local_24 = (uint)param_2[0xe] +

             (uint)param_2[0xd] +

             (uint)param_2[0xc] +

             (uint)param_2[0xb] +

             (uint)param_2[10] +

             (uint)param_2[9] +

             (uint)param_2[8] +

             (uint)param_2[7] +

             (uint)param_2[6] +

             (uint)param_2[5] +

             (uint)param_2[4] +

             (uint)param_2[3] + (uint)param_2[2] + (uint)param_2[1] + (uint)*param_2;

  uVar8 = (uint)param_2[0xf];

  local_1c = uVar8 + local_24;

  uVar7 = uVar8 + 0x13 + local_24;

  FUN_0064a4e0(uVar7,&local_16c);

  if (uVar7 < 0x145) {

    pbVar1 = local_16c + 1;

    *local_16c = param_4 * '\x10' + param_5;

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = *param_2;

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[1];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[2];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[3];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[4];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[5];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[6];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[7];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[8];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[9];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[10];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[0xb];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[0xc];

    local_16c = pbVar1;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[0xd];

    local_16c = pbVar1;

    iVar6 = 0;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[0xe];

    local_16c = pbVar1;

    iVar3 = local_1c;

    pbVar1 = local_16c + 1;

    *local_16c = param_2[0xf];

    local_16c = pbVar1;

    if (0 < iVar3) {

      iVar3 = local_1c;

      if (5 < (int)(uVar8 + local_24)) {

        iVar4 = (uVar8 - 6) + local_24;

        local_18 = uVar7;

        do {

          *local_16c = *(byte *)(iVar6 + param_3);

          local_16c[1] = *(byte *)(iVar6 + 1 + param_3);

          local_16c[2] = *(byte *)(iVar6 + 2 + param_3);

          pbVar1 = local_16c + 4;

          local_16c[3] = *(byte *)(iVar6 + 3 + param_3);

          iVar3 = iVar6 + 4;

          local_16c = local_16c + 5;

          iVar6 = iVar6 + 5;

          *pbVar1 = *(byte *)(iVar3 + param_3);

          iVar3 = local_1c;

          uVar7 = local_18;

        } while (iVar6 <= iVar4);

      }

      do {

        pbVar2 = (byte *)(iVar6 + param_3);

        pbVar1 = local_16c + 1;

        iVar6 = iVar6 + 1;

        *local_16c = *pbVar2;

        local_16c = pbVar1;

      } while (iVar6 < iVar3);

    }

    uVar5 = (**(code **)(local_20 + 0x5c))(local_168,uVar7 + 2,param_1);

    return uVar5;

  }

  return 0xfffffffa;

}





// --- FUN_0064b160 at 0x0064B160 (size: 1297) ---


int FUN_0064b160(int param_1,int param_2)



{

  char *pcVar1;

  char *pcVar2;

  byte *pbVar3;

  int iVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  int iVar8;

  int *piVar9;

  char *local_174;

  char local_170;

  undefined1 uStack_16f;

  undefined1 uStack_16e;

  undefined1 uStack_16d;

  undefined1 uStack_16c;

  undefined1 uStack_16b;

  undefined1 uStack_16a;

  undefined1 uStack_169;

  undefined1 uStack_168;

  undefined1 uStack_167;

  undefined1 uStack_166;

  undefined1 uStack_165;

  undefined1 uStack_164;

  undefined1 uStack_163;

  undefined1 uStack_162;

  undefined1 uStack_161;

  undefined1 uStack_160;

  char acStack_15f [307];

  uint local_2c;

  int local_28;

  int iStack_24;

  int iStack_20;

  int iStack_1c;

  uint uStack_18;

  int *piStack_14;

  

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

  iVar7 = 0;

  iVar8 = 0;

  iVar5 = *(int *)(param_2 + 0x90);

  if (0 < iVar5 * 2) {

    iVar4 = 0;

    do {

      pbVar3 = *(byte **)(iVar4 + 0x373c + param_2);

      iVar8 = iVar8 + (uint)*pbVar3 + (uint)pbVar3[1] + (uint)pbVar3[2] + (uint)pbVar3[3] +

              (uint)pbVar3[4] + (uint)pbVar3[5] + (uint)pbVar3[6] + (uint)pbVar3[7] +

              (uint)pbVar3[8] + (uint)pbVar3[9] + (uint)pbVar3[10] + (uint)pbVar3[0xb] +

              (uint)pbVar3[0xc] + (uint)pbVar3[0xd] + (uint)pbVar3[0xe] + (uint)pbVar3[0xf];

      iVar4 = iVar4 + 0xc;

      iVar7 = iVar7 + 1;

      local_2c = iVar5;

      local_28 = iVar6;

    } while (iVar7 < iVar5 * 2);

  }

  local_174 = &local_170;

  FUN_0064a4c0(0xc4,&local_174);

  FUN_0064a4e0(iVar5 * 0x22 + 2 + iVar8,&local_174);

  iVar5 = (**(code **)(iVar6 + 0x5c))(&local_170,4,param_1);

  if ((iVar5 == 0) && (0 < *(int *)(param_2 + 0x90) * 2)) {

    iVar7 = 0;

    iStack_20 = param_2;

    iStack_24 = 0;

    local_28 = iVar6;

    do {

      pbVar3 = *(byte **)(iVar7 + 0x373c + param_2);

      iVar6 = (uint)*pbVar3 + (uint)pbVar3[1] + (uint)pbVar3[2] + (uint)pbVar3[3] + (uint)pbVar3[4]

              + (uint)pbVar3[5] + (uint)pbVar3[6] + (uint)pbVar3[7] + (uint)pbVar3[8] +

              (uint)pbVar3[9] + (uint)pbVar3[10] + (uint)pbVar3[0xb] + (uint)pbVar3[0xc] +

              (uint)pbVar3[0xd] + (uint)pbVar3[0xe];

      local_2c = (uint)pbVar3[0xf];

      iStack_1c = iVar6 + local_2c;

      uStack_18 = iVar6 + 0x11 + local_2c;

      if (0x144 < uStack_18) {

        return -6;

      }

      local_170 = *(char *)(iVar7 + 0x3744 + param_2) * '\x10' + *(char *)(iVar7 + 0x3745 + param_2)

      ;

      uStack_16f = **(undefined1 **)(iVar7 + 0x373c + param_2);

      uStack_16e = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 1);

      uStack_16d = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 2);

      uStack_16c = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 3);

      uStack_16b = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 4);

      uStack_16a = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 5);

      uStack_169 = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 6);

      uStack_168 = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 7);

      uStack_167 = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 8);

      uStack_166 = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 9);

      uStack_165 = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 10);

      uStack_164 = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 0xb);

      uStack_163 = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 0xc);

      uStack_162 = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 0xd);

      uStack_161 = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 0xe);

      uStack_160 = *(undefined1 *)(*(int *)(iVar7 + 0x373c + param_2) + 0xf);

      local_174 = acStack_15f;

      iVar5 = 0;

      if (iStack_1c != 0) {

        if (iVar6 + local_2c < 6) {

          iVar6 = iStack_1c;

          piVar9 = (int *)(iStack_20 + 0x3740);

        }

        else {

          piStack_14 = (int *)(iStack_20 + 0x3740);

          local_2c = iVar6 + -6 + local_2c;

          do {

            *local_174 = *(char *)(iVar5 + *(int *)(iVar7 + 0x3740 + param_2));

            local_174[1] = *(char *)(iVar5 + 1 + *(int *)(iVar7 + 0x3740 + param_2));

            local_174[2] = *(char *)(iVar5 + 2 + *(int *)(iVar7 + 0x3740 + param_2));

            pcVar1 = local_174 + 4;

            local_174[3] = *(char *)(iVar5 + 3 + *(int *)(iVar7 + 0x3740 + param_2));

            iVar6 = iVar5 + 4;

            local_174 = local_174 + 5;

            iVar5 = iVar5 + 5;

            *pcVar1 = *(char *)(iVar6 + *(int *)(iVar7 + 0x3740 + param_2));

            iVar6 = iStack_1c;

            piVar9 = piStack_14;

          } while (iVar5 <= (int)local_2c);

        }

        do {

          pcVar2 = (char *)(iVar5 + *piVar9);

          pcVar1 = local_174 + 1;

          iVar5 = iVar5 + 1;

          *local_174 = *pcVar2;

          local_174 = pcVar1;

        } while (iVar5 < iVar6);

      }

      iVar6 = (**(code **)(local_28 + 0x5c))(&local_170,uStack_18,param_1);

      if (iVar6 != 0) {

        return iVar6;

      }

      iVar7 = iVar7 + 0xc;

      iStack_24 = iStack_24 + 1;

      iStack_20 = iStack_20 + 0xc;

      iVar5 = 0;

    } while (iStack_24 < *(int *)(param_2 + 0x90) * 2);

  }

  return iVar5;

}





// --- FUN_0064b680 at 0x0064B680 (size: 543) ---


void FUN_0064b680(int param_1,int param_2,char *param_3,char *param_4)



{

  char *pcVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  char *local_4c;

  char local_48 [32];

  int local_28;

  int local_24;

  int local_20;

  int local_1c;

  int local_18;

  

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

  iVar4 = param_2 * 2 + 6;

  local_4c = local_48;

  FUN_0064a4c0(0xda,&local_4c);

  FUN_0064a4e0(iVar4,&local_4c);

  pcVar1 = local_4c + 1;

  *local_4c = (char)param_2;

  local_4c = pcVar1;

  if (param_2 == 1) {

    pcVar1 = local_4c + 1;

    *local_4c = '\0';

    local_4c = pcVar1;

    pcVar1 = local_4c + 1;

    *local_4c = '\0';

    local_4c = pcVar1;

  }

  else {

    pcVar1 = local_4c + 1;

    *local_4c = '\x01';

    local_4c = pcVar1;

    pcVar1 = local_4c + 1;

    *local_4c = *param_3 * '\x10' + *param_4;

    local_4c = pcVar1;

    iVar3 = 2;

    if (1 < param_2) {

      local_28 = iVar4;

      if (3 < param_2 + -2) {

        local_18 = param_2 + -4;

        local_20 = 3;

        local_24 = 4;

        do {

          *local_4c = (char)iVar3;

          local_4c[1] = param_3[iVar3 + -1] * '\x10' + param_4[iVar3 + -1];

          local_4c[2] = (char)local_20;

          local_4c[3] = param_3[iVar3] * '\x10' + param_4[iVar3];

          pcVar1 = local_4c + 5;

          local_4c[4] = (char)local_24;

          iVar4 = iVar3 + 1;

          iVar2 = iVar3 + 1;

          local_4c = local_4c + 6;

          iVar3 = iVar3 + 3;

          *pcVar1 = param_3[iVar4] * '\x10' + param_4[iVar2];

          local_20 = local_20 + 3;

          local_24 = local_24 + 3;

        } while (iVar3 <= local_18);

      }

      do {

        pcVar1 = local_4c + 1;

        *local_4c = (char)iVar3;

        iVar4 = iVar3 + -1;

        iVar2 = iVar3 + -1;

        local_4c = local_4c + 2;

        iVar3 = iVar3 + 1;

        *pcVar1 = param_3[iVar4] * '\x10' + param_4[iVar2];

        iVar4 = local_28;

      } while (iVar3 <= param_2);

    }

  }

  *local_4c = '\0';

  pcVar1 = local_4c + 2;

  local_4c[1] = '?';

  local_4c = local_4c + 3;

  *pcVar1 = '\0';

  (**(code **)(local_1c + 0x5c))(local_48,iVar4 + 2,param_1);

  return;

}





// --- FUN_0064b8a0 at 0x0064B8A0 (size: 330) ---


void FUN_0064b8a0(int param_1,int *param_2,int param_3,int param_4)



{

  char *pcVar1;

  char *pcVar2;

  char *pcVar3;

  int iVar4;

  int iVar5;

  int iVar6;

  char *local_2c;

  char local_28 [16];

  int local_18;

  int local_14;

  

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

  iVar5 = *param_2 * 2 + 6;

  local_2c = local_28;

  FUN_0064a4c0(0xda,&local_2c);

  FUN_0064a4e0(iVar5,&local_2c);

  pcVar1 = local_2c + 1;

  *local_2c = (char)*param_2;

  local_2c = pcVar1;

  if (*param_2 == 1) {

    pcVar1 = local_2c + 1;

    *local_2c = *(char *)param_2[0xd];

    local_2c = pcVar1;

    pcVar1 = local_2c + 1;

    *local_2c = *(char *)(*(int *)param_2[0xd] + param_3) * '\x10' +

                *(char *)(*(int *)param_2[0xd] + param_4);

    local_2c = pcVar1;

  }

  else {

    iVar4 = 0;

    if (0 < *param_2) {

      do {

        local_14 = iVar5;

        local_18 = iVar6;

        pcVar1 = local_2c + 1;

        *local_2c = (char)iVar4;

        pcVar3 = (char *)(param_3 + iVar4);

        pcVar2 = (char *)(param_4 + iVar4);

        local_2c = local_2c + 2;

        iVar4 = iVar4 + 1;

        *pcVar1 = *pcVar3 * '\x10' + *pcVar2;

        iVar5 = local_14;

        iVar6 = local_18;

      } while (iVar4 < *param_2);

    }

  }

  *local_2c = (char)param_2[2];

  pcVar1 = local_2c + 2;

  local_2c[1] = (char)param_2[3];

  local_2c = local_2c + 3;

  *pcVar1 = (char)(param_2[4] << 4) + (char)param_2[5];

  (**(code **)(iVar6 + 0x5c))(local_28,iVar5 + 2,param_1);

  return;

}





// --- FUN_0064b9f0 at 0x0064B9F0 (size: 110) ---


void FUN_0064b9f0(undefined4 param_1,int param_2)



{

  int iVar1;

  undefined1 *local_1c;

  undefined1 local_18 [12];

  

  iVar1 = *(int *)(param_2 + 8);

  local_1c = local_18;

  FUN_0064a4c0(0xdd,&local_1c);

  FUN_0064a4e0(4,&local_1c);

  FUN_0064a4e0(param_1,&local_1c);

  (**(code **)(iVar1 + 0x5c))(local_18,6,param_2);

  return;

}





// --- FUN_0064ba60 at 0x0064BA60 (size: 147) ---


undefined4 FUN_0064ba60(undefined4 param_1,int param_2)



{

  int iVar1;

  undefined4 uVar2;

  undefined1 *local_14;

  undefined1 local_10 [8];

  

  iVar1 = *(int *)(param_2 + 8);

  switch(param_1) {

  case 0:

    uVar2 = 0xd0;

    break;

  case 1:

    uVar2 = 0xd1;

    break;

  case 2:

    uVar2 = 0xd2;

    break;

  case 3:

    uVar2 = 0xd3;

    break;

  case 4:

    uVar2 = 0xd4;

    break;

  case 5:

    uVar2 = 0xd5;

    break;

  case 6:

    uVar2 = 0xd6;

    break;

  case 7:

    uVar2 = 0xd7;

    break;

  default:

    return 0xffffffe7;

  }

  local_14 = local_10;

  FUN_0064a4c0(uVar2,&local_14);

  uVar2 = (**(code **)(iVar1 + 0x5c))(local_10,2,param_2);

  return uVar2;

}





// --- FUN_0064bb00 at 0x0064BB00 (size: 255) ---


void FUN_0064bb00(undefined1 param_1,int param_2)



{

  int iVar1;

  undefined1 *puVar2;

  undefined1 *local_24;

  undefined1 local_20 [20];

  

  iVar1 = *(int *)(param_2 + 0x37f0);

  local_24 = local_20;

  FUN_0064a4c0(0xee,&local_24);

  FUN_0064a4e0(0xe,&local_24);

  puVar2 = local_24 + 1;

  *local_24 = 0x41;

  local_24 = puVar2;

  puVar2 = local_24 + 1;

  *local_24 = 100;

  local_24 = puVar2;

  puVar2 = local_24 + 1;

  *local_24 = 0x6f;

  local_24 = puVar2;

  puVar2 = local_24 + 1;

  *local_24 = 0x62;

  local_24 = puVar2;

  puVar2 = local_24 + 1;

  *local_24 = 0x65;

  local_24 = puVar2;

  FUN_0064a4e0(*(undefined2 *)(param_2 + 0x4df0),&local_24);

  FUN_0064a4e0(*(undefined2 *)(param_2 + 0x4df2),&local_24);

  FUN_0064a4e0(*(undefined2 *)(param_2 + 0x4df4),&local_24);

  puVar2 = local_24 + 1;

  *local_24 = param_1;

  local_24 = puVar2;

  (**(code **)(iVar1 + 0x5c))(local_20,0x10,param_2 + 0x37e8);

  return;

}





// --- FUN_0064bc00 at 0x0064BC00 (size: 1413) ---


int FUN_0064bc00(int param_1,int param_2,int *param_3)



{

  char cVar1;

  int iVar2;

  int iVar3;

  int *piVar4;

  int *piVar5;

  int iVar6;

  int iVar7;

  int iVar8;

  short *psVar9;

  int iVar10;

  int *piVar11;

  int aiStack_a4 [4];

  int aiStack_94 [4];

  int aiStack_84 [4];

  int aiStack_74 [4];

  int local_64;

  int local_60;

  short *local_5c;

  int *local_58;

  int local_54;

  int *local_50;

  int *local_4c;

  int local_48;

  int local_44;

  int local_40;

  int local_3c;

  int local_38;

  int local_34;

  int local_30;

  int local_2c;

  int local_28;

  int local_24;

  int local_20;

  int local_1c;

  int local_18;

  int local_14;

  

  iVar2 = 0;

  local_54 = 0;

  iVar3 = *param_3;

  iVar7 = *(int *)(param_2 + 8);

  iVar6 = 0;

  if (0 < iVar3) {

    iVar10 = 0;

    iVar6 = 0;

    iVar8 = 0;

    local_64 = 0;

    local_60 = *(int *)(param_2 + 8);

    do {

      if (*(int *)(param_1 + 0x37e0) == 0) {

        param_3[iVar2 + 9] = 0;

      }

      iVar3 = *(int *)(iVar6 + 8 + param_3[0xd]) * *(int *)(iVar6 + 4 + param_3[0xd]);

      iVar8 = iVar8 + iVar3;

      cVar1 = *(char *)(param_1 + 0x379c + iVar2);

      aiStack_a4[iVar2] = iVar3;

      iVar3 = *(int *)(param_1 + 0x3704 + *(char *)(param_1 + 0x37a0 + iVar2) * 4);

      aiStack_94[iVar2] = iVar3;

      iVar7 = *(int *)(param_1 + 0x36f4 + cVar1 * 4);

      aiStack_84[iVar2] = iVar7;

      if ((iVar3 == 0) || (iVar7 == 0)) {

        iVar7 = local_60;

        iVar6 = -0x11;

        goto LAB_0064c102;

      }

      iVar3 = *(int *)(param_1 + 0x36e4 + *(int *)(iVar10 + 0xc + *(int *)(param_1 + 0x37cc)) * 4);

      aiStack_74[iVar2] = iVar3;

      iVar7 = local_60;

      if (iVar3 == 0) {

        iVar6 = -0x12;

        goto LAB_0064c102;

      }

      iVar10 = iVar10 + 0x10;

      iVar6 = iVar6 + 0x18;

      iVar2 = iVar2 + 1;

      iVar3 = *param_3;

    } while (iVar2 < iVar3);

    local_54 = iVar8;

    iVar6 = local_64;

  }

  iVar2 = param_3[8];

  piVar5 = *(int **)(param_1 + 0x7c);

  local_58 = piVar5;

  if (iVar2 < (int)piVar5) {

    local_64 = iVar6;

    local_14 = *(int *)(param_1 + 0x78);

    local_1c = iVar3;

    local_60 = iVar7;

    do {

      if (param_3[7] < local_14) {

        local_38 = iVar2 << 7;

        local_3c = local_54 * 0x40 + -1;

        local_40 = local_54 * 0x40;

        local_44 = param_3[7];

        local_48 = iVar2;

        iVar3 = local_1c;

        do {

          psVar9 = *(short **)(param_1 + 0x4834);

          piVar5 = *(int **)(param_1 + 0x4ddc);

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

            (**(code **)(local_60 + 0x60))(param_1,local_44,local_48);

            piVar5 = *(int **)(param_1 + 0x4ddc);

          }

          else {

            iVar7 = 0;

            if (0 < iVar3) {

              piVar4 = (int *)param_3[0xd];

              local_58 = piVar4;

              local_5c = psVar9;

              local_4c = piVar5;

              local_34 = local_44 << 4;

              do {

                iVar2 = 0;

                iVar6 = piVar4[iVar7 * 6 + 2];

                if (0 < iVar6) {

                  piVar5 = (int *)piVar4[iVar7 * 6 + 1];

                  local_50 = piVar5;

                  local_28 = iVar7 << 4;

                  local_2c = iVar7 * 2;

                  local_18 = iVar7 * 0x18;

                  local_30 = iVar7;

                  piVar11 = local_4c;

                  do {

                    iVar3 = 0;

                    if (0 < (int)piVar5) {

                      local_20 = iVar2 << 7;

                      iVar7 = local_14;

                      local_24 = iVar2;

                      while( true ) {

                        iVar2 = iVar3 * 0x10 + *(int *)((int)piVar11 + local_2c * 2 + 4) +

                                *(int *)(*(int *)(param_1 + 0x37cc) + 4 + local_28) * local_34 +

                                iVar6 * iVar7 * local_38 * (int)piVar5 +

                                (int)piVar5 * iVar7 * local_20;

                        iVar6 = 0;

                        psVar9 = local_5c;

                        local_1c = iVar3;

                        do {

                          (*DAT_008f85a8)(psVar9,iVar2,0x10);

                          iVar7 = *(int *)(param_1 + 0x78);

                          piVar4 = (int *)param_3[0xd];

                          piVar5 = *(int **)(local_18 + 4 + (int)piVar4);

                          iVar2 = iVar2 + iVar7 * 0x10 * (int)piVar5;

                          psVar9 = psVar9 + 8;

                          iVar6 = iVar6 + 1;

                        } while (iVar6 < 8);

                        local_5c = psVar9;

                        iVar3 = local_1c + 1;

                        if ((int)piVar5 <= iVar3) break;

                        piVar11 = *(int **)(param_1 + 0x4ddc);

                        iVar6 = *(int *)(local_18 + 8 + (int)piVar4);

                      }

                      local_14 = iVar7;

                      piVar11 = *(int **)(param_1 + 0x4ddc);

                      iVar6 = *(int *)(local_18 + 8 + (int)piVar4);

                      iVar2 = local_24;

                    }

                    iVar2 = iVar2 + 1;

                  } while (iVar2 < iVar6);

                  local_4c = piVar11;

                  iVar3 = *param_3;

                  iVar7 = local_30;

                }

                iVar7 = iVar7 + 1;

              } while (iVar7 < iVar3);

              psVar9 = *(short **)(param_1 + 0x4834);

              piVar5 = local_4c;

            }

            if ((*piVar5 != 0) && (iVar3 = local_3c, local_40 != 0)) {

              do {

                *psVar9 = *psVar9 + -0x80;

                psVar9 = psVar9 + 1;

                iVar3 = iVar3 + -1;

              } while (iVar3 != -1);

              psVar9 = *(short **)(param_1 + 0x4834);

              piVar5 = *(int **)(param_1 + 0x4ddc);

            }

          }

          iVar7 = local_54;

          iVar3 = local_60;

          if (((piVar5 == (int *)0x0) || (*piVar5 != 0)) && (0 < local_54)) {

            iVar6 = 0;

            local_5c = psVar9;

            do {

              (**(code **)(iVar3 + 0x44))(psVar9);

              psVar9 = psVar9 + 0x40;

              iVar6 = iVar6 + 1;

            } while (iVar6 < iVar7);

            local_60 = iVar3;

            psVar9 = local_5c;

          }

          iVar2 = 0;

          iVar3 = *param_3;

          piVar5 = param_3;

          if (0 < iVar3) {

            do {

              iVar7 = local_60;

              if (0 < aiStack_a4[iVar2]) {

                local_58 = piVar5 + 9;

                local_50 = piVar5;

                iVar3 = 0;

                do {

                  if ((*(int **)(param_1 + 0x4ddc) == (int *)0x0) ||

                     (**(int **)(param_1 + 0x4ddc) != 0)) {

                    (**(code **)(iVar7 + 0x104))(psVar9,aiStack_74[iVar2]);

                  }

                  iVar6 = (**(code **)(iVar7 + 0xf0))

                                    (param_2,aiStack_94[iVar2],aiStack_84[iVar2],local_58,psVar9);

                  if (iVar6 != 0) goto LAB_0064c102;

                  psVar9 = psVar9 + 0x40;

                  iVar3 = iVar3 + 1;

                } while (iVar3 < aiStack_a4[iVar2]);

                local_64 = iVar6;

                local_60 = iVar7;

                iVar3 = *param_3;

                piVar5 = local_50;

              }

              iVar2 = iVar2 + 1;

              piVar5 = piVar5 + 1;

            } while (iVar2 < iVar3);

          }

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

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

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

            iVar3 = (local_44 + 1) % *(int *)(param_1 + 0x78);

            param_3[7] = iVar3;

            if (iVar3 == 0) {

              param_3[8] = local_48 + 1;

            }

            else {

              param_3[8] = local_48;

            }

            iVar7 = local_60;

            iVar6 = 1;

            goto LAB_0064c102;

          }

          local_44 = local_44 + 1;

          local_14 = *(int *)(param_1 + 0x78);

        } while (local_44 < *(int *)(param_1 + 0x78));

        local_1c = iVar3;

        piVar5 = *(int **)(param_1 + 0x7c);

        iVar2 = local_48;

      }

      iVar2 = iVar2 + 1;

      iVar7 = local_60;

      iVar6 = local_64;

    } while (iVar2 < (int)piVar5);

  }

LAB_0064c102:

  (**(code **)(iVar7 + 0x18))();

  return iVar6;

}





// --- FUN_0064c1a0 at 0x0064C1A0 (size: 844) ---


undefined4 FUN_0064c1a0(int param_1)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int *piVar4;

  int iVar5;

  int iVar6;

  short *psVar7;

  short *psVar8;

  int iVar9;

  int aiStack_7c [4];

  undefined4 auStack_6c [4];

  int local_5c;

  int local_58;

  short *local_54;

  int local_50;

  int *local_4c;

  int local_48;

  int local_44;

  int local_40;

  int local_3c;

  int local_38;

  int local_34;

  int local_30;

  int local_2c;

  int local_28;

  int local_24;

  int local_20;

  int local_1c;

  int local_18;

  

  iVar6 = 0;

  local_1c = *(int *)(param_1 + 0x37f0);

  iVar1 = 0;

  local_18 = *(int *)(param_1 + 0x4de4);

  iVar2 = *(int *)(param_1 + 0x37c0);

  if (0 < iVar2) {

    iVar5 = *(int *)(param_1 + 0x37cc);

    do {

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

      iVar9 = *(int *)(iVar5 + 8) * *(int *)(iVar5 + 4);

      iVar1 = iVar1 + iVar9;

      iVar5 = iVar5 + 0x10;

      aiStack_7c[iVar6] = iVar9;

      auStack_6c[iVar6] = *(undefined4 *)(param_1 + 0x36e4 + iVar3 * 4);

      iVar6 = iVar6 + 1;

    } while (iVar6 < iVar2);

  }

  local_48 = 0;

  iVar2 = *(int *)(param_1 + 0x7c);

  if (0 < iVar2) {

    iVar6 = *(int *)(param_1 + 0x78);

    local_20 = iVar1 * 0x40;

    local_24 = iVar1 * 0x40 + -1;

    local_3c = iVar1 << 7;

    local_38 = iVar1;

    do {

      if (0 < iVar6) {

        local_40 = 0;

        do {

          psVar7 = *(short **)(param_1 + 0x4834);

          piVar4 = *(int **)(param_1 + 0x4ddc);

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

            (**(code **)(local_1c + 0x60))(param_1,local_40,local_48);

          }

          else {

            iVar1 = 0;

            iVar2 = *(int *)(param_1 + 0x37c0);

            if (0 < iVar2) {

              iVar5 = *(int *)(param_1 + 0x37cc);

              local_28 = iVar5;

              local_54 = psVar7;

              local_50 = iVar6;

              local_4c = piVar4;

              local_44 = local_40 << 4;

              do {

                iVar3 = 0;

                local_5c = iVar1 * 0x10;

                iVar6 = *(int *)(local_5c + 8 + iVar5);

                if (0 < iVar6) {

                  iVar2 = *(int *)(local_5c + 4 + iVar5);

                  local_58 = iVar1 * 2;

                  local_34 = iVar1;

                  piVar4 = local_4c;

                  do {

                    iVar9 = 0;

                    iVar1 = local_50;

                    if (0 < iVar2) {

                      while( true ) {

                        local_2c = iVar3;

                        iVar6 = iVar6 * iVar1 * 0x80 * local_48 * iVar2 +

                                *(int *)((int)piVar4 + local_58 * 2 + 4) + local_44 * iVar2 +

                                iVar2 * iVar1 * 0x80 * local_2c + iVar9 * 0x10;

                        iVar3 = 0;

                        psVar7 = local_54;

                        local_30 = iVar9;

                        do {

                          (*DAT_008f85a8)(psVar7,iVar6,0x10);

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

                          iVar5 = *(int *)(param_1 + 0x37cc);

                          iVar2 = *(int *)(local_5c + 4 + iVar5);

                          iVar6 = iVar6 + iVar1 * 0x10 * iVar2;

                          psVar7 = psVar7 + 8;

                          iVar3 = iVar3 + 1;

                        } while (iVar3 < 8);

                        local_54 = psVar7;

                        iVar9 = local_30 + 1;

                        iVar3 = local_2c;

                        if (iVar2 <= iVar9) break;

                        piVar4 = *(int **)(param_1 + 0x4ddc);

                        iVar6 = *(int *)(local_5c + 8 + iVar5);

                      }

                      local_50 = iVar1;

                      piVar4 = *(int **)(param_1 + 0x4ddc);

                      iVar6 = *(int *)(local_5c + 8 + iVar5);

                    }

                    iVar3 = iVar3 + 1;

                  } while (iVar3 < iVar6);

                  local_4c = piVar4;

                  iVar2 = *(int *)(param_1 + 0x37c0);

                  iVar1 = local_34;

                }

                iVar1 = iVar1 + 1;

              } while (iVar1 < iVar2);

              psVar7 = *(short **)(param_1 + 0x4834);

              piVar4 = local_4c;

            }

            if ((*piVar4 != 0) && (iVar2 = local_24, local_20 != 0)) {

              do {

                *psVar7 = *psVar7 + -0x80;

                psVar7 = psVar7 + 1;

                iVar2 = iVar2 + -1;

              } while (iVar2 != -1);

              psVar7 = *(short **)(param_1 + 0x4834);

            }

          }

          iVar1 = local_1c;

          iVar2 = local_38;

          iVar6 = 0;

          psVar8 = psVar7;

          if (0 < local_38) {

            do {

              local_54 = psVar8;

              (**(code **)(iVar1 + 0x44))(psVar7);

              psVar7 = psVar7 + 0x40;

              iVar6 = iVar6 + 1;

              psVar8 = local_54;

            } while (iVar6 < iVar2);

          }

          iVar1 = local_1c;

          iVar6 = 0;

          iVar2 = *(int *)(param_1 + 0x37c0);

          if (0 < iVar2) {

            do {

              iVar5 = 0;

              if (0 < aiStack_7c[iVar6]) {

                do {

                  (**(code **)(iVar1 + 0x104))(psVar8,auStack_6c[iVar6]);

                  psVar8 = psVar8 + 0x40;

                  iVar5 = iVar5 + 1;

                } while (iVar5 < aiStack_7c[iVar6]);

                iVar2 = *(int *)(param_1 + 0x37c0);

              }

              iVar6 = iVar6 + 1;

            } while (iVar6 < iVar2);

          }

          (*DAT_008f85a8)(local_18,*(undefined4 *)(param_1 + 0x4834),local_3c);

          local_40 = local_40 + 1;

          iVar6 = *(int *)(param_1 + 0x78);

          local_18 = local_18 + local_3c;

        } while (local_40 < iVar6);

        iVar2 = *(int *)(param_1 + 0x7c);

      }

      local_48 = local_48 + 1;

    } while (local_48 < iVar2);

  }

  return 0;

}





// --- FUN_0064c500 at 0x0064C500 (size: 1483) ---


undefined4 FUN_0064c500(int param_1,int param_2,int *param_3,int param_4)



{

  int *piVar1;

  int iVar2;

  int iVar3;

  int *piVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  int iVar8;

  undefined1 local_44c [1000];

  undefined4 local_64;

  int aiStack_60 [4];

  int local_50;

  int *local_4c;

  int local_48;

  int local_44;

  int local_40;

  int *local_3c;

  int local_38;

  int local_34;

  int *local_30;

  int local_2c;

  int local_28;

  int local_24;

  int local_20;

  int local_1c;

  int local_18;

  

  local_50 = *(int *)(param_2 + 8);

  iVar5 = 0;

  iVar3 = *(int *)(param_1 + 0x37c0);

  local_64 = 0;

  if (0 < iVar3) {

    iVar6 = *(int *)(param_1 + 0x37cc);

    iVar2 = 0;

    iVar7 = 0;

    do {

      iVar8 = *(int *)(iVar2 + 8 + iVar6) * *(int *)(iVar2 + 4 + iVar6);

      aiStack_60[iVar7] = iVar8;

      iVar5 = iVar5 + iVar8;

      iVar2 = iVar2 + 0x10;

      iVar7 = iVar7 + 1;

    } while (iVar7 < iVar3);

  }

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

  iVar3 = iVar5 * 0x40 * (int)piVar1;

  if ((param_3[2] == 0) && (param_3[3] == 0)) {

    piVar4 = (int *)0x0;

    iVar6 = *(int *)(param_1 + 0x7c);

    if (0 < iVar6) {

      local_44 = iVar5 * 0x80;

      local_40 = iVar3 * 2;

      do {

        iVar3 = 0;

        if (0 < (int)piVar1) {

          iVar5 = *param_3;

          iVar6 = 0;

          local_34 = local_40 * (int)piVar4;

          local_30 = piVar4;

          do {

            iVar2 = 0;

            if (0 < iVar5) {

              local_28 = *(int *)(param_1 + 0x4de4) + local_34 + iVar6;

              local_38 = iVar6;

              local_2c = iVar3;

              piVar1 = param_3;

              do {

                iVar3 = 0;

                if (0 < aiStack_60[iVar2]) {

                  local_4c = piVar1 + 9;

                  local_48 = param_1 + iVar2;

                  iVar5 = local_28;

                  local_3c = piVar1;

                  do {

                    FUN_0061fab0(*(char *)(local_48 + 0x37a0) * 0x404 + param_4,local_4c,iVar5,

                                 param_3[4],param_3[5]);

                    iVar5 = iVar5 + 0x80;

                    iVar3 = iVar3 + 1;

                  } while (iVar3 < aiStack_60[iVar2]);

                  local_28 = iVar5;

                  iVar5 = *param_3;

                  piVar1 = local_3c;

                }

                piVar1 = piVar1 + 1;

                iVar2 = iVar2 + 1;

              } while (iVar2 < iVar5);

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

              iVar6 = local_38;

              iVar3 = local_2c;

            }

            iVar6 = iVar6 + local_44;

            iVar3 = iVar3 + 1;

          } while (iVar3 < (int)piVar1);

          iVar6 = *(int *)(param_1 + 0x7c);

          piVar4 = local_30;

        }

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

      } while ((int)piVar4 < iVar6);

    }

  }

  else {

    local_30 = (int *)param_3[0xd];

    iVar6 = *local_30;

    local_2c = (int)*(char *)(iVar6 + 0x379c + param_1);

    iVar2 = 0;

    local_34 = 0;

    if (0 < iVar6) {

      if (5 < iVar6) {

        local_34 = 0;

        local_28 = iVar6 + -6;

        do {

          local_34 = local_34 + aiStack_60[iVar2] + aiStack_60[iVar2 + 1] + aiStack_60[iVar2 + 2] +

                     aiStack_60[iVar2 + 3] + aiStack_60[iVar2 + 4];

          iVar2 = iVar2 + 5;

        } while (iVar2 <= iVar6 + -6);

      }

      do {

        local_34 = local_34 + aiStack_60[iVar2];

        iVar2 = iVar2 + 1;

      } while (iVar2 < iVar6);

    }

    local_28 = 0;

    iVar6 = *(int *)(param_1 + 0x7c);

    if (iVar6 < 1) {

      iVar5 = param_4 + local_2c * 0x404;

    }

    else {

      iVar7 = local_30[2];

      iVar3 = iVar3 * 2;

      local_24 = param_4 + local_2c * 0x404;

      local_44 = iVar5 * 0x80;

      local_34 = local_34 << 7;

      iVar2 = 0;

      local_3c = piVar1;

      local_38 = iVar7;

      do {

        iVar5 = 0;

        if (0 < iVar7) {

          local_20 = iVar3 * iVar2;

          piVar4 = (int *)0x0;

          piVar1 = local_3c;

          local_40 = iVar3;

          local_28 = iVar2;

          do {

            if (*(int *)(param_1 + 0x50) <= (int)(iVar7 * 8 * local_28 + (int)piVar4)) {

              iVar6 = *(int *)(param_1 + 0x7c);

              iVar3 = local_40;

              iVar2 = local_28;

              local_3c = piVar1;

              goto LAB_0064ca30;

            }

            if (0 < (int)piVar1) {

              iVar3 = local_30[1];

              iVar6 = 0;

              local_18 = 0;

              local_4c = piVar4;

              local_2c = iVar3;

              local_1c = iVar5;

              do {

                iVar2 = iVar7 * 0x80 * local_1c + local_34 +

                        *(int *)(param_1 + 0x4de4) + local_20 + iVar6;

                iVar5 = 0;

                if (0 < iVar3) {

                  iVar7 = 0;

                  local_48 = iVar6;

                  do {

                    if (*(int *)(param_1 + 0x4c) <= iVar3 * 8 * local_18 + iVar7) {

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

                      iVar7 = local_30[2];

                      iVar6 = local_48;

                      goto LAB_0064c9e0;

                    }

                    if (param_3[4] == 0) {

                      FUN_0061ff40(param_2,iVar2,param_3[2],param_3[3],param_3[5],local_24);

                    }

                    else {

                      FUN_00620080(param_2,iVar2,param_3[2],param_3[3],param_3[5],local_44c,

                                   &local_64,local_24);

                    }

                    iVar2 = iVar2 + 0x80;

                    iVar7 = iVar7 + 8;

                    iVar5 = iVar5 + 1;

                    local_30 = (int *)param_3[0xd];

                    iVar3 = local_30[1];

                  } while (iVar5 < iVar3);

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

                  iVar7 = local_30[2];

                  iVar6 = local_48;

                }

LAB_0064c9e0:

                iVar6 = iVar6 + local_44;

                local_18 = local_18 + 1;

                iVar5 = local_1c;

                piVar4 = local_4c;

              } while (local_18 < (int)piVar1);

            }

            piVar4 = piVar4 + 2;

            iVar5 = iVar5 + 1;

          } while (iVar5 < iVar7);

          iVar6 = *(int *)(param_1 + 0x7c);

          iVar3 = local_40;

          iVar2 = local_28;

          local_3c = piVar1;

        }

LAB_0064ca30:

        iVar2 = iVar2 + 1;

        iVar5 = local_24;

      } while (iVar2 < iVar6);

    }

    FUN_0061fc30(param_2,iVar5);

    local_64 = 0;

  }

  (**(code **)(local_50 + 0x18))();

  return 0;

}





// --- FUN_0064cae0 at 0x0064CAE0 (size: 1847) ---


undefined4 FUN_0064cae0(int param_1,char *param_2,int *param_3)



{

  char cVar1;

  undefined1 *puVar2;

  int iVar3;

  int iVar4;

  int *piVar5;

  int iVar6;

  int *piVar7;

  char *pcVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  undefined1 local_44c [1000];

  undefined4 local_64;

  int aiStack_60 [4];

  int local_50;

  int local_4c;

  int local_48;

  int local_44;

  int local_40;

  int local_3c;

  int *local_38;

  int local_34;

  int *local_30;

  int local_2c;

  int *local_28;

  int local_24;

  int local_20;

  int local_1c;

  int local_18;

  undefined4 local_14;

  

  local_14 = 0;

  iVar9 = 0;

  local_18 = *(int *)(param_2 + 8);

  iVar11 = 0;

  iVar10 = *(int *)(param_1 + 0x37c0);

  local_64 = 0;

  if (0 < iVar10) {

    iVar4 = *(int *)(param_1 + 0x37cc);

    iVar3 = 0;

    iVar11 = 0;

    do {

      iVar6 = *(int *)(iVar3 + 8 + iVar4) * *(int *)(iVar3 + 4 + iVar4);

      aiStack_60[iVar9] = iVar6;

      iVar11 = iVar11 + iVar6;

      iVar3 = iVar3 + 0x10;

      iVar9 = iVar9 + 1;

    } while (iVar9 < iVar10);

  }

  iVar9 = 0;

  iVar10 = iVar11 * 0x40 * *(int *)(param_1 + 0x78);

  if (0 < *param_3) {

    iVar4 = 0;

    local_4c = iVar11 * 0x40;

    local_48 = iVar10;

    do {

      iVar3 = *(int *)(iVar4 + param_3[0xd]);

      param_3[iVar9 + 9] = 0;

      iVar9 = iVar9 + 1;

      *(undefined4 *)(iVar4 + 0xc + param_3[0xd]) =

           *(undefined4 *)(param_1 + 0x3704 + *(char *)(iVar3 + 0x37a0 + param_1) * 4);

      *(undefined4 *)(iVar4 + 0x10 + param_3[0xd]) =

           *(undefined4 *)(param_1 + 0x36f4 + *(char *)(iVar3 + 0x379c + param_1) * 4);

      iVar4 = iVar4 + 0x18;

    } while (iVar9 < *param_3);

  }

  iVar9 = 8;

  param_2[0xc] = '\b';

  param_2[0xd] = '\0';

  param_2[0xe] = '\0';

  param_2[0xf] = '\0';

  if ((param_3[2] == 0) && (param_3[3] == 0)) {

    local_44 = 0;

    iVar4 = *(int *)(param_1 + 0x7c);

    local_40 = iVar4;

    if (0 < iVar4) {

      iVar9 = *(int *)(param_1 + 0x78);

      local_4c = iVar11 << 7;

      local_48 = iVar10 * 2;

      iVar10 = 0;

      do {

        iVar11 = 0;

        if (0 < iVar9) {

          iVar4 = *param_3;

          iVar3 = 0;

          local_20 = local_48 * iVar10;

          local_44 = iVar10;

          do {

            iVar10 = 0;

            iVar6 = *(int *)(param_1 + 0x4de4) + local_20 + iVar3;

            if (0 < iVar4) {

              local_24 = iVar3;

              local_1c = iVar11;

              piVar7 = param_3;

              do {

                if (0 < aiStack_60[iVar10]) {

                  local_28 = piVar7 + 9;

                  local_2c = iVar10 * 0x18;

                  iVar9 = 0;

                  local_30 = piVar7;

                  do {

                    FUN_0061faf0(param_2,*(undefined4 *)(local_2c + 0xc + param_3[0xd]),local_28,

                                 iVar6,param_3[4],param_3[5]);

                    iVar6 = iVar6 + 0x80;

                    iVar9 = iVar9 + 1;

                  } while (iVar9 < aiStack_60[iVar10]);

                  iVar4 = *param_3;

                  piVar7 = local_30;

                }

                piVar7 = piVar7 + 1;

                iVar10 = iVar10 + 1;

              } while (iVar10 < iVar4);

              iVar9 = *(int *)(param_1 + 0x78);

              iVar3 = local_24;

              iVar11 = local_1c;

            }

            iVar3 = iVar3 + local_4c;

            iVar11 = iVar11 + 1;

          } while (iVar11 < iVar9);

          iVar4 = *(int *)(param_1 + 0x7c);

          iVar10 = local_44;

        }

        iVar10 = iVar10 + 1;

      } while (iVar10 < iVar4);

      iVar9 = *(int *)(param_2 + 0xc);

    }

  }

  else {

    local_38 = (int *)param_3[0xd];

    iVar9 = *local_38;

    local_44 = 0;

    iVar4 = 0;

    local_40 = 0;

    if (0 < iVar9) {

      if (5 < iVar9) {

        local_44 = 0;

        local_3c = iVar9 + -6;

        iVar4 = 0;

        do {

          iVar4 = iVar4 + aiStack_60[local_44] + aiStack_60[local_44 + 1] + aiStack_60[local_44 + 2]

                  + aiStack_60[local_44 + 3] + aiStack_60[local_44 + 4];

          local_44 = local_44 + 5;

        } while (local_44 <= iVar9 + -6);

        local_40 = iVar4;

      }

      do {

        iVar4 = iVar4 + aiStack_60[local_44];

        local_44 = local_44 + 1;

        local_40 = iVar4;

      } while (local_44 < iVar9);

    }

    local_44 = 0;

    iVar9 = *(int *)(param_1 + 0x7c);

    if (0 < iVar9) {

      iVar4 = local_38[2];

      iVar10 = iVar10 * 2;

      local_4c = iVar11 << 7;

      local_40 = local_40 << 7;

      iVar11 = 0;

      local_3c = iVar4;

      do {

        iVar3 = 0;

        if (0 < iVar4) {

          local_24 = iVar10 * iVar11;

          piVar5 = (int *)0x0;

          piVar7 = local_38;

          local_48 = iVar10;

          local_44 = iVar11;

          do {

            if (*(int *)(param_1 + 0x50) <= (int)(iVar4 * 8 * local_44 + (int)piVar5)) {

              iVar9 = *(int *)(param_1 + 0x7c);

              iVar11 = local_44;

              iVar10 = local_48;

              local_38 = piVar7;

              goto LAB_0064d0d3;

            }

            local_34 = 0;

            iVar10 = *(int *)(param_1 + 0x78);

            if (0 < iVar10) {

              iVar9 = piVar7[1];

              local_30 = (int *)0x0;

              local_2c = iVar9;

              local_28 = piVar5;

              local_20 = iVar3;

              do {

                iVar11 = (int)local_30 +

                         iVar4 * 0x80 * local_20 + local_40 + *(int *)(param_1 + 0x4de4) + local_24;

                local_1c = 0;

                if (0 < iVar9) {

                  iVar10 = 0;

                  do {

                    if (*(int *)(param_1 + 0x4c) <= iVar9 * 8 * local_34 + iVar10) {

                      iVar10 = *(int *)(param_1 + 0x78);

                      iVar4 = piVar7[2];

                      goto LAB_0064d075;

                    }

                    if (param_3[4] == 0) {

                      FUN_006202f0(param_2,piVar7[4],iVar11,param_3[2],param_3[3],param_3[5]);

                    }

                    else {

                      FUN_006204f0(param_2,piVar7[4],iVar11,param_3[2],param_3[3],param_3[5],

                                   local_44c,&local_64);

                    }

                    iVar11 = iVar11 + 0x80;

                    iVar10 = iVar10 + 8;

                    local_1c = local_1c + 1;

                    piVar7 = (int *)param_3[0xd];

                    iVar9 = piVar7[1];

                  } while (local_1c < iVar9);

                  iVar10 = *(int *)(param_1 + 0x78);

                  iVar4 = piVar7[2];

                }

LAB_0064d075:

                local_34 = local_34 + 1;

                local_30 = (int *)((int)local_30 + local_4c);

                piVar5 = local_28;

                iVar3 = local_20;

              } while (local_34 < iVar10);

            }

            piVar5 = piVar5 + 2;

            iVar3 = iVar3 + 1;

          } while (iVar3 < iVar4);

          iVar9 = *(int *)(param_1 + 0x7c);

          iVar11 = local_44;

          iVar10 = local_48;

          local_38 = piVar7;

        }

LAB_0064d0d3:

        iVar11 = iVar11 + 1;

      } while (iVar11 < iVar9);

    }

    FUN_0061fc90(param_2,local_38[4]);

    FUN_0061fed0(param_2,local_44c,&local_64);

    local_64 = 0;

    iVar9 = *(int *)(param_2 + 0xc);

  }

  if (7 < iVar9) goto LAB_0064d1d3;

  pcVar8 = *(char **)(param_2 + 0x10);

  if (*(char **)(param_2 + 0x18) <= pcVar8) {

    if (*(int *)(param_2 + 0x3c) == 0) {

      local_14 = 0xffffffe4;

      goto LAB_0064d1d3;

    }

    iVar10 = FUN_00619550(*(int *)(param_2 + 0x3c),param_2 + 0x40,0x1000,aiStack_60 + 4);

    if ((iVar10 == 0) || (local_50 != 0x1000)) {

      local_14 = 0xffffffe9;

      goto LAB_0064d1d3;

    }

    pcVar8 = *(char **)(param_2 + 0x14);

  }

  cVar1 = *param_2;

  *(char **)(param_2 + 0x10) = pcVar8 + 1;

  *pcVar8 = cVar1;

  *(int *)(param_2 + 0x1c) = *(int *)(param_2 + 0x1c) + 1;

  if (cVar1 == -1) {

    puVar2 = *(undefined1 **)(param_2 + 0x10);

    *(undefined1 **)(param_2 + 0x10) = puVar2 + 1;

    *puVar2 = 0;

    *(int *)(param_2 + 0x1c) = *(int *)(param_2 + 0x1c) + 1;

  }

  iVar10 = *(int *)(param_2 + 0x34);

  param_2[0] = '\0';

  param_2[1] = '\0';

  param_2[2] = '\0';

  param_2[3] = '\0';

  param_2[4] = '\0';

  param_2[5] = '\0';

  param_2[6] = '\0';

  param_2[7] = '\0';

  if (iVar10 < 3) {

    param_2[0xc] = '\b';

    param_2[0xd] = '\0';

    param_2[0xe] = '\0';

    param_2[0xf] = '\0';

  }

  else {

    param_2[0xc] = '\0';

    param_2[0xd] = '\0';

    param_2[0xe] = '\0';

    param_2[0xf] = '\0';

  }

LAB_0064d1d3:

  (**(code **)(local_18 + 0x18))();

  return local_14;

}





// --- FUN_0064d230 at 0x0064D230 (size: 1501) ---


int FUN_0064d230(int param_1,int param_2,int *param_3)



{

  int iVar1;

  int iVar2;

  int *piVar3;

  int iVar4;

  int iVar5;

  int iVar6;

  int *piVar7;

  short *psVar8;

  int iVar9;

  uint uVar10;

  int aiStack_a4 [4];

  undefined4 auStack_94 [4];

  undefined4 auStack_84 [4];

  undefined4 auStack_74 [4];

  int local_64;

  int local_60;

  int local_5c;

  int local_58;

  int local_54;

  short *local_50;

  int local_4c;

  int local_48;

  int local_44;

  int local_40;

  int local_3c;

  int local_38;

  int local_34;

  int local_30;

  int *local_2c;

  int *local_28;

  int local_24;

  int local_20;

  int local_1c;

  int local_18;

  int local_14;

  

  local_3c = 0;

  iVar1 = 0;

  local_30 = *param_3;

  iVar9 = *(int *)(param_2 + 8);

  iVar4 = 0;

  if (0 < *param_3) {

    iVar9 = 0;

    iVar5 = 0;

    local_5c = 0;

    iVar4 = 0;

    local_58 = *(int *)(param_2 + 8);

    do {

      if (*(int *)(param_1 + 0x37e0) == 0) {

        param_3[iVar1 + 9] = 0;

        local_30 = *param_3;

      }

      iVar6 = *(int *)(iVar9 + 8 + param_3[0xd]) * *(int *)(iVar9 + 4 + param_3[0xd]);

      iVar4 = iVar4 + iVar6;

      iVar9 = iVar9 + 0x18;

      aiStack_a4[iVar1] = iVar6;

      auStack_94[iVar1] =

           *(undefined4 *)(param_1 + 0x3704 + *(char *)(param_1 + 0x37a0 + iVar1) * 4);

      auStack_84[iVar1] =

           *(undefined4 *)(param_1 + 0x36f4 + *(char *)(param_1 + 0x379c + iVar1) * 4);

      iVar6 = iVar5 + 0xc;

      iVar5 = iVar5 + 0x10;

      auStack_74[iVar1] =

           *(undefined4 *)(param_1 + 0x36e4 + *(int *)(iVar6 + *(int *)(param_1 + 0x37cc)) * 4);

      iVar1 = iVar1 + 1;

    } while (iVar1 < local_30);

    local_3c = iVar4;

    iVar9 = local_58;

    iVar4 = local_5c;

  }

  iVar1 = param_3[8];

  iVar5 = *(int *)(param_1 + 0x7c);

  if (iVar1 < iVar5) {

    local_5c = iVar4;

    local_60 = *(int *)(param_1 + 0x78);

    local_58 = iVar9;

    iVar6 = local_3c;

    do {

      local_64 = param_3[7];

      if (param_3[7] < local_60) {

        local_14 = iVar1 << 7;

        local_18 = iVar6 * 0x40 + -1;

        local_1c = iVar6 * 0x40;

        local_20 = iVar1;

        iVar4 = local_30;

        do {

          psVar8 = *(short **)(param_1 + 0x4834);

          piVar3 = *(int **)(param_1 + 0x4ddc);

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

            (**(code **)(local_58 + 0x60))(param_1,local_64,local_20);

            piVar3 = *(int **)(param_1 + 0x4ddc);

          }

          else {

            iVar9 = 0;

            if (0 < iVar4) {

              iVar1 = param_3[0xd];

              local_24 = iVar1;

              local_50 = psVar8;

              local_2c = piVar3;

              local_40 = local_64 << 4;

              do {

                iVar2 = 0;

                iVar6 = iVar9 * 0x18;

                iVar5 = *(int *)(iVar6 + 8 + iVar1);

                if (0 < iVar5) {

                  piVar3 = *(int **)(iVar6 + 4 + iVar1);

                  local_28 = piVar3;

                  local_4c = iVar9 << 4;

                  local_48 = iVar9 * 2;

                  local_54 = iVar6;

                  local_44 = iVar9;

                  piVar7 = local_2c;

                  do {

                    iVar9 = 0;

                    if (0 < (int)piVar3) {

                      local_34 = iVar2 << 7;

                      iVar4 = local_60;

                      local_38 = iVar2;

                      while( true ) {

                        iVar6 = iVar9 * 0x10 + *(int *)((int)piVar7 + local_48 * 2 + 4) +

                                *(int *)(*(int *)(param_1 + 0x37cc) + 4 + local_4c) * local_40 +

                                iVar5 * iVar4 * local_14 * (int)piVar3 +

                                (int)piVar3 * iVar4 * local_34;

                        iVar5 = 0;

                        psVar8 = local_50;

                        local_30 = iVar9;

                        do {

                          (*DAT_008f85a8)(psVar8,iVar6,0x10);

                          iVar4 = *(int *)(param_1 + 0x78);

                          iVar1 = param_3[0xd];

                          piVar3 = *(int **)(local_54 + 4 + iVar1);

                          iVar6 = iVar6 + iVar4 * 0x10 * (int)piVar3;

                          psVar8 = psVar8 + 8;

                          iVar5 = iVar5 + 1;

                        } while (iVar5 < 8);

                        local_50 = psVar8;

                        iVar9 = local_30 + 1;

                        if ((int)piVar3 <= iVar9) break;

                        piVar7 = *(int **)(param_1 + 0x4ddc);

                        iVar5 = *(int *)(local_54 + 8 + iVar1);

                      }

                      local_60 = iVar4;

                      piVar7 = *(int **)(param_1 + 0x4ddc);

                      iVar5 = *(int *)(local_54 + 8 + iVar1);

                      iVar2 = local_38;

                    }

                    iVar2 = iVar2 + 1;

                  } while (iVar2 < iVar5);

                  local_2c = piVar7;

                  iVar4 = *param_3;

                  iVar9 = local_44;

                }

                iVar9 = iVar9 + 1;

              } while (iVar9 < iVar4);

              psVar8 = *(short **)(param_1 + 0x4834);

              piVar3 = local_2c;

            }

            if ((*piVar3 != 0) && (iVar9 = local_18, local_1c != 0)) {

              do {

                *psVar8 = *psVar8 + -0x80;

                psVar8 = psVar8 + 1;

                iVar9 = iVar9 + -1;

              } while (iVar9 != -1);

              psVar8 = *(short **)(param_1 + 0x4834);

              piVar3 = *(int **)(param_1 + 0x4ddc);

            }

          }

          iVar4 = local_3c;

          iVar9 = local_58;

          if (((piVar3 == (int *)0x0) || (*piVar3 != 0)) && (0 < local_3c)) {

            iVar1 = 0;

            local_50 = psVar8;

            do {

              (**(code **)(iVar9 + 0x44))(psVar8);

              psVar8 = psVar8 + 0x40;

              iVar1 = iVar1 + 1;

            } while (iVar1 < iVar4);

            local_58 = iVar9;

            psVar8 = local_50;

          }

          iVar1 = 0;

          iVar4 = *param_3;

          piVar3 = param_3;

          if (0 < iVar4) {

            do {

              iVar9 = local_58;

              iVar5 = 0;

              if (0 < aiStack_a4[iVar1]) {

                local_2c = piVar3 + 9;

                local_28 = piVar3;

                do {

                  if ((*(int **)(param_1 + 0x4ddc) == (int *)0x0) ||

                     (**(int **)(param_1 + 0x4ddc) != 0)) {

                    (**(code **)(iVar9 + 0x104))(psVar8,auStack_74[iVar1]);

                  }

                  iVar4 = (**(code **)(iVar9 + 0xf0))

                                    (param_2,auStack_94[iVar1],auStack_84[iVar1],local_2c,psVar8);

                  if (iVar4 != 0) goto LAB_0064d77c;

                  psVar8 = psVar8 + 0x40;

                  iVar5 = iVar5 + 1;

                } while (iVar5 < aiStack_a4[iVar1]);

                local_5c = iVar4;

                local_58 = iVar9;

                iVar4 = *param_3;

                piVar3 = local_28;

              }

              iVar1 = iVar1 + 1;

              piVar3 = piVar3 + 1;

            } while (iVar1 < iVar4);

          }

          uVar10 = param_3[6] + 1;

          param_3[6] = uVar10;

          if (uVar10 % *(uint *)(param_1 + 0x37d0) == 0) {

            uVar10 = uVar10 / *(uint *)(param_1 + 0x37d0) - 1 & 7;

            if (uVar10 == 7) {

              param_3[6] = 0;

            }

            local_5c = FUN_0064ba60(uVar10,param_2);

            iVar9 = local_58;

            iVar4 = local_5c;

            if (local_5c != 0) goto LAB_0064d77c;

            iVar9 = 0;

            iVar4 = *param_3;

            if (0 < iVar4) {

              do {

                param_3[iVar9 + 9] = 0;

                iVar4 = *param_3;

                iVar9 = iVar9 + 1;

              } while (iVar9 < iVar4);

            }

          }

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

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

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

            iVar9 = (local_64 + 1) % *(int *)(param_1 + 0x78);

            param_3[7] = iVar9;

            if (iVar9 == 0) {

              param_3[8] = local_20 + 1;

            }

            else {

              param_3[8] = local_20;

            }

            iVar9 = local_58;

            iVar4 = 1;

            goto LAB_0064d77c;

          }

          local_64 = local_64 + 1;

          local_60 = *(int *)(param_1 + 0x78);

        } while (local_64 < *(int *)(param_1 + 0x78));

        local_30 = iVar4;

        iVar5 = *(int *)(param_1 + 0x7c);

        iVar6 = local_3c;

        iVar1 = local_20;

      }

      iVar1 = iVar1 + 1;

      iVar9 = local_58;

      iVar4 = local_5c;

    } while (iVar1 < iVar5);

  }

LAB_0064d77c:

  (**(code **)(iVar9 + 0x18))();

  return iVar4;

}





// --- FUN_0064d830 at 0x0064D830 (size: 735) ---


undefined8 __fastcall

FUN_0064d830(undefined4 param_1,undefined4 param_2,undefined8 *param_3,undefined8 *param_4)



{

  short sVar1;

  short sVar2;

  short sVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined4 in_EAX;

  undefined8 uVar6;

  undefined8 uVar7;

  undefined8 uVar8;

  undefined8 uVar9;

  short sVar10;

  short sVar11;

  short sVar12;

  short sVar13;

  short sVar14;

  short sVar15;

  short sVar16;

  short sVar17;

  

  uVar5 = DAT_00833350;

  uVar4 = DAT_00833348;

  uVar6 = param_3[0xf];

  uVar7 = param_3[0xe];

  sVar10 = (short)DAT_00833340;

  sVar11 = (short)((ulonglong)DAT_00833340 >> 0x10);

  sVar12 = (short)((ulonglong)DAT_00833340 >> 0x20);

  sVar13 = (short)((ulonglong)DAT_00833340 >> 0x30);

  uVar6 = paddusw(CONCAT26((short)((ulonglong)uVar6 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar6 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar6 >> 0x10) + sVar11,

                                             (short)uVar6 + sVar10))),DAT_00833348);

  uVar6 = psubusw(uVar6,DAT_00833350);

  uVar7 = paddusw(CONCAT26((short)((ulonglong)uVar7 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar7 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar7 >> 0x10) + sVar11,

                                             (short)uVar7 + sVar10))),DAT_00833348);

  sVar14 = (short)DAT_00833358;

  sVar15 = (short)((ulonglong)DAT_00833358 >> 0x10);

  sVar16 = (short)((ulonglong)DAT_00833358 >> 0x20);

  sVar17 = (short)((ulonglong)DAT_00833358 >> 0x30);

  uVar8 = psubusw(uVar7,DAT_00833350);

  uVar6 = psllw(CONCAT26((short)((ulonglong)uVar6 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar6 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar6 >> 0x10) + sVar15,

                                           (short)uVar6 + sVar14))),2);

  uVar7 = pmulhw(uVar6,param_4[0xf]);

  uVar6 = psllw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar15,

                                           (short)uVar8 + sVar14))),2);

  uVar9 = pmulhw(uVar6,param_4[0xe]);

  uVar6 = param_4[0xd];

  sVar1 = (short)((ulonglong)DAT_00833360 >> 0x10);

  sVar2 = (short)((ulonglong)DAT_00833360 >> 0x20);

  sVar3 = (short)((ulonglong)DAT_00833360 >> 0x30);

  uVar8 = psraw(CONCAT26((short)((ulonglong)uVar7 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar7 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar7 >> 0x10) + sVar1,

                                           (short)uVar7 + (short)DAT_00833360))),1);

  uVar7 = param_4[0xc];

  uVar9 = psraw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar1,

                                           (short)uVar9 + (short)DAT_00833360))),1);

  param_3[0xf] = uVar8;

  param_3[0xe] = uVar9;

  uVar8 = param_3[0xd];

  uVar9 = param_3[0xc];

  uVar8 = paddusw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar11,

                                             (short)uVar8 + sVar10))),uVar4);

  uVar8 = psubusw(uVar8,uVar5);

  uVar9 = paddusw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar11,

                                             (short)uVar9 + sVar10))),uVar4);

  uVar9 = psubusw(uVar9,uVar5);

  uVar8 = psllw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar15,

                                           (short)uVar8 + sVar14))),2);

  uVar8 = pmulhw(uVar8,uVar6);

  uVar6 = psllw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar15,

                                           (short)uVar9 + sVar14))),2);

  uVar9 = pmulhw(uVar6,uVar7);

  uVar6 = param_4[0xb];

  sVar1 = (short)((ulonglong)DAT_00833360 >> 0x10);

  sVar2 = (short)((ulonglong)DAT_00833360 >> 0x20);

  sVar3 = (short)((ulonglong)DAT_00833360 >> 0x30);

  uVar8 = psraw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar1,

                                           (short)uVar8 + (short)DAT_00833360))),1);

  uVar7 = param_4[10];

  uVar9 = psraw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar1,

                                           (short)uVar9 + (short)DAT_00833360))),1);

  param_3[0xd] = uVar8;

  param_3[0xc] = uVar9;

  uVar8 = param_3[0xb];

  uVar9 = param_3[10];

  uVar8 = paddusw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar11,

                                             (short)uVar8 + sVar10))),uVar4);

  uVar8 = psubusw(uVar8,uVar5);

  uVar9 = paddusw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar11,

                                             (short)uVar9 + sVar10))),uVar4);

  uVar9 = psubusw(uVar9,uVar5);

  uVar8 = psllw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar15,

                                           (short)uVar8 + sVar14))),2);

  uVar8 = pmulhw(uVar8,uVar6);

  uVar6 = psllw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar15,

                                           (short)uVar9 + sVar14))),2);

  uVar9 = pmulhw(uVar6,uVar7);

  uVar6 = param_4[9];

  sVar1 = (short)((ulonglong)DAT_00833360 >> 0x10);

  sVar2 = (short)((ulonglong)DAT_00833360 >> 0x20);

  sVar3 = (short)((ulonglong)DAT_00833360 >> 0x30);

  uVar8 = psraw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar1,

                                           (short)uVar8 + (short)DAT_00833360))),1);

  uVar7 = param_4[8];

  uVar9 = psraw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar1,

                                           (short)uVar9 + (short)DAT_00833360))),1);

  param_3[0xb] = uVar8;

  param_3[10] = uVar9;

  uVar8 = param_3[9];

  uVar9 = param_3[8];

  uVar8 = paddusw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar11,

                                             (short)uVar8 + sVar10))),uVar4);

  uVar8 = psubusw(uVar8,uVar5);

  uVar9 = paddusw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar11,

                                             (short)uVar9 + sVar10))),uVar4);

  uVar9 = psubusw(uVar9,uVar5);

  uVar8 = psllw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar15,

                                           (short)uVar8 + sVar14))),2);

  uVar8 = pmulhw(uVar8,uVar6);

  uVar6 = psllw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar15,

                                           (short)uVar9 + sVar14))),2);

  uVar9 = pmulhw(uVar6,uVar7);

  uVar6 = param_4[7];

  sVar1 = (short)((ulonglong)DAT_00833360 >> 0x10);

  sVar2 = (short)((ulonglong)DAT_00833360 >> 0x20);

  sVar3 = (short)((ulonglong)DAT_00833360 >> 0x30);

  uVar8 = psraw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar1,

                                           (short)uVar8 + (short)DAT_00833360))),1);

  uVar7 = param_4[6];

  uVar9 = psraw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar1,

                                           (short)uVar9 + (short)DAT_00833360))),1);

  param_3[9] = uVar8;

  param_3[8] = uVar9;

  uVar8 = param_3[7];

  uVar9 = param_3[6];

  uVar8 = paddusw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar11,

                                             (short)uVar8 + sVar10))),uVar4);

  uVar8 = psubusw(uVar8,uVar5);

  uVar9 = paddusw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar11,

                                             (short)uVar9 + sVar10))),uVar4);

  uVar9 = psubusw(uVar9,uVar5);

  uVar8 = psllw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar15,

                                           (short)uVar8 + sVar14))),2);

  uVar8 = pmulhw(uVar8,uVar6);

  uVar6 = psllw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar15,

                                           (short)uVar9 + sVar14))),2);

  uVar9 = pmulhw(uVar6,uVar7);

  uVar6 = param_4[5];

  sVar1 = (short)((ulonglong)DAT_00833360 >> 0x10);

  sVar2 = (short)((ulonglong)DAT_00833360 >> 0x20);

  sVar3 = (short)((ulonglong)DAT_00833360 >> 0x30);

  uVar8 = psraw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar1,

                                           (short)uVar8 + (short)DAT_00833360))),1);

  uVar7 = param_4[4];

  uVar9 = psraw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar1,

                                           (short)uVar9 + (short)DAT_00833360))),1);

  param_3[7] = uVar8;

  param_3[6] = uVar9;

  uVar8 = param_3[5];

  uVar9 = param_3[4];

  uVar8 = paddusw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar11,

                                             (short)uVar8 + sVar10))),uVar4);

  uVar8 = psubusw(uVar8,uVar5);

  uVar9 = paddusw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar11,

                                             (short)uVar9 + sVar10))),uVar4);

  uVar9 = psubusw(uVar9,uVar5);

  uVar8 = psllw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar15,

                                           (short)uVar8 + sVar14))),2);

  uVar8 = pmulhw(uVar8,uVar6);

  uVar6 = psllw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar15,

                                           (short)uVar9 + sVar14))),2);

  uVar9 = pmulhw(uVar6,uVar7);

  uVar6 = param_4[3];

  sVar1 = (short)((ulonglong)DAT_00833360 >> 0x10);

  sVar2 = (short)((ulonglong)DAT_00833360 >> 0x20);

  sVar3 = (short)((ulonglong)DAT_00833360 >> 0x30);

  uVar8 = psraw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar1,

                                           (short)uVar8 + (short)DAT_00833360))),1);

  uVar7 = param_4[2];

  uVar9 = psraw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar1,

                                           (short)uVar9 + (short)DAT_00833360))),1);

  param_3[5] = uVar8;

  param_3[4] = uVar9;

  uVar8 = param_3[3];

  uVar9 = param_3[2];

  uVar8 = paddusw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar11,

                                             (short)uVar8 + sVar10))),uVar4);

  uVar8 = psubusw(uVar8,uVar5);

  uVar9 = paddusw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar11,

                                             (short)uVar9 + sVar10))),uVar4);

  uVar9 = psubusw(uVar9,uVar5);

  uVar8 = psllw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar15,

                                           (short)uVar8 + sVar14))),2);

  uVar8 = pmulhw(uVar8,uVar6);

  uVar6 = psllw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar15,

                                           (short)uVar9 + sVar14))),2);

  uVar9 = pmulhw(uVar6,uVar7);

  uVar6 = param_4[1];

  sVar1 = (short)((ulonglong)DAT_00833360 >> 0x10);

  sVar2 = (short)((ulonglong)DAT_00833360 >> 0x20);

  sVar3 = (short)((ulonglong)DAT_00833360 >> 0x30);

  uVar8 = psraw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar1,

                                           (short)uVar8 + (short)DAT_00833360))),1);

  uVar7 = *param_4;

  uVar9 = psraw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar1,

                                           (short)uVar9 + (short)DAT_00833360))),1);

  param_3[3] = uVar8;

  param_3[2] = uVar9;

  uVar8 = param_3[1];

  uVar9 = *param_3;

  uVar8 = paddusw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar11,

                                             (short)uVar8 + sVar10))),uVar4);

  uVar8 = psubusw(uVar8,uVar5);

  uVar9 = paddusw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar13,

                           CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar12,

                                    CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar11,

                                             (short)uVar9 + sVar10))),uVar4);

  uVar9 = psubusw(uVar9,uVar5);

  uVar8 = psllw(CONCAT26((short)((ulonglong)uVar8 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar8 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar8 >> 0x10) + sVar15,

                                           (short)uVar8 + sVar14))),2);

  uVar6 = pmulhw(uVar8,uVar6);

  uVar8 = psllw(CONCAT26((short)((ulonglong)uVar9 >> 0x30) + sVar17,

                         CONCAT24((short)((ulonglong)uVar9 >> 0x20) + sVar16,

                                  CONCAT22((short)((ulonglong)uVar9 >> 0x10) + sVar15,

                                           (short)uVar9 + sVar14))),2);

  uVar7 = pmulhw(uVar8,uVar7);

  sVar1 = (short)((ulonglong)DAT_00833360 >> 0x10);

  sVar2 = (short)((ulonglong)DAT_00833360 >> 0x20);

  sVar3 = (short)((ulonglong)DAT_00833360 >> 0x30);

  uVar6 = psraw(CONCAT26((short)((ulonglong)uVar6 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar6 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar6 >> 0x10) + sVar1,

                                           (short)uVar6 + (short)DAT_00833360))),1);

  uVar7 = psraw(CONCAT26((short)((ulonglong)uVar7 >> 0x30) + sVar3,

                         CONCAT24((short)((ulonglong)uVar7 >> 0x20) + sVar2,

                                  CONCAT22((short)((ulonglong)uVar7 >> 0x10) + sVar1,

                                           (short)uVar7 + (short)DAT_00833360))),1);

  param_3[1] = uVar6;

  *param_3 = uVar7;

  return CONCAT44(param_2,in_EAX);

}





// --- FUN_0064db10 at 0x0064DB10 (size: 1453) ---


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



undefined8 __fastcall FUN_0064db10(undefined4 param_1,undefined4 param_2,undefined8 *param_3)



{

  undefined8 uVar1;

  undefined8 uVar2;

  undefined4 in_EAX;

  short sVar3;

  undefined4 uVar4;

  short sVar7;

  short sVar8;

  short sVar9;

  undefined8 uVar5;

  undefined8 uVar6;

  short sVar11;

  short sVar12;

  short sVar13;

  undefined8 uVar10;

  short sVar14;

  short sVar16;

  short sVar17;

  short sVar18;

  undefined8 uVar15;

  short sVar19;

  short sVar20;

  short sVar21;

  short sVar22;

  short sVar23;

  short sVar24;

  undefined4 uVar25;

  undefined4 uVar26;

  short sVar28;

  short sVar29;

  short sVar30;

  short sVar31;

  short sVar32;

  short sVar33;

  undefined8 uVar27;

  short sVar34;

  short sVar35;

  short sVar36;

  short sVar37;

  short sVar38;

  undefined4 uVar39;

  undefined4 uVar40;

  short sVar42;

  short sVar43;

  short sVar44;

  undefined8 uVar41;

  

  uVar5 = param_3[9];

  uVar15 = param_3[0xb];

  uVar10 = param_3[0xd];

  uVar27 = param_3[0xf];

  uVar4 = CONCAT22((short)((ulonglong)uVar15 >> 0x20),(short)((ulonglong)uVar5 >> 0x20));

  uVar6 = param_3[8];

  uVar25 = CONCAT22((short)((ulonglong)uVar27 >> 0x20),(short)((ulonglong)uVar10 >> 0x20));

  param_3[0xb] = CONCAT44(CONCAT22((short)((ulonglong)uVar27 >> 0x10),

                                   (short)((ulonglong)uVar10 >> 0x10)),

                          CONCAT22((short)((ulonglong)uVar15 >> 0x10),

                                   (short)((ulonglong)uVar5 >> 0x10)));

  uVar41 = param_3[10];

  param_3[9] = CONCAT44(CONCAT22((short)uVar27,(short)uVar10),CONCAT22((short)uVar15,(short)uVar5));

  uVar1 = param_3[0xe];

  param_3[0xf] = CONCAT44((int)(CONCAT26((short)((ulonglong)uVar27 >> 0x30),

                                         CONCAT24((short)((ulonglong)uVar10 >> 0x30),uVar25)) >>

                               0x20),

                          (int)(CONCAT26((short)((ulonglong)uVar15 >> 0x30),

                                         CONCAT24((short)((ulonglong)uVar5 >> 0x30),uVar4)) >> 0x20)

                         );

  uVar5 = param_3[0xc];

  param_3[0xd] = CONCAT44(uVar25,uVar4);

  uVar4 = CONCAT22((short)((ulonglong)uVar41 >> 0x20),(short)((ulonglong)uVar6 >> 0x20));

  uVar15 = param_3[1];

  uVar25 = CONCAT22((short)((ulonglong)uVar1 >> 0x20),(short)((ulonglong)uVar5 >> 0x20));

  uVar10 = param_3[5];

  param_3[1] = CONCAT44(CONCAT22((short)uVar1,(short)uVar5),CONCAT22((short)uVar41,(short)uVar6));

  uVar27 = param_3[3];

  param_3[3] = CONCAT44(CONCAT22((short)((ulonglong)uVar1 >> 0x10),(short)((ulonglong)uVar5 >> 0x10)

                                ),

                        CONCAT22((short)((ulonglong)uVar41 >> 0x10),

                                 (short)((ulonglong)uVar6 >> 0x10)));

  param_3[5] = CONCAT44(uVar25,uVar4);

  uVar2 = param_3[7];

  param_3[7] = CONCAT44((int)(CONCAT26((short)((ulonglong)uVar1 >> 0x30),

                                       CONCAT24((short)((ulonglong)uVar5 >> 0x30),uVar25)) >> 0x20),

                        (int)(CONCAT26((short)((ulonglong)uVar41 >> 0x30),

                                       CONCAT24((short)((ulonglong)uVar6 >> 0x30),uVar4)) >> 0x20));

  uVar4 = CONCAT22((short)((ulonglong)uVar27 >> 0x20),(short)((ulonglong)uVar15 >> 0x20));

  uVar5 = *param_3;

  uVar6 = param_3[2];

  uVar25 = CONCAT22((short)((ulonglong)uVar2 >> 0x20),(short)((ulonglong)uVar10 >> 0x20));

  param_3[8] = CONCAT44(CONCAT22((short)uVar2,(short)uVar10),CONCAT22((short)uVar27,(short)uVar15));

  uVar41 = param_3[4];

  param_3[10] = CONCAT44(CONCAT22((short)((ulonglong)uVar2 >> 0x10),

                                  (short)((ulonglong)uVar10 >> 0x10)),

                         CONCAT22((short)((ulonglong)uVar27 >> 0x10),

                                  (short)((ulonglong)uVar15 >> 0x10)));

  param_3[0xe] = CONCAT44((int)(CONCAT26((short)((ulonglong)uVar2 >> 0x30),

                                         CONCAT24((short)((ulonglong)uVar10 >> 0x30),uVar25)) >>

                               0x20),

                          (int)(CONCAT26((short)((ulonglong)uVar27 >> 0x30),

                                         CONCAT24((short)((ulonglong)uVar15 >> 0x30),uVar4)) >> 0x20

                               ));

  param_3[0xc] = CONCAT44(uVar25,uVar4);

  sVar7 = (short)((ulonglong)uVar6 >> 0x10);

  sVar3 = (short)((ulonglong)uVar5 >> 0x10);

  uVar15 = param_3[6];

  sVar23 = (short)((ulonglong)uVar5 >> 0x20);

  sVar28 = (short)((ulonglong)uVar6 >> 0x20);

  uVar25 = CONCAT22(sVar28,sVar23);

  sVar19 = (short)((ulonglong)uVar5 >> 0x30);

  sVar20 = (short)((ulonglong)uVar6 >> 0x30);

  sVar9 = (short)((ulonglong)uVar15 >> 0x10);

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

  sVar30 = (short)((ulonglong)uVar41 >> 0x20);

  sVar32 = (short)((ulonglong)uVar15 >> 0x20);

  uVar4 = CONCAT22(sVar32,sVar30);

  sVar21 = (short)((ulonglong)uVar41 >> 0x30);

  sVar22 = (short)((ulonglong)uVar15 >> 0x30);

  uVar10 = param_3[0xe];

  uVar27 = param_3[8];

  *param_3 = CONCAT44(CONCAT22((short)uVar15,(short)uVar41),CONCAT22((short)uVar6,(short)uVar5));

  param_3[2] = CONCAT44(CONCAT22(sVar9,sVar8),CONCAT22(sVar7,sVar3));

  sVar34 = (short)uVar5 + (short)uVar10;

  sVar35 = (short)uVar6 + (short)((ulonglong)uVar10 >> 0x10);

  sVar36 = (short)uVar41 + (short)((ulonglong)uVar10 >> 0x20);

  sVar37 = (short)uVar15 + (short)((ulonglong)uVar10 >> 0x30);

  param_3[4] = CONCAT44(uVar4,uVar25);

  param_3[6] = CONCAT44((int)(CONCAT26(sVar22,CONCAT24(sVar21,uVar4)) >> 0x20),

                        (int)(CONCAT26(sVar20,CONCAT24(sVar19,uVar25)) >> 0x20));

  sVar19 = sVar19 + (short)uVar27;

  sVar20 = sVar20 + (short)((ulonglong)uVar27 >> 0x10);

  sVar21 = sVar21 + (short)((ulonglong)uVar27 >> 0x20);

  sVar22 = sVar22 + (short)((ulonglong)uVar27 >> 0x30);

  uVar5 = param_3[0xc];

  sVar3 = sVar3 + (short)uVar5;

  sVar7 = sVar7 + (short)((ulonglong)uVar5 >> 0x10);

  sVar8 = sVar8 + (short)((ulonglong)uVar5 >> 0x20);

  sVar9 = sVar9 + (short)((ulonglong)uVar5 >> 0x30);

  sVar38 = sVar34 - sVar19;

  sVar42 = sVar35 - sVar20;

  sVar43 = sVar36 - sVar21;

  sVar44 = sVar37 - sVar22;

  uVar5 = param_3[10];

  sVar23 = sVar23 + (short)uVar5;

  sVar28 = sVar28 + (short)((ulonglong)uVar5 >> 0x10);

  sVar30 = sVar30 + (short)((ulonglong)uVar5 >> 0x20);

  sVar32 = sVar32 + (short)((ulonglong)uVar5 >> 0x30);

  sVar34 = sVar34 + sVar19;

  sVar35 = sVar35 + sVar20;

  sVar36 = sVar36 + sVar21;

  sVar37 = sVar37 + sVar22;

  sVar21 = sVar3 + sVar23;

  sVar20 = sVar7 + sVar28;

  sVar11 = sVar8 + sVar30;

  sVar12 = sVar9 + sVar32;

  uVar5 = psllw(CONCAT26((sVar9 - sVar32) + sVar44,

                         CONCAT24((sVar8 - sVar30) + sVar43,

                                  CONCAT22((sVar7 - sVar28) + sVar42,(sVar3 - sVar23) + sVar38))),1)

  ;

  uVar6 = pmulhw(uVar5,_DAT_00833330);

  uVar5 = param_3[6];

  uVar15 = param_3[8];

  uVar10 = param_3[4];

  sVar7 = (short)((ulonglong)uVar6 >> 0x10);

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

  sVar22 = (short)((ulonglong)uVar6 >> 0x30);

  uVar27 = param_3[10];

  sVar14 = (short)uVar10 - (short)uVar27;

  sVar16 = (short)((ulonglong)uVar10 >> 0x10) - (short)((ulonglong)uVar27 >> 0x10);

  sVar17 = (short)((ulonglong)uVar10 >> 0x20) - (short)((ulonglong)uVar27 >> 0x20);

  sVar18 = (short)((ulonglong)uVar10 >> 0x30) - (short)((ulonglong)uVar27 >> 0x30);

  uVar10 = param_3[2];

  sVar24 = ((short)uVar5 - (short)uVar15) + sVar14;

  sVar29 = ((short)((ulonglong)uVar5 >> 0x10) - (short)((ulonglong)uVar15 >> 0x10)) + sVar16;

  sVar31 = ((short)((ulonglong)uVar5 >> 0x20) - (short)((ulonglong)uVar15 >> 0x20)) + sVar17;

  sVar33 = ((short)((ulonglong)uVar5 >> 0x30) - (short)((ulonglong)uVar15 >> 0x30)) + sVar18;

  uVar5 = param_3[0xc];

  sVar19 = (short)uVar10 - (short)uVar5;

  sVar28 = (short)((ulonglong)uVar10 >> 0x10) - (short)((ulonglong)uVar5 >> 0x10);

  sVar23 = (short)((ulonglong)uVar10 >> 0x20) - (short)((ulonglong)uVar5 >> 0x20);

  sVar13 = (short)((ulonglong)uVar10 >> 0x30) - (short)((ulonglong)uVar5 >> 0x30);

  uVar5 = *param_3;

  uVar15 = param_3[0xe];

  sVar3 = (short)uVar5 - (short)uVar15;

  sVar8 = (short)((ulonglong)uVar5 >> 0x10) - (short)((ulonglong)uVar15 >> 0x10);

  sVar32 = (short)((ulonglong)uVar5 >> 0x20) - (short)((ulonglong)uVar15 >> 0x20);

  sVar30 = (short)((ulonglong)uVar5 >> 0x30) - (short)((ulonglong)uVar15 >> 0x30);

  uVar5 = psllw(CONCAT26(sVar18 + sVar13,

                         CONCAT24(sVar17 + sVar23,CONCAT22(sVar16 + sVar28,sVar14 + sVar19))),1);

  *param_3 = CONCAT26(sVar37 + sVar12,

                      CONCAT24(sVar36 + sVar11,CONCAT22(sVar35 + sVar20,sVar34 + sVar21)));

  param_3[4] = CONCAT26(sVar44 + sVar22,

                        CONCAT24(sVar43 + sVar9,CONCAT22(sVar42 + sVar7,sVar38 + (short)uVar6)));

  uVar15 = pmulhw(uVar5,_DAT_00833330);

  sVar19 = sVar19 + sVar3;

  sVar28 = sVar28 + sVar8;

  sVar23 = sVar23 + sVar32;

  sVar13 = sVar13 + sVar30;

  param_3[8] = CONCAT26(sVar37 - sVar12,

                        CONCAT24(sVar36 - sVar11,CONCAT22(sVar35 - sVar20,sVar34 - sVar21)));

  uVar27 = pmulhw(CONCAT26(sVar33 - sVar13,

                           CONCAT24(sVar31 - sVar23,CONCAT22(sVar29 - sVar28,sVar24 - sVar19))),

                  _DAT_00833320);

  uVar5 = psllw(CONCAT26(sVar33,CONCAT24(sVar31,CONCAT22(sVar29,sVar24))),1);

  uVar41 = pmulhw(uVar5,_DAT_00833328);

  uVar5 = psllw(CONCAT26(sVar13,CONCAT24(sVar23,CONCAT22(sVar28,sVar19))),2);

  uVar10 = pmulhw(uVar5,_DAT_00833338);

  sVar23 = sVar3 - (short)uVar15;

  sVar21 = (short)((ulonglong)uVar15 >> 0x10);

  sVar12 = sVar8 - sVar21;

  sVar19 = (short)((ulonglong)uVar15 >> 0x20);

  sVar13 = sVar32 - sVar19;

  sVar20 = (short)((ulonglong)uVar15 >> 0x30);

  sVar14 = sVar30 - sVar20;

  param_3[0xc] = CONCAT26(sVar44 - sVar22,

                          CONCAT24(sVar43 - sVar9,CONCAT22(sVar42 - sVar7,sVar38 - (short)uVar6)));

  sVar3 = sVar3 + (short)uVar15;

  sVar8 = sVar8 + sVar21;

  sVar32 = sVar32 + sVar19;

  sVar30 = sVar30 + sVar20;

  uVar5 = param_3[7];

  sVar16 = (short)uVar41 + (short)uVar27;

  sVar22 = (short)((ulonglong)uVar27 >> 0x10);

  sVar17 = (short)((ulonglong)uVar41 >> 0x10) + sVar22;

  sVar19 = (short)((ulonglong)uVar27 >> 0x20);

  sVar18 = (short)((ulonglong)uVar41 >> 0x20) + sVar19;

  sVar28 = (short)((ulonglong)uVar27 >> 0x30);

  sVar24 = (short)((ulonglong)uVar41 >> 0x30) + sVar28;

  uVar15 = param_3[9];

  sVar9 = (short)uVar5 + (short)uVar15;

  sVar21 = (short)((ulonglong)uVar5 >> 0x10) + (short)((ulonglong)uVar15 >> 0x10);

  sVar20 = (short)((ulonglong)uVar5 >> 0x20) + (short)((ulonglong)uVar15 >> 0x20);

  sVar11 = (short)((ulonglong)uVar5 >> 0x30) + (short)((ulonglong)uVar15 >> 0x30);

  sVar7 = (short)uVar10 + (short)uVar27;

  sVar22 = (short)((ulonglong)uVar10 >> 0x10) + sVar22;

  sVar19 = (short)((ulonglong)uVar10 >> 0x20) + sVar19;

  sVar28 = (short)((ulonglong)uVar10 >> 0x30) + sVar28;

  uVar5 = param_3[1];

  uVar15 = param_3[0xf];

  sVar29 = (short)uVar5 + (short)uVar15;

  sVar33 = (short)((ulonglong)uVar5 >> 0x10) + (short)((ulonglong)uVar15 >> 0x10);

  sVar35 = (short)((ulonglong)uVar5 >> 0x20) + (short)((ulonglong)uVar15 >> 0x20);

  sVar37 = (short)((ulonglong)uVar5 >> 0x30) + (short)((ulonglong)uVar15 >> 0x30);

  param_3[10] = CONCAT26(sVar14 + sVar24,

                         CONCAT24(sVar13 + sVar18,CONCAT22(sVar12 + sVar17,sVar23 + sVar16)));

  param_3[6] = CONCAT26(sVar14 - sVar24,

                        CONCAT24(sVar13 - sVar18,CONCAT22(sVar12 - sVar17,sVar23 - sVar16)));

  uVar5 = param_3[3];

  uVar15 = param_3[0xd];

  sVar23 = (short)uVar5 + (short)uVar15;

  sVar13 = (short)((ulonglong)uVar5 >> 0x10) + (short)((ulonglong)uVar15 >> 0x10);

  sVar16 = (short)((ulonglong)uVar5 >> 0x20) + (short)((ulonglong)uVar15 >> 0x20);

  sVar18 = (short)((ulonglong)uVar5 >> 0x30) + (short)((ulonglong)uVar15 >> 0x30);

  sVar31 = sVar29 + sVar9;

  sVar34 = sVar33 + sVar21;

  sVar36 = sVar35 + sVar20;

  sVar38 = sVar37 + sVar11;

  uVar5 = param_3[5];

  sVar29 = sVar29 - sVar9;

  sVar33 = sVar33 - sVar21;

  sVar35 = sVar35 - sVar20;

  sVar37 = sVar37 - sVar11;

  uVar15 = param_3[0xb];

  sVar9 = (short)uVar5 + (short)uVar15;

  sVar21 = (short)((ulonglong)uVar5 >> 0x10) + (short)((ulonglong)uVar15 >> 0x10);

  sVar20 = (short)((ulonglong)uVar5 >> 0x20) + (short)((ulonglong)uVar15 >> 0x20);

  sVar11 = (short)((ulonglong)uVar5 >> 0x30) + (short)((ulonglong)uVar15 >> 0x30);

  sVar12 = sVar23 + sVar9;

  sVar14 = sVar13 + sVar21;

  sVar17 = sVar16 + sVar20;

  sVar24 = sVar18 + sVar11;

  param_3[2] = CONCAT26(sVar30 + sVar28,

                        CONCAT24(sVar32 + sVar19,CONCAT22(sVar8 + sVar22,sVar3 + sVar7)));

  param_3[0xe] = CONCAT26(sVar30 - sVar28,

                          CONCAT24(sVar32 - sVar19,CONCAT22(sVar8 - sVar22,sVar3 - sVar7)));

  uVar5 = psllw(CONCAT26((sVar18 - sVar11) + sVar37,

                         CONCAT24((sVar16 - sVar20) + sVar35,

                                  CONCAT22((sVar13 - sVar21) + sVar33,(sVar23 - sVar9) + sVar29))),1

               );

  uVar6 = pmulhw(uVar5,_DAT_00833330);

  uVar5 = param_3[7];

  uVar15 = param_3[9];

  uVar10 = param_3[5];

  uVar27 = param_3[0xb];

  sVar3 = (short)uVar10 - (short)uVar27;

  sVar7 = (short)((ulonglong)uVar10 >> 0x10) - (short)((ulonglong)uVar27 >> 0x10);

  sVar8 = (short)((ulonglong)uVar10 >> 0x20) - (short)((ulonglong)uVar27 >> 0x20);

  sVar9 = (short)((ulonglong)uVar10 >> 0x30) - (short)((ulonglong)uVar27 >> 0x30);

  sVar42 = (short)((ulonglong)uVar6 >> 0x10);

  sVar43 = (short)((ulonglong)uVar6 >> 0x20);

  sVar44 = (short)((ulonglong)uVar6 >> 0x30);

  uVar10 = param_3[3];

  uVar27 = param_3[0xd];

  sVar19 = (short)uVar10 - (short)uVar27;

  sVar20 = (short)((ulonglong)uVar10 >> 0x10) - (short)((ulonglong)uVar27 >> 0x10);

  sVar28 = (short)((ulonglong)uVar10 >> 0x20) - (short)((ulonglong)uVar27 >> 0x20);

  sVar11 = (short)((ulonglong)uVar10 >> 0x30) - (short)((ulonglong)uVar27 >> 0x30);

  sVar32 = ((short)uVar5 - (short)uVar15) + sVar3;

  sVar22 = ((short)((ulonglong)uVar5 >> 0x10) - (short)((ulonglong)uVar15 >> 0x10)) + sVar7;

  sVar30 = ((short)((ulonglong)uVar5 >> 0x20) - (short)((ulonglong)uVar15 >> 0x20)) + sVar8;

  sVar21 = ((short)((ulonglong)uVar5 >> 0x30) - (short)((ulonglong)uVar15 >> 0x30)) + sVar9;

  uVar5 = param_3[1];

  uVar15 = param_3[0xf];

  sVar23 = (short)uVar5 - (short)uVar15;

  sVar13 = (short)((ulonglong)uVar5 >> 0x10) - (short)((ulonglong)uVar15 >> 0x10);

  sVar16 = (short)((ulonglong)uVar5 >> 0x20) - (short)((ulonglong)uVar15 >> 0x20);

  sVar18 = (short)((ulonglong)uVar5 >> 0x30) - (short)((ulonglong)uVar15 >> 0x30);

  uVar5 = psllw(CONCAT26(sVar9 + sVar11,

                         CONCAT24(sVar8 + sVar28,CONCAT22(sVar7 + sVar20,sVar3 + sVar19))),1);

  param_3[1] = CONCAT26(sVar38 + sVar24,

                        CONCAT24(sVar36 + sVar17,CONCAT22(sVar34 + sVar14,sVar31 + sVar12)));

  param_3[5] = CONCAT26(sVar37 + sVar44,

                        CONCAT24(sVar35 + sVar43,CONCAT22(sVar33 + sVar42,sVar29 + (short)uVar6)));

  uVar5 = pmulhw(uVar5,_DAT_00833330);

  sVar19 = sVar19 + sVar23;

  sVar20 = sVar20 + sVar13;

  sVar28 = sVar28 + sVar16;

  sVar11 = sVar11 + sVar18;

  param_3[9] = CONCAT26(sVar38 - sVar24,

                        CONCAT24(sVar36 - sVar17,CONCAT22(sVar34 - sVar14,sVar31 - sVar12)));

  uVar15 = pmulhw(CONCAT26(sVar21 - sVar11,

                           CONCAT24(sVar30 - sVar28,CONCAT22(sVar22 - sVar20,sVar32 - sVar19))),

                  _DAT_00833320);

  uVar10 = psllw(CONCAT26(sVar21,CONCAT24(sVar30,CONCAT22(sVar22,sVar32))),1);

  uVar27 = pmulhw(uVar10,_DAT_00833328);

  sVar32 = sVar23 + (short)uVar5;

  sVar3 = (short)((ulonglong)uVar5 >> 0x10);

  sVar22 = sVar13 + sVar3;

  sVar7 = (short)((ulonglong)uVar5 >> 0x20);

  sVar30 = sVar16 + sVar7;

  sVar8 = (short)((ulonglong)uVar5 >> 0x30);

  sVar21 = sVar18 + sVar8;

  param_3[0xd] = CONCAT26(sVar37 - sVar44,

                          CONCAT24(sVar35 - sVar43,CONCAT22(sVar33 - sVar42,sVar29 - (short)uVar6)))

  ;

  uVar10 = psllw(CONCAT26(sVar11,CONCAT24(sVar28,CONCAT22(sVar20,sVar19))),2);

  uVar10 = pmulhw(uVar10,_DAT_00833338);

  sVar23 = sVar23 - (short)uVar5;

  sVar13 = sVar13 - sVar3;

  sVar16 = sVar16 - sVar7;

  sVar18 = sVar18 - sVar8;

  sVar19 = (short)uVar27 + (short)uVar15;

  sVar3 = (short)((ulonglong)uVar15 >> 0x10);

  sVar20 = (short)((ulonglong)uVar27 >> 0x10) + sVar3;

  sVar7 = (short)((ulonglong)uVar15 >> 0x20);

  sVar28 = (short)((ulonglong)uVar27 >> 0x20) + sVar7;

  sVar8 = (short)((ulonglong)uVar15 >> 0x30);

  sVar11 = (short)((ulonglong)uVar27 >> 0x30) + sVar8;

  uVar5 = param_3[8];

  sVar9 = (short)uVar10 + (short)uVar15;

  sVar3 = (short)((ulonglong)uVar10 >> 0x10) + sVar3;

  sVar7 = (short)((ulonglong)uVar10 >> 0x20) + sVar7;

  sVar8 = (short)((ulonglong)uVar10 >> 0x30) + sVar8;

  param_3[0xb] = CONCAT26(sVar18 + sVar11,

                          CONCAT24(sVar16 + sVar28,CONCAT22(sVar13 + sVar20,sVar23 + sVar19)));

  uVar15 = param_3[0xe];

  uVar10 = param_3[10];

  uVar27 = param_3[0xc];

  uVar4 = CONCAT22((short)((ulonglong)uVar10 >> 0x20),(short)((ulonglong)uVar5 >> 0x20));

  param_3[0xf] = CONCAT26(sVar21 - sVar8,

                          CONCAT24(sVar30 - sVar7,CONCAT22(sVar22 - sVar3,sVar32 - sVar9)));

  uVar25 = CONCAT22((short)((ulonglong)uVar15 >> 0x20),(short)((ulonglong)uVar27 >> 0x20));

  uVar6 = param_3[1];

  param_3[1] = CONCAT44(CONCAT22((short)uVar15,(short)uVar27),CONCAT22((short)uVar10,(short)uVar5));

  param_3[3] = CONCAT44(CONCAT22((short)((ulonglong)uVar15 >> 0x10),

                                 (short)((ulonglong)uVar27 >> 0x10)),

                        CONCAT22((short)((ulonglong)uVar10 >> 0x10),

                                 (short)((ulonglong)uVar5 >> 0x10)));

  uVar41 = param_3[5];

  param_3[5] = CONCAT44(uVar25,uVar4);

  uVar26 = CONCAT22(sVar30 + sVar7,(short)((ulonglong)uVar6 >> 0x20));

  uVar39 = CONCAT22(sVar16 - sVar28,(short)((ulonglong)uVar41 >> 0x20));

  param_3[7] = CONCAT44((int)(CONCAT26((short)((ulonglong)uVar15 >> 0x30),

                                       CONCAT24((short)((ulonglong)uVar27 >> 0x30),uVar25)) >> 0x20)

                        ,(int)(CONCAT26((short)((ulonglong)uVar10 >> 0x30),

                                        CONCAT24((short)((ulonglong)uVar5 >> 0x30),uVar4)) >> 0x20))

  ;

  uVar5 = param_3[0xb];

  uVar15 = param_3[9];

  uVar10 = param_3[0xd];

  param_3[8] = CONCAT44(CONCAT22(sVar23 - sVar19,(short)uVar41),

                        CONCAT22(sVar32 + sVar9,(short)uVar6));

  param_3[10] = CONCAT44(CONCAT22(sVar13 - sVar20,(short)((ulonglong)uVar41 >> 0x10)),

                         CONCAT22(sVar22 + sVar3,(short)((ulonglong)uVar6 >> 0x10)));

  uVar27 = param_3[0xf];

  param_3[0xc] = CONCAT44(uVar39,uVar26);

  uVar40 = CONCAT22((short)((ulonglong)uVar5 >> 0x20),(short)((ulonglong)uVar15 >> 0x20));

  param_3[0xe] = CONCAT44((int)(CONCAT26(sVar18 - sVar11,

                                         CONCAT24((short)((ulonglong)uVar41 >> 0x30),uVar39)) >>

                               0x20),

                          (int)(CONCAT26(sVar21 + sVar8,

                                         CONCAT24((short)((ulonglong)uVar6 >> 0x30),uVar26)) >> 0x20

                               ));

  uVar25 = CONCAT22((short)((ulonglong)uVar27 >> 0x20),(short)((ulonglong)uVar10 >> 0x20));

  uVar6 = *param_3;

  uVar41 = param_3[2];

  param_3[9] = CONCAT44(CONCAT22((short)uVar27,(short)uVar10),CONCAT22((short)uVar5,(short)uVar15));

  param_3[0xb] = CONCAT44(CONCAT22((short)((ulonglong)uVar27 >> 0x10),

                                   (short)((ulonglong)uVar10 >> 0x10)),

                          CONCAT22((short)((ulonglong)uVar5 >> 0x10),

                                   (short)((ulonglong)uVar15 >> 0x10)));

  uVar1 = param_3[6];

  param_3[0xf] = CONCAT44((int)(CONCAT26((short)((ulonglong)uVar27 >> 0x30),

                                         CONCAT24((short)((ulonglong)uVar10 >> 0x30),uVar25)) >>

                               0x20),

                          (int)(CONCAT26((short)((ulonglong)uVar5 >> 0x30),

                                         CONCAT24((short)((ulonglong)uVar15 >> 0x30),uVar40)) >>

                               0x20));

  sVar11 = (short)((ulonglong)uVar41 >> 0x10);

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

  uVar5 = param_3[4];

  sVar17 = (short)((ulonglong)uVar6 >> 0x20);

  sVar18 = (short)((ulonglong)uVar41 >> 0x20);

  uVar4 = CONCAT22(sVar18,sVar17);

  sVar23 = (short)((ulonglong)uVar6 >> 0x30);

  sVar14 = (short)((ulonglong)uVar41 >> 0x30);

  sVar28 = (short)((ulonglong)uVar1 >> 0x10);

  sVar13 = (short)((ulonglong)uVar5 >> 0x10);

  param_3[0xd] = CONCAT44(uVar25,uVar40);

  sVar24 = (short)((ulonglong)uVar5 >> 0x20);

  sVar12 = (short)((ulonglong)uVar1 >> 0x20);

  uVar25 = CONCAT22(sVar12,sVar24);

  sVar16 = (short)((ulonglong)uVar5 >> 0x30);

  sVar20 = (short)((ulonglong)uVar1 >> 0x30);

  uVar15 = param_3[8];

  *param_3 = CONCAT44(CONCAT22((short)uVar1,(short)uVar5),CONCAT22((short)uVar41,(short)uVar6));

  uVar10 = param_3[0xe];

  sVar3 = (short)uVar6 + (short)uVar10;

  sVar9 = (short)uVar41 + (short)((ulonglong)uVar10 >> 0x10);

  sVar22 = (short)uVar5 + (short)((ulonglong)uVar10 >> 0x20);

  sVar21 = (short)uVar1 + (short)((ulonglong)uVar10 >> 0x30);

  param_3[2] = CONCAT44(CONCAT22(sVar28,sVar13),CONCAT22(sVar11,sVar8));

  param_3[6] = CONCAT44((int)(CONCAT26(sVar20,CONCAT24(sVar16,uVar25)) >> 0x20),

                        (int)(CONCAT26(sVar14,CONCAT24(sVar23,uVar4)) >> 0x20));

  uVar5 = param_3[0xc];

  sVar8 = sVar8 + (short)uVar5;

  sVar11 = sVar11 + (short)((ulonglong)uVar5 >> 0x10);

  sVar13 = sVar13 + (short)((ulonglong)uVar5 >> 0x20);

  sVar28 = sVar28 + (short)((ulonglong)uVar5 >> 0x30);

  sVar23 = sVar23 + (short)uVar15;

  sVar14 = sVar14 + (short)((ulonglong)uVar15 >> 0x10);

  sVar16 = sVar16 + (short)((ulonglong)uVar15 >> 0x20);

  sVar20 = sVar20 + (short)((ulonglong)uVar15 >> 0x30);

  param_3[4] = CONCAT44(uVar25,uVar4);

  sVar7 = sVar3 + sVar23;

  sVar32 = sVar9 + sVar14;

  sVar30 = sVar22 + sVar16;

  sVar19 = sVar21 + sVar20;

  uVar5 = param_3[10];

  sVar17 = sVar17 + (short)uVar5;

  sVar18 = sVar18 + (short)((ulonglong)uVar5 >> 0x10);

  sVar24 = sVar24 + (short)((ulonglong)uVar5 >> 0x20);

  sVar12 = sVar12 + (short)((ulonglong)uVar5 >> 0x30);

  sVar3 = sVar3 - sVar23;

  sVar9 = sVar9 - sVar14;

  sVar22 = sVar22 - sVar16;

  sVar21 = sVar21 - sVar20;

  uVar5 = param_3[4];

  sVar20 = sVar8 + sVar17;

  sVar23 = sVar11 + sVar18;

  sVar14 = sVar13 + sVar24;

  sVar16 = sVar28 + sVar12;

  uVar15 = param_3[6];

  uVar10 = param_3[8];

  param_3[8] = CONCAT26(sVar19 - sVar16,

                        CONCAT24(sVar30 - sVar14,CONCAT22(sVar32 - sVar23,sVar7 - sVar20)));

  uVar6 = psllw(CONCAT26((sVar28 - sVar12) + sVar21,

                         CONCAT24((sVar13 - sVar24) + sVar22,

                                  CONCAT22((sVar11 - sVar18) + sVar9,(sVar8 - sVar17) + sVar3))),1);

  uVar27 = param_3[2];

  uVar41 = pmulhw(uVar6,_DAT_00833330);

  uVar6 = param_3[10];

  sVar17 = (short)uVar5 - (short)uVar6;

  sVar18 = (short)((ulonglong)uVar5 >> 0x10) - (short)((ulonglong)uVar6 >> 0x10);

  sVar24 = (short)((ulonglong)uVar5 >> 0x20) - (short)((ulonglong)uVar6 >> 0x20);

  sVar35 = (short)((ulonglong)uVar5 >> 0x30) - (short)((ulonglong)uVar6 >> 0x30);

  uVar5 = *param_3;

  sVar28 = ((short)uVar15 - (short)uVar10) + sVar17;

  sVar11 = ((short)((ulonglong)uVar15 >> 0x10) - (short)((ulonglong)uVar10 >> 0x10)) + sVar18;

  sVar12 = ((short)((ulonglong)uVar15 >> 0x20) - (short)((ulonglong)uVar10 >> 0x20)) + sVar24;

  sVar13 = ((short)((ulonglong)uVar15 >> 0x30) - (short)((ulonglong)uVar10 >> 0x30)) + sVar35;

  *param_3 = CONCAT26(sVar19 + sVar16,

                      CONCAT24(sVar30 + sVar14,CONCAT22(sVar32 + sVar23,sVar7 + sVar20)));

  sVar23 = (short)((ulonglong)uVar41 >> 0x10);

  sVar14 = (short)((ulonglong)uVar41 >> 0x20);

  sVar16 = (short)((ulonglong)uVar41 >> 0x30);

  uVar15 = param_3[0xc];

  sVar7 = (short)uVar27 - (short)uVar15;

  sVar8 = (short)((ulonglong)uVar27 >> 0x10) - (short)((ulonglong)uVar15 >> 0x10);

  sVar32 = (short)((ulonglong)uVar27 >> 0x20) - (short)((ulonglong)uVar15 >> 0x20);

  sVar30 = (short)((ulonglong)uVar27 >> 0x30) - (short)((ulonglong)uVar15 >> 0x30);

  param_3[4] = CONCAT26(sVar21 + sVar16,

                        CONCAT24(sVar22 + sVar14,CONCAT22(sVar9 + sVar23,sVar3 + (short)uVar41)));

  uVar15 = param_3[0xe];

  sVar29 = (short)uVar5 - (short)uVar15;

  sVar31 = (short)((ulonglong)uVar5 >> 0x10) - (short)((ulonglong)uVar15 >> 0x10);

  sVar33 = (short)((ulonglong)uVar5 >> 0x20) - (short)((ulonglong)uVar15 >> 0x20);

  sVar34 = (short)((ulonglong)uVar5 >> 0x30) - (short)((ulonglong)uVar15 >> 0x30);

  uVar5 = psllw(CONCAT26(sVar35 + sVar30,

                         CONCAT24(sVar24 + sVar32,CONCAT22(sVar18 + sVar8,sVar17 + sVar7))),1);

  uVar10 = pmulhw(uVar5,_DAT_00833330);

  sVar7 = sVar7 + sVar29;

  sVar8 = sVar8 + sVar31;

  sVar32 = sVar32 + sVar33;

  sVar30 = sVar30 + sVar34;

  uVar27 = psllw(CONCAT26(sVar13,CONCAT24(sVar12,CONCAT22(sVar11,sVar28))),1);

  uVar15 = pmulhw(CONCAT26(sVar13 - sVar30,

                           CONCAT24(sVar12 - sVar32,CONCAT22(sVar11 - sVar8,sVar28 - sVar7))),

                  _DAT_00833320);

  uVar5 = psllw(CONCAT26(sVar30,CONCAT24(sVar32,CONCAT22(sVar8,sVar7))),2);

  uVar27 = pmulhw(uVar27,_DAT_00833328);

  sVar7 = sVar29 - (short)uVar10;

  sVar19 = (short)((ulonglong)uVar10 >> 0x10);

  sVar8 = sVar31 - sVar19;

  sVar20 = (short)((ulonglong)uVar10 >> 0x20);

  sVar32 = sVar33 - sVar20;

  sVar28 = (short)((ulonglong)uVar10 >> 0x30);

  sVar30 = sVar34 - sVar28;

  uVar5 = pmulhw(uVar5,_DAT_00833338);

  param_3[0xc] = CONCAT26(sVar21 - sVar16,

                          CONCAT24(sVar22 - sVar14,CONCAT22(sVar9 - sVar23,sVar3 - (short)uVar41)));

  sVar29 = sVar29 + (short)uVar10;

  sVar31 = sVar31 + sVar19;

  sVar33 = sVar33 + sVar20;

  sVar34 = sVar34 + sVar28;

  sVar3 = (short)uVar27 + (short)uVar15;

  sVar28 = (short)((ulonglong)uVar15 >> 0x10);

  sVar9 = (short)((ulonglong)uVar27 >> 0x10) + sVar28;

  sVar23 = (short)((ulonglong)uVar15 >> 0x20);

  sVar22 = (short)((ulonglong)uVar27 >> 0x20) + sVar23;

  sVar13 = (short)((ulonglong)uVar15 >> 0x30);

  sVar21 = (short)((ulonglong)uVar27 >> 0x30) + sVar13;

  sVar19 = (short)uVar5 + (short)uVar15;

  sVar28 = (short)((ulonglong)uVar5 >> 0x10) + sVar28;

  sVar23 = (short)((ulonglong)uVar5 >> 0x20) + sVar23;

  sVar13 = (short)((ulonglong)uVar5 >> 0x30) + sVar13;

  param_3[6] = CONCAT26(sVar30 - sVar21,

                        CONCAT24(sVar32 - sVar22,CONCAT22(sVar8 - sVar9,sVar7 - sVar3)));

  uVar5 = param_3[3];

  uVar15 = param_3[0xd];

  sVar35 = (short)uVar5 + (short)uVar15;

  sVar36 = (short)((ulonglong)uVar5 >> 0x10) + (short)((ulonglong)uVar15 >> 0x10);

  sVar37 = (short)((ulonglong)uVar5 >> 0x20) + (short)((ulonglong)uVar15 >> 0x20);

  sVar38 = (short)((ulonglong)uVar5 >> 0x30) + (short)((ulonglong)uVar15 >> 0x30);

  param_3[10] = CONCAT26(sVar30 + sVar21,

                         CONCAT24(sVar32 + sVar22,CONCAT22(sVar8 + sVar9,sVar7 + sVar3)));

  uVar5 = param_3[1];

  uVar15 = param_3[0xf];

  sVar3 = (short)uVar5 + (short)uVar15;

  sVar8 = (short)((ulonglong)uVar5 >> 0x10) + (short)((ulonglong)uVar15 >> 0x10);

  sVar32 = (short)((ulonglong)uVar5 >> 0x20) + (short)((ulonglong)uVar15 >> 0x20);

  sVar30 = (short)((ulonglong)uVar5 >> 0x30) + (short)((ulonglong)uVar15 >> 0x30);

  param_3[2] = CONCAT26(sVar34 + sVar13,

                        CONCAT24(sVar33 + sVar23,CONCAT22(sVar31 + sVar28,sVar29 + sVar19)));

  uVar5 = param_3[7];

  uVar15 = param_3[9];

  sVar20 = (short)uVar5 + (short)uVar15;

  sVar11 = (short)((ulonglong)uVar5 >> 0x10) + (short)((ulonglong)uVar15 >> 0x10);

  sVar12 = (short)((ulonglong)uVar5 >> 0x20) + (short)((ulonglong)uVar15 >> 0x20);

  sVar14 = (short)((ulonglong)uVar5 >> 0x30) + (short)((ulonglong)uVar15 >> 0x30);

  uVar5 = param_3[5];

  sVar7 = sVar3 + sVar20;

  sVar9 = sVar8 + sVar11;

  sVar22 = sVar32 + sVar12;

  sVar21 = sVar30 + sVar14;

  uVar15 = param_3[0xb];

  sVar16 = (short)uVar5 + (short)uVar15;

  sVar17 = (short)((ulonglong)uVar5 >> 0x10) + (short)((ulonglong)uVar15 >> 0x10);

  sVar18 = (short)((ulonglong)uVar5 >> 0x20) + (short)((ulonglong)uVar15 >> 0x20);

  sVar24 = (short)((ulonglong)uVar5 >> 0x30) + (short)((ulonglong)uVar15 >> 0x30);

  sVar3 = sVar3 - sVar20;

  sVar8 = sVar8 - sVar11;

  sVar32 = sVar32 - sVar12;

  sVar30 = sVar30 - sVar14;

  sVar20 = sVar35 + sVar16;

  sVar11 = sVar36 + sVar17;

  sVar12 = sVar37 + sVar18;

  sVar14 = sVar38 + sVar24;

  param_3[0xe] = CONCAT26(sVar34 - sVar13,

                          CONCAT24(sVar33 - sVar23,CONCAT22(sVar31 - sVar28,sVar29 - sVar19)));

  uVar5 = param_3[7];

  uVar15 = param_3[9];

  uVar10 = psllw(CONCAT26((sVar38 - sVar24) + sVar30,

                          CONCAT24((sVar37 - sVar18) + sVar32,

                                   CONCAT22((sVar36 - sVar17) + sVar8,(sVar35 - sVar16) + sVar3))),1

                );

  uVar6 = pmulhw(uVar10,_DAT_00833330);

  uVar10 = param_3[5];

  uVar27 = param_3[0xb];

  sVar18 = (short)uVar10 - (short)uVar27;

  sVar24 = (short)((ulonglong)uVar10 >> 0x10) - (short)((ulonglong)uVar27 >> 0x10);

  sVar29 = (short)((ulonglong)uVar10 >> 0x20) - (short)((ulonglong)uVar27 >> 0x20);

  sVar31 = (short)((ulonglong)uVar10 >> 0x30) - (short)((ulonglong)uVar27 >> 0x30);

  param_3[9] = CONCAT26(sVar21 - sVar14,

                        CONCAT24(sVar22 - sVar12,CONCAT22(sVar9 - sVar11,sVar7 - sVar20)));

  sVar33 = (short)((ulonglong)uVar6 >> 0x10);

  sVar34 = (short)((ulonglong)uVar6 >> 0x20);

  sVar36 = (short)((ulonglong)uVar6 >> 0x30);

  sVar23 = ((short)uVar5 - (short)uVar15) + sVar18;

  sVar13 = ((short)((ulonglong)uVar5 >> 0x10) - (short)((ulonglong)uVar15 >> 0x10)) + sVar24;

  sVar16 = ((short)((ulonglong)uVar5 >> 0x20) - (short)((ulonglong)uVar15 >> 0x20)) + sVar29;

  sVar17 = ((short)((ulonglong)uVar5 >> 0x30) - (short)((ulonglong)uVar15 >> 0x30)) + sVar31;

  uVar5 = param_3[1];

  param_3[1] = CONCAT26(sVar21 + sVar14,

                        CONCAT24(sVar22 + sVar12,CONCAT22(sVar9 + sVar11,sVar7 + sVar20)));

  uVar15 = param_3[3];

  uVar10 = param_3[0xd];

  sVar7 = (short)uVar15 - (short)uVar10;

  sVar22 = (short)((ulonglong)uVar15 >> 0x10) - (short)((ulonglong)uVar10 >> 0x10);

  sVar19 = (short)((ulonglong)uVar15 >> 0x20) - (short)((ulonglong)uVar10 >> 0x20);

  sVar28 = (short)((ulonglong)uVar15 >> 0x30) - (short)((ulonglong)uVar10 >> 0x30);

  param_3[5] = CONCAT26(sVar30 + sVar36,

                        CONCAT24(sVar32 + sVar34,CONCAT22(sVar8 + sVar33,sVar3 + (short)uVar6)));

  uVar15 = param_3[0xf];

  sVar12 = (short)uVar5 - (short)uVar15;

  sVar14 = (short)((ulonglong)uVar5 >> 0x10) - (short)((ulonglong)uVar15 >> 0x10);

  sVar35 = (short)((ulonglong)uVar5 >> 0x20) - (short)((ulonglong)uVar15 >> 0x20);

  sVar37 = (short)((ulonglong)uVar5 >> 0x30) - (short)((ulonglong)uVar15 >> 0x30);

  sVar9 = sVar7 + sVar12;

  sVar21 = sVar22 + sVar14;

  sVar20 = sVar19 + sVar35;

  sVar11 = sVar28 + sVar37;

  uVar5 = psllw(CONCAT26(sVar31 + sVar28,

                         CONCAT24(sVar29 + sVar19,CONCAT22(sVar24 + sVar22,sVar18 + sVar7))),1);

  uVar10 = pmulhw(uVar5,_DAT_00833330);

  uVar15 = pmulhw(CONCAT26(sVar17 - sVar11,

                           CONCAT24(sVar16 - sVar20,CONCAT22(sVar13 - sVar21,sVar23 - sVar9))),

                  _DAT_00833320);

  uVar5 = psllw(CONCAT26(sVar17,CONCAT24(sVar16,CONCAT22(sVar13,sVar23))),1);

  uVar27 = pmulhw(uVar5,_DAT_00833328);

  uVar5 = psllw(CONCAT26(sVar11,CONCAT24(sVar20,CONCAT22(sVar21,sVar9))),2);

  param_3[0xd] = CONCAT26(sVar30 - sVar36,

                          CONCAT24(sVar32 - sVar34,CONCAT22(sVar8 - sVar33,sVar3 - (short)uVar6)));

  uVar5 = pmulhw(uVar5,_DAT_00833338);

  sVar3 = sVar12 - (short)uVar10;

  sVar32 = (short)((ulonglong)uVar10 >> 0x10);

  sVar7 = sVar14 - sVar32;

  sVar19 = (short)((ulonglong)uVar10 >> 0x20);

  sVar8 = sVar35 - sVar19;

  sVar20 = (short)((ulonglong)uVar10 >> 0x30);

  sVar9 = sVar37 - sVar20;

  sVar28 = (short)uVar27 + (short)uVar15;

  sVar22 = (short)((ulonglong)uVar15 >> 0x10);

  sVar11 = (short)((ulonglong)uVar27 >> 0x10) + sVar22;

  sVar30 = (short)((ulonglong)uVar15 >> 0x20);

  sVar23 = (short)((ulonglong)uVar27 >> 0x20) + sVar30;

  sVar21 = (short)((ulonglong)uVar15 >> 0x30);

  sVar13 = (short)((ulonglong)uVar27 >> 0x30) + sVar21;

  sVar12 = sVar12 + (short)uVar10;

  sVar14 = sVar14 + sVar32;

  sVar35 = sVar35 + sVar19;

  sVar37 = sVar37 + sVar20;

  sVar32 = (short)uVar5 + (short)uVar15;

  sVar22 = (short)((ulonglong)uVar5 >> 0x10) + sVar22;

  sVar30 = (short)((ulonglong)uVar5 >> 0x20) + sVar30;

  sVar21 = (short)((ulonglong)uVar5 >> 0x30) + sVar21;

  param_3[0xb] = CONCAT26(sVar9 + sVar13,

                          CONCAT24(sVar8 + sVar23,CONCAT22(sVar7 + sVar11,sVar3 + sVar28)));

  param_3[7] = CONCAT26(sVar9 - sVar13,

                        CONCAT24(sVar8 - sVar23,CONCAT22(sVar7 - sVar11,sVar3 - sVar28)));

  param_3[3] = CONCAT26(sVar37 + sVar21,

                        CONCAT24(sVar35 + sVar30,CONCAT22(sVar14 + sVar22,sVar12 + sVar32)));

  param_3[0xf] = CONCAT26(sVar37 - sVar21,

                          CONCAT24(sVar35 - sVar30,CONCAT22(sVar14 - sVar22,sVar12 - sVar32)));

  return CONCAT44(param_2,in_EAX);

}





// --- FUN_0064e0c0 at 0x0064E0C0 (size: 1875) ---


undefined8 __fastcall FUN_0064e0c0(undefined4 param_1,undefined4 param_2,ulonglong *param_3)



{

  ulonglong uVar1;

  ulonglong uVar2;

  ulonglong uVar3;

  ulonglong uVar4;

  ulonglong uVar5;

  ulonglong uVar6;

  ulonglong uVar7;

  ulonglong uVar8;

  char cVar9;

  char cVar10;

  undefined4 in_EAX;

  undefined2 uVar11;

  undefined4 uVar12;

  short sVar13;

  short sVar15;

  short sVar16;

  undefined8 uVar14;

  short sVar17;

  short sVar18;

  undefined2 uVar19;

  undefined4 uVar20;

  short sVar22;

  short sVar23;

  short sVar24;

  undefined8 uVar21;

  short sVar25;

  short sVar26;

  short sVar27;

  short sVar28;

  short sVar29;

  undefined4 uVar30;

  short sVar32;

  short sVar33;

  short sVar34;

  undefined8 uVar31;

  short sVar35;

  short sVar36;

  short sVar37;

  short sVar38;

  short sVar39;

  short sVar40;

  short sVar41;

  short sVar42;

  short sVar43;

  short sVar44;

  short sVar46;

  short sVar47;

  short sVar48;

  undefined8 uVar45;

  

  uVar1 = param_3[0xc];

  uVar2 = param_3[4];

  uVar3 = *param_3;

  uVar4 = param_3[8];

  sVar13 = (short)(uVar1 >> 0x10);

  sVar22 = (short)(uVar2 >> 0x10);

  sVar15 = (short)(uVar1 >> 0x20);

  sVar23 = (short)(uVar2 >> 0x20);

  sVar24 = (short)(uVar2 >> 0x30);

  sVar16 = (short)(uVar1 >> 0x30);

  uVar14 = psllw(CONCAT26(sVar24 - sVar16,

                          CONCAT24(sVar23 - sVar15,

                                   CONCAT22(sVar22 - sVar13,(short)uVar2 - (short)uVar1))),2);

  uVar14 = pmulhw(uVar14,DAT_00833370);

  sVar18 = (short)uVar2 + (short)uVar1;

  sVar22 = sVar22 + sVar13;

  sVar23 = sVar23 + sVar15;

  sVar24 = sVar24 + sVar16;

  sVar25 = (short)uVar3 + (short)uVar4;

  sVar32 = (short)(uVar3 >> 0x10);

  sVar35 = (short)(uVar4 >> 0x10);

  sVar26 = sVar32 + sVar35;

  sVar33 = (short)(uVar3 >> 0x20);

  sVar34 = (short)(uVar3 >> 0x30);

  sVar36 = (short)(uVar4 >> 0x20);

  sVar27 = sVar33 + sVar36;

  sVar37 = (short)(uVar4 >> 0x30);

  sVar28 = sVar34 + sVar37;

  sVar13 = (short)uVar14 - sVar18;

  sVar15 = (short)((ulonglong)uVar14 >> 0x10) - sVar22;

  sVar16 = (short)((ulonglong)uVar14 >> 0x20) - sVar23;

  sVar17 = (short)((ulonglong)uVar14 >> 0x30) - sVar24;

  sVar29 = (short)uVar3 - (short)uVar4;

  sVar32 = sVar32 - sVar35;

  sVar33 = sVar33 - sVar36;

  sVar34 = sVar34 - sVar37;

  param_3[4] = CONCAT26(sVar28 + sVar24,

                        CONCAT24(sVar27 + sVar23,CONCAT22(sVar26 + sVar22,sVar25 + sVar18)));

  param_3[0xc] = CONCAT26(sVar17 + sVar34,

                          CONCAT24(sVar16 + sVar33,CONCAT22(sVar15 + sVar32,sVar13 + sVar29)));

  sVar25 = sVar25 - sVar18;

  sVar26 = sVar26 - sVar22;

  sVar27 = sVar27 - sVar23;

  sVar28 = sVar28 - sVar24;

  *param_3 = CONCAT26(sVar34 - sVar17,

                      CONCAT24(sVar33 - sVar16,CONCAT22(sVar32 - sVar15,sVar29 - sVar13)));

  uVar1 = param_3[10];

  uVar2 = param_3[6];

  uVar3 = param_3[2];

  sVar44 = (short)uVar1 - (short)uVar2;

  sVar13 = (short)(uVar2 >> 0x10);

  sVar24 = (short)(uVar1 >> 0x10);

  sVar46 = sVar24 - sVar13;

  sVar15 = (short)(uVar2 >> 0x20);

  sVar17 = (short)(uVar1 >> 0x20);

  sVar18 = (short)(uVar1 >> 0x30);

  sVar47 = sVar17 - sVar15;

  sVar16 = (short)(uVar2 >> 0x30);

  sVar48 = sVar18 - sVar16;

  uVar4 = param_3[0xe];

  sVar23 = (short)uVar1 + (short)uVar2;

  sVar24 = sVar24 + sVar13;

  sVar17 = sVar17 + sVar15;

  sVar18 = sVar18 + sVar16;

  uVar14 = psllw(CONCAT26(sVar48,CONCAT24(sVar47,CONCAT22(sVar46,sVar44))),3);

  uVar45 = pmulhw(uVar14,DAT_00833378);

  sVar29 = (short)uVar3 + (short)uVar4;

  sVar32 = (short)(uVar4 >> 0x10);

  sVar15 = (short)(uVar3 >> 0x10);

  sVar36 = sVar15 + sVar32;

  sVar33 = (short)(uVar4 >> 0x20);

  sVar16 = (short)(uVar3 >> 0x20);

  sVar22 = (short)(uVar3 >> 0x30);

  sVar38 = sVar16 + sVar33;

  sVar34 = (short)(uVar4 >> 0x30);

  sVar40 = sVar22 + sVar34;

  sVar13 = (short)uVar3 - (short)uVar4;

  sVar15 = sVar15 - sVar32;

  sVar16 = sVar16 - sVar33;

  sVar22 = sVar22 - sVar34;

  uVar14 = psllw(CONCAT26(sVar22,CONCAT24(sVar16,CONCAT22(sVar15,sVar13))),2);

  sVar35 = sVar29 + sVar23;

  sVar37 = sVar36 + sVar24;

  sVar39 = sVar38 + sVar17;

  sVar41 = sVar40 + sVar18;

  uVar14 = pmulhw(uVar14,DAT_00833380);

  uVar21 = psllw(CONCAT26(sVar48 + sVar22,

                          CONCAT24(sVar47 + sVar16,CONCAT22(sVar46 + sVar15,sVar44 + sVar13))),2);

  uVar31 = psllw(CONCAT26(sVar40 - sVar18,

                          CONCAT24(sVar38 - sVar17,CONCAT22(sVar36 - sVar24,sVar29 - sVar23))),2);

  uVar21 = pmulhw(DAT_00833388,uVar21);

  uVar1 = param_3[0xc];

  uVar31 = pmulhw(uVar31,DAT_00833370);

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  sVar16 = (short)((ulonglong)uVar21 >> 0x20);

  sVar22 = (short)((ulonglong)uVar21 >> 0x30);

  uVar2 = param_3[4];

  sVar23 = ((short)uVar21 + (short)uVar45) - sVar35;

  sVar24 = (sVar15 + (short)((ulonglong)uVar45 >> 0x10)) - sVar37;

  sVar17 = (sVar16 + (short)((ulonglong)uVar45 >> 0x20)) - sVar39;

  sVar18 = (sVar22 + (short)((ulonglong)uVar45 >> 0x30)) - sVar41;

  sVar32 = (short)uVar31 - sVar23;

  sVar33 = (short)((ulonglong)uVar31 >> 0x10) - sVar24;

  sVar34 = (short)((ulonglong)uVar31 >> 0x20) - sVar17;

  sVar29 = (short)((ulonglong)uVar31 >> 0x30) - sVar18;

  sVar13 = ((short)uVar14 - (short)uVar21) + sVar32;

  sVar15 = ((short)((ulonglong)uVar14 >> 0x10) - sVar15) + sVar33;

  sVar16 = ((short)((ulonglong)uVar14 >> 0x20) - sVar16) + sVar34;

  sVar22 = ((short)((ulonglong)uVar14 >> 0x30) - sVar22) + sVar29;

  param_3[8] = CONCAT26(sVar28 + sVar22,

                        CONCAT24(sVar27 + sVar16,CONCAT22(sVar26 + sVar15,sVar25 + sVar13)));

  sVar36 = (short)(uVar2 >> 0x10);

  sVar38 = (short)(uVar2 >> 0x20);

  sVar40 = (short)(uVar2 >> 0x30);

  param_3[6] = CONCAT26(sVar28 - sVar22,

                        CONCAT24(sVar27 - sVar16,CONCAT22(sVar26 - sVar15,sVar25 - sVar13)));

  uVar3 = *param_3;

  *param_3 = CONCAT26(sVar40 + sVar41,

                      CONCAT24(sVar38 + sVar39,CONCAT22(sVar36 + sVar37,(short)uVar2 + sVar35)));

  sVar13 = (short)(uVar1 >> 0x10);

  sVar15 = (short)(uVar1 >> 0x20);

  sVar16 = (short)(uVar1 >> 0x30);

  param_3[0xe] = CONCAT26(sVar40 - sVar41,

                          CONCAT24(sVar38 - sVar39,CONCAT22(sVar36 - sVar37,(short)uVar2 - sVar35)))

  ;

  param_3[2] = CONCAT26(sVar16 + sVar18,

                        CONCAT24(sVar15 + sVar17,CONCAT22(sVar13 + sVar24,(short)uVar1 + sVar23)));

  param_3[0xc] = CONCAT26(sVar16 - sVar18,

                          CONCAT24(sVar15 - sVar17,CONCAT22(sVar13 - sVar24,(short)uVar1 - sVar23)))

  ;

  sVar13 = (short)(uVar3 >> 0x10);

  sVar15 = (short)(uVar3 >> 0x20);

  sVar16 = (short)(uVar3 >> 0x30);

  uVar1 = param_3[5];

  param_3[4] = CONCAT26(sVar16 + sVar29,

                        CONCAT24(sVar15 + sVar34,CONCAT22(sVar13 + sVar33,(short)uVar3 + sVar32)));

  uVar2 = param_3[0xd];

  param_3[10] = CONCAT26(sVar16 - sVar29,

                         CONCAT24(sVar15 - sVar34,CONCAT22(sVar13 - sVar33,(short)uVar3 - sVar32)));

  sVar13 = (short)(uVar1 >> 0x10);

  sVar22 = (short)(uVar2 >> 0x10);

  sVar15 = (short)(uVar1 >> 0x20);

  sVar16 = (short)(uVar1 >> 0x30);

  sVar25 = (short)(uVar2 >> 0x20);

  sVar26 = (short)(uVar2 >> 0x30);

  uVar3 = param_3[1];

  sVar23 = (short)uVar1 + (short)uVar2;

  sVar24 = sVar13 + sVar22;

  sVar17 = sVar15 + sVar25;

  sVar18 = sVar16 + sVar26;

  uVar4 = param_3[9];

  uVar14 = psllw(CONCAT26(sVar16 - sVar26,

                          CONCAT24(sVar15 - sVar25,

                                   CONCAT22(sVar13 - sVar22,(short)uVar1 - (short)uVar2))),2);

  uVar14 = pmulhw(uVar14,DAT_00833370);

  uVar1 = param_3[0xb];

  sVar25 = (short)uVar3 + (short)uVar4;

  sVar32 = (short)(uVar3 >> 0x10);

  sVar13 = (short)(uVar4 >> 0x10);

  sVar26 = sVar32 + sVar13;

  sVar33 = (short)(uVar3 >> 0x20);

  sVar28 = (short)(uVar3 >> 0x30);

  sVar15 = (short)(uVar4 >> 0x20);

  sVar27 = sVar33 + sVar15;

  sVar16 = (short)(uVar4 >> 0x30);

  sVar34 = sVar28 + sVar16;

  sVar29 = (short)uVar3 - (short)uVar4;

  sVar32 = sVar32 - sVar13;

  sVar33 = sVar33 - sVar15;

  sVar28 = sVar28 - sVar16;

  sVar13 = (short)uVar14 - sVar23;

  sVar15 = (short)((ulonglong)uVar14 >> 0x10) - sVar24;

  sVar16 = (short)((ulonglong)uVar14 >> 0x20) - sVar17;

  sVar22 = (short)((ulonglong)uVar14 >> 0x30) - sVar18;

  uVar2 = param_3[7];

  param_3[5] = CONCAT26(sVar34 + sVar18,

                        CONCAT24(sVar27 + sVar17,CONCAT22(sVar26 + sVar24,sVar25 + sVar23)));

  sVar25 = sVar25 - sVar23;

  sVar26 = sVar26 - sVar24;

  sVar27 = sVar27 - sVar17;

  sVar34 = sVar34 - sVar18;

  param_3[0xd] = CONCAT26(sVar28 + sVar22,

                          CONCAT24(sVar33 + sVar16,CONCAT22(sVar32 + sVar15,sVar29 + sVar13)));

  param_3[9] = CONCAT26(sVar28 - sVar22,

                        CONCAT24(sVar33 - sVar16,CONCAT22(sVar32 - sVar15,sVar29 - sVar13)));

  sVar13 = (short)uVar1 + (short)uVar2;

  sVar16 = (short)(uVar1 >> 0x10);

  sVar32 = (short)(uVar2 >> 0x10);

  sVar15 = sVar16 + sVar32;

  sVar23 = (short)(uVar1 >> 0x20);

  sVar17 = (short)(uVar1 >> 0x30);

  sVar33 = (short)(uVar2 >> 0x20);

  sVar22 = sVar23 + sVar33;

  sVar28 = (short)(uVar2 >> 0x30);

  sVar24 = sVar17 + sVar28;

  uVar3 = param_3[0xf];

  sVar18 = (short)uVar1 - (short)uVar2;

  sVar16 = sVar16 - sVar32;

  sVar23 = sVar23 - sVar33;

  sVar17 = sVar17 - sVar28;

  uVar1 = param_3[3];

  uVar14 = psllw(CONCAT26(sVar17,CONCAT24(sVar23,CONCAT22(sVar16,sVar18))),3);

  sVar29 = (short)uVar1 + (short)uVar3;

  sVar32 = (short)(uVar3 >> 0x10);

  sVar36 = (short)(uVar1 >> 0x10);

  sVar35 = sVar36 + sVar32;

  sVar33 = (short)(uVar3 >> 0x20);

  sVar38 = (short)(uVar1 >> 0x20);

  sVar46 = (short)(uVar1 >> 0x30);

  sVar37 = sVar38 + sVar33;

  sVar28 = (short)(uVar3 >> 0x30);

  sVar39 = sVar46 + sVar28;

  sVar48 = (short)uVar1 - (short)uVar3;

  sVar36 = sVar36 - sVar32;

  sVar38 = sVar38 - sVar33;

  sVar46 = sVar46 - sVar28;

  uVar14 = pmulhw(uVar14,DAT_00833378);

  sVar40 = sVar29 + sVar13;

  sVar41 = sVar35 + sVar15;

  sVar44 = sVar37 + sVar22;

  sVar47 = sVar39 + sVar24;

  uVar21 = psllw(CONCAT26(sVar39 - sVar24,

                          CONCAT24(sVar37 - sVar22,CONCAT22(sVar35 - sVar15,sVar29 - sVar13))),2);

  uVar31 = pmulhw(uVar21,DAT_00833370);

  uVar21 = psllw(CONCAT26(sVar17 + sVar46,

                          CONCAT24(sVar23 + sVar38,CONCAT22(sVar16 + sVar36,sVar18 + sVar48))),2);

  uVar45 = psllw(CONCAT26(sVar46,CONCAT24(sVar38,CONCAT22(sVar36,sVar48))),2);

  uVar21 = pmulhw(uVar21,DAT_00833388);

  uVar1 = param_3[5];

  uVar45 = pmulhw(uVar45,DAT_00833380);

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  sVar22 = (short)((ulonglong)uVar21 >> 0x20);

  sVar24 = (short)((ulonglong)uVar21 >> 0x30);

  sVar17 = ((short)uVar21 + (short)uVar14) - sVar40;

  sVar18 = (sVar15 + (short)((ulonglong)uVar14 >> 0x10)) - sVar41;

  sVar33 = (sVar22 + (short)((ulonglong)uVar14 >> 0x20)) - sVar44;

  sVar29 = (sVar24 + (short)((ulonglong)uVar14 >> 0x30)) - sVar47;

  sVar36 = (short)uVar31 - sVar17;

  sVar37 = (short)((ulonglong)uVar31 >> 0x10) - sVar18;

  sVar38 = (short)((ulonglong)uVar31 >> 0x20) - sVar33;

  sVar39 = (short)((ulonglong)uVar31 >> 0x30) - sVar29;

  sVar13 = (short)(uVar1 >> 0x10);

  sVar16 = (short)(uVar1 >> 0x20);

  sVar23 = (short)(uVar1 >> 0x30);

  sVar46 = ((short)uVar45 - (short)uVar21) + sVar36;

  sVar48 = ((short)((ulonglong)uVar45 >> 0x10) - sVar15) + sVar37;

  sVar42 = ((short)((ulonglong)uVar45 >> 0x20) - sVar22) + sVar38;

  sVar43 = ((short)((ulonglong)uVar45 >> 0x30) - sVar24) + sVar39;

  uVar2 = param_3[0xd];

  param_3[1] = CONCAT26(sVar23 + sVar47,

                        CONCAT24(sVar16 + sVar44,CONCAT22(sVar13 + sVar41,(short)uVar1 + sVar40)));

  uVar3 = param_3[9];

  param_3[7] = CONCAT26(sVar34 - sVar43,

                        CONCAT24(sVar27 - sVar42,CONCAT22(sVar26 - sVar48,sVar25 - sVar46)));

  sVar32 = (short)(uVar2 >> 0x10);

  sVar28 = (short)(uVar2 >> 0x20);

  sVar35 = (short)(uVar2 >> 0x30);

  param_3[3] = CONCAT26(sVar35 + sVar29,

                        CONCAT24(sVar28 + sVar33,CONCAT22(sVar32 + sVar18,(short)uVar2 + sVar17)));

  sVar15 = (short)(uVar3 >> 0x10);

  sVar22 = (short)(uVar3 >> 0x20);

  sVar24 = (short)(uVar3 >> 0x30);

  param_3[5] = CONCAT26(sVar24 + sVar39,

                        CONCAT24(sVar22 + sVar38,CONCAT22(sVar15 + sVar37,(short)uVar3 + sVar36)));

  uVar12 = CONCAT22(sVar22 - sVar38,sVar27 + sVar42);

  uVar4 = *param_3;

  uVar5 = param_3[2];

  uVar20 = CONCAT22(sVar16 - sVar44,sVar28 - sVar33);

  param_3[9] = CONCAT44(CONCAT22((short)uVar1 - sVar40,(short)uVar2 - sVar17),

                        CONCAT22((short)uVar3 - sVar36,sVar25 + sVar46));

  param_3[0xb] = CONCAT44(CONCAT22(sVar13 - sVar41,sVar32 - sVar18),

                          CONCAT22(sVar15 - sVar37,sVar26 + sVar48));

  param_3[0xd] = CONCAT44(uVar20,uVar12);

  param_3[0xf] = CONCAT44((int)(CONCAT26(sVar23 - sVar47,CONCAT24(sVar35 - sVar29,uVar20)) >> 0x20),

                          (int)(CONCAT26(sVar24 - sVar39,CONCAT24(sVar34 + sVar43,uVar12)) >> 0x20))

  ;

  uVar20 = CONCAT22((short)(uVar5 >> 0x20),(short)(uVar4 >> 0x20));

  uVar1 = param_3[4];

  uVar2 = param_3[6];

  uVar12 = CONCAT22((short)(uVar2 >> 0x20),(short)(uVar1 >> 0x20));

  *param_3 = CONCAT44(CONCAT22((short)uVar2,(short)uVar1),CONCAT22((short)uVar5,(short)uVar4));

  param_3[2] = CONCAT44(CONCAT22((short)(uVar2 >> 0x10),(short)(uVar1 >> 0x10)),

                        CONCAT22((short)(uVar5 >> 0x10),(short)(uVar4 >> 0x10)));

  param_3[4] = CONCAT44(uVar12,uVar20);

  param_3[6] = CONCAT44((int)(CONCAT26((short)(uVar2 >> 0x30),

                                       CONCAT24((short)(uVar1 >> 0x30),uVar12)) >> 0x20),

                        (int)(CONCAT26((short)(uVar5 >> 0x30),

                                       CONCAT24((short)(uVar4 >> 0x30),uVar20)) >> 0x20));

  uVar1 = param_3[1];

  uVar2 = param_3[3];

  uVar3 = param_3[5];

  uVar20 = CONCAT22((short)(uVar2 >> 0x20),(short)(uVar1 >> 0x20));

  uVar4 = param_3[7];

  uVar30 = CONCAT22((short)(uVar4 >> 0x20),(short)(uVar3 >> 0x20));

  uVar5 = param_3[8];

  param_3[8] = CONCAT44(CONCAT22((short)uVar4,(short)uVar3),CONCAT22((short)uVar2,(short)uVar1));

  uVar6 = param_3[10];

  param_3[10] = CONCAT44(CONCAT22((short)(uVar4 >> 0x10),(short)(uVar3 >> 0x10)),

                         CONCAT22((short)(uVar2 >> 0x10),(short)(uVar1 >> 0x10)));

  uVar7 = param_3[0xc];

  uVar12 = CONCAT22((short)(uVar6 >> 0x20),(short)(uVar5 >> 0x20));

  uVar8 = param_3[0xe];

  param_3[0xc] = CONCAT44(uVar30,uVar20);

  param_3[0xe] = CONCAT44((int)(CONCAT26((short)(uVar4 >> 0x30),

                                         CONCAT24((short)(uVar3 >> 0x30),uVar30)) >> 0x20),

                          (int)(CONCAT26((short)(uVar2 >> 0x30),

                                         CONCAT24((short)(uVar1 >> 0x30),uVar20)) >> 0x20));

  uVar20 = CONCAT22((short)(uVar8 >> 0x20),(short)(uVar7 >> 0x20));

  param_3[1] = CONCAT44(CONCAT22((short)uVar8,(short)uVar7),CONCAT22((short)uVar6,(short)uVar5));

  param_3[3] = CONCAT44(CONCAT22((short)(uVar8 >> 0x10),(short)(uVar7 >> 0x10)),

                        CONCAT22((short)(uVar6 >> 0x10),(short)(uVar5 >> 0x10)));

  param_3[5] = CONCAT44(uVar20,uVar12);

  param_3[7] = CONCAT44((int)(CONCAT26((short)(uVar8 >> 0x30),

                                       CONCAT24((short)(uVar7 >> 0x30),uVar20)) >> 0x20),

                        (int)(CONCAT26((short)(uVar6 >> 0x30),

                                       CONCAT24((short)(uVar5 >> 0x30),uVar12)) >> 0x20));

  uVar1 = param_3[0xc];

  uVar2 = param_3[4];

  uVar3 = *param_3;

  uVar4 = param_3[8];

  sVar13 = (short)(uVar1 >> 0x10);

  sVar22 = (short)(uVar2 >> 0x10);

  sVar15 = (short)(uVar1 >> 0x20);

  sVar23 = (short)(uVar2 >> 0x20);

  sVar24 = (short)(uVar2 >> 0x30);

  sVar16 = (short)(uVar1 >> 0x30);

  sVar17 = (short)uVar2 + (short)uVar1;

  sVar18 = sVar22 + sVar13;

  sVar25 = sVar23 + sVar15;

  sVar26 = sVar24 + sVar16;

  uVar14 = psllw(CONCAT26(sVar24 - sVar16,

                          CONCAT24(sVar23 - sVar15,

                                   CONCAT22(sVar22 - sVar13,(short)uVar2 - (short)uVar1))),2);

  uVar14 = pmulhw(uVar14,DAT_00833370);

  sVar32 = (short)uVar3 + (short)uVar4;

  sVar23 = (short)(uVar3 >> 0x10);

  sVar13 = (short)(uVar4 >> 0x10);

  sVar27 = sVar23 + sVar13;

  sVar24 = (short)(uVar3 >> 0x20);

  sVar34 = (short)(uVar3 >> 0x30);

  sVar15 = (short)(uVar4 >> 0x20);

  sVar33 = sVar24 + sVar15;

  sVar16 = (short)(uVar4 >> 0x30);

  sVar28 = sVar34 + sVar16;

  sVar29 = (short)uVar3 - (short)uVar4;

  sVar23 = sVar23 - sVar13;

  sVar24 = sVar24 - sVar15;

  sVar34 = sVar34 - sVar16;

  sVar13 = (short)uVar14 - sVar17;

  sVar15 = (short)((ulonglong)uVar14 >> 0x10) - sVar18;

  sVar16 = (short)((ulonglong)uVar14 >> 0x20) - sVar25;

  sVar22 = (short)((ulonglong)uVar14 >> 0x30) - sVar26;

  param_3[4] = CONCAT26(sVar28 + sVar26,

                        CONCAT24(sVar33 + sVar25,CONCAT22(sVar27 + sVar18,sVar32 + sVar17)));

  param_3[0xc] = CONCAT26(sVar22 + sVar34,

                          CONCAT24(sVar16 + sVar24,CONCAT22(sVar15 + sVar23,sVar13 + sVar29)));

  sVar32 = sVar32 - sVar17;

  sVar27 = sVar27 - sVar18;

  sVar33 = sVar33 - sVar25;

  sVar28 = sVar28 - sVar26;

  *param_3 = CONCAT26(sVar34 - sVar22,

                      CONCAT24(sVar24 - sVar16,CONCAT22(sVar23 - sVar15,sVar29 - sVar13)));

  uVar1 = param_3[10];

  uVar2 = param_3[6];

  uVar3 = param_3[2];

  sVar35 = (short)uVar1 - (short)uVar2;

  sVar13 = (short)(uVar2 >> 0x10);

  sVar24 = (short)(uVar1 >> 0x10);

  sVar37 = sVar24 - sVar13;

  sVar15 = (short)(uVar2 >> 0x20);

  sVar17 = (short)(uVar1 >> 0x20);

  sVar18 = (short)(uVar1 >> 0x30);

  sVar39 = sVar17 - sVar15;

  sVar16 = (short)(uVar2 >> 0x30);

  sVar41 = sVar18 - sVar16;

  uVar4 = param_3[0xe];

  sVar23 = (short)uVar1 + (short)uVar2;

  sVar24 = sVar24 + sVar13;

  sVar17 = sVar17 + sVar15;

  sVar18 = sVar18 + sVar16;

  uVar14 = psllw(CONCAT26(sVar41,CONCAT24(sVar39,CONCAT22(sVar37,sVar35))),3);

  uVar45 = pmulhw(uVar14,DAT_00833378);

  sVar29 = (short)uVar3 + (short)uVar4;

  sVar25 = (short)(uVar4 >> 0x10);

  sVar15 = (short)(uVar3 >> 0x10);

  sVar36 = sVar15 + sVar25;

  sVar26 = (short)(uVar4 >> 0x20);

  sVar16 = (short)(uVar3 >> 0x20);

  sVar22 = (short)(uVar3 >> 0x30);

  sVar38 = sVar16 + sVar26;

  sVar34 = (short)(uVar4 >> 0x30);

  sVar40 = sVar22 + sVar34;

  sVar13 = (short)uVar3 - (short)uVar4;

  sVar15 = sVar15 - sVar25;

  sVar16 = sVar16 - sVar26;

  sVar22 = sVar22 - sVar34;

  uVar14 = psllw(CONCAT26(sVar22,CONCAT24(sVar16,CONCAT22(sVar15,sVar13))),2);

  uVar21 = psllw(CONCAT26(sVar41 + sVar22,

                          CONCAT24(sVar39 + sVar16,CONCAT22(sVar37 + sVar15,sVar35 + sVar13))),2);

  uVar14 = pmulhw(uVar14,DAT_00833380);

  uVar21 = pmulhw(uVar21,DAT_00833388);

  sVar35 = sVar29 + sVar23;

  sVar37 = sVar36 + sVar24;

  sVar39 = sVar38 + sVar17;

  sVar41 = sVar40 + sVar18;

  uVar31 = psllw(CONCAT26(sVar40 - sVar18,

                          CONCAT24(sVar38 - sVar17,CONCAT22(sVar36 - sVar24,sVar29 - sVar23))),2);

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  sVar16 = (short)((ulonglong)uVar21 >> 0x20);

  sVar22 = (short)((ulonglong)uVar21 >> 0x30);

  uVar31 = pmulhw(uVar31,DAT_00833370);

  uVar1 = param_3[0xc];

  sVar23 = ((short)uVar21 + (short)uVar45) - sVar35;

  sVar24 = (sVar15 + (short)((ulonglong)uVar45 >> 0x10)) - sVar37;

  sVar17 = (sVar16 + (short)((ulonglong)uVar45 >> 0x20)) - sVar39;

  sVar18 = (sVar22 + (short)((ulonglong)uVar45 >> 0x30)) - sVar41;

  uVar2 = param_3[4];

  sVar25 = (short)uVar31 - sVar23;

  sVar26 = (short)((ulonglong)uVar31 >> 0x10) - sVar24;

  sVar34 = (short)((ulonglong)uVar31 >> 0x20) - sVar17;

  sVar29 = (short)((ulonglong)uVar31 >> 0x30) - sVar18;

  sVar13 = ((short)uVar14 - (short)uVar21) + sVar25;

  sVar15 = ((short)((ulonglong)uVar14 >> 0x10) - sVar15) + sVar26;

  sVar16 = ((short)((ulonglong)uVar14 >> 0x20) - sVar16) + sVar34;

  sVar22 = ((short)((ulonglong)uVar14 >> 0x30) - sVar22) + sVar29;

  param_3[8] = CONCAT26(sVar28 + sVar22,

                        CONCAT24(sVar33 + sVar16,CONCAT22(sVar27 + sVar15,sVar32 + sVar13)));

  sVar36 = (short)(uVar2 >> 0x10);

  sVar38 = (short)(uVar2 >> 0x20);

  sVar40 = (short)(uVar2 >> 0x30);

  param_3[6] = CONCAT26(sVar28 - sVar22,

                        CONCAT24(sVar33 - sVar16,CONCAT22(sVar27 - sVar15,sVar32 - sVar13)));

  uVar3 = *param_3;

  *param_3 = CONCAT26(sVar40 + sVar41,

                      CONCAT24(sVar38 + sVar39,CONCAT22(sVar36 + sVar37,(short)uVar2 + sVar35)));

  sVar13 = (short)(uVar1 >> 0x10);

  sVar15 = (short)(uVar1 >> 0x20);

  sVar16 = (short)(uVar1 >> 0x30);

  param_3[0xe] = CONCAT26(sVar40 - sVar41,

                          CONCAT24(sVar38 - sVar39,CONCAT22(sVar36 - sVar37,(short)uVar2 - sVar35)))

  ;

  param_3[2] = CONCAT26(sVar16 + sVar18,

                        CONCAT24(sVar15 + sVar17,CONCAT22(sVar13 + sVar24,(short)uVar1 + sVar23)));

  param_3[0xc] = CONCAT26(sVar16 - sVar18,

                          CONCAT24(sVar15 - sVar17,CONCAT22(sVar13 - sVar24,(short)uVar1 - sVar23)))

  ;

  sVar13 = (short)(uVar3 >> 0x10);

  sVar15 = (short)(uVar3 >> 0x20);

  sVar16 = (short)(uVar3 >> 0x30);

  uVar1 = param_3[5];

  param_3[4] = CONCAT26(sVar16 + sVar29,

                        CONCAT24(sVar15 + sVar34,CONCAT22(sVar13 + sVar26,(short)uVar3 + sVar25)));

  param_3[10] = CONCAT26(sVar16 - sVar29,

                         CONCAT24(sVar15 - sVar34,CONCAT22(sVar13 - sVar26,(short)uVar3 - sVar25)));

  uVar2 = param_3[0xd];

  uVar3 = param_3[1];

  sVar13 = (short)(uVar1 >> 0x10);

  sVar22 = (short)(uVar2 >> 0x10);

  sVar15 = (short)(uVar1 >> 0x20);

  sVar16 = (short)(uVar1 >> 0x30);

  sVar25 = (short)(uVar2 >> 0x20);

  sVar26 = (short)(uVar2 >> 0x30);

  uVar4 = param_3[9];

  sVar23 = (short)uVar1 + (short)uVar2;

  sVar24 = sVar13 + sVar22;

  sVar17 = sVar15 + sVar25;

  sVar18 = sVar16 + sVar26;

  uVar14 = psllw(CONCAT26(sVar16 - sVar26,

                          CONCAT24(sVar15 - sVar25,

                                   CONCAT22(sVar13 - sVar22,(short)uVar1 - (short)uVar2))),2);

  uVar14 = pmulhw(uVar14,DAT_00833370);

  sVar25 = (short)uVar3 + (short)uVar4;

  sVar32 = (short)(uVar3 >> 0x10);

  sVar13 = (short)(uVar4 >> 0x10);

  sVar26 = sVar32 + sVar13;

  sVar33 = (short)(uVar3 >> 0x20);

  sVar28 = (short)(uVar3 >> 0x30);

  sVar15 = (short)(uVar4 >> 0x20);

  sVar27 = sVar33 + sVar15;

  sVar16 = (short)(uVar4 >> 0x30);

  sVar34 = sVar28 + sVar16;

  sVar29 = (short)uVar3 - (short)uVar4;

  sVar32 = sVar32 - sVar13;

  sVar33 = sVar33 - sVar15;

  sVar28 = sVar28 - sVar16;

  sVar13 = (short)uVar14 - sVar23;

  sVar15 = (short)((ulonglong)uVar14 >> 0x10) - sVar24;

  sVar16 = (short)((ulonglong)uVar14 >> 0x20) - sVar17;

  sVar22 = (short)((ulonglong)uVar14 >> 0x30) - sVar18;

  param_3[5] = CONCAT26(sVar34 + sVar18,

                        CONCAT24(sVar27 + sVar17,CONCAT22(sVar26 + sVar24,sVar25 + sVar23)));

  param_3[0xd] = CONCAT26(sVar28 + sVar22,

                          CONCAT24(sVar33 + sVar16,CONCAT22(sVar32 + sVar15,sVar29 + sVar13)));

  sVar25 = sVar25 - sVar23;

  sVar26 = sVar26 - sVar24;

  sVar27 = sVar27 - sVar17;

  sVar34 = sVar34 - sVar18;

  param_3[9] = CONCAT26(sVar28 - sVar22,

                        CONCAT24(sVar33 - sVar16,CONCAT22(sVar32 - sVar15,sVar29 - sVar13)));

  uVar1 = param_3[0xb];

  uVar2 = param_3[7];

  uVar3 = param_3[0xf];

  sVar13 = (short)uVar1 + (short)uVar2;

  sVar16 = (short)(uVar1 >> 0x10);

  sVar32 = (short)(uVar2 >> 0x10);

  sVar15 = sVar16 + sVar32;

  sVar23 = (short)(uVar1 >> 0x20);

  sVar17 = (short)(uVar1 >> 0x30);

  sVar33 = (short)(uVar2 >> 0x20);

  sVar22 = sVar23 + sVar33;

  sVar28 = (short)(uVar2 >> 0x30);

  sVar24 = sVar17 + sVar28;

  uVar4 = param_3[3];

  sVar18 = (short)uVar1 - (short)uVar2;

  sVar16 = sVar16 - sVar32;

  sVar23 = sVar23 - sVar33;

  sVar17 = sVar17 - sVar28;

  uVar14 = psllw(CONCAT26(sVar17,CONCAT24(sVar23,CONCAT22(sVar16,sVar18))),3);

  uVar14 = pmulhw(uVar14,DAT_00833378);

  sVar29 = (short)uVar4 + (short)uVar3;

  sVar32 = (short)(uVar3 >> 0x10);

  sVar36 = (short)(uVar4 >> 0x10);

  sVar35 = sVar36 + sVar32;

  sVar33 = (short)(uVar3 >> 0x20);

  sVar38 = (short)(uVar4 >> 0x20);

  sVar46 = (short)(uVar4 >> 0x30);

  sVar37 = sVar38 + sVar33;

  sVar28 = (short)(uVar3 >> 0x30);

  sVar39 = sVar46 + sVar28;

  sVar48 = (short)uVar4 - (short)uVar3;

  sVar36 = sVar36 - sVar32;

  sVar38 = sVar38 - sVar33;

  sVar46 = sVar46 - sVar28;

  sVar40 = sVar29 + sVar13;

  sVar41 = sVar35 + sVar15;

  sVar44 = sVar37 + sVar22;

  sVar47 = sVar39 + sVar24;

  uVar21 = psllw(CONCAT26(sVar39 - sVar24,

                          CONCAT24(sVar37 - sVar22,CONCAT22(sVar35 - sVar15,sVar29 - sVar13))),2);

  uVar31 = pmulhw(uVar21,DAT_00833370);

  uVar21 = psllw(CONCAT26(sVar17 + sVar46,

                          CONCAT24(sVar23 + sVar38,CONCAT22(sVar16 + sVar36,sVar18 + sVar48))),2);

  uVar45 = psllw(CONCAT26(sVar46,CONCAT24(sVar38,CONCAT22(sVar36,sVar48))),2);

  uVar1 = param_3[5];

  uVar21 = pmulhw(uVar21,DAT_00833388);

  uVar45 = pmulhw(uVar45,DAT_00833380);

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  sVar22 = (short)((ulonglong)uVar21 >> 0x20);

  sVar24 = (short)((ulonglong)uVar21 >> 0x30);

  sVar17 = ((short)uVar21 + (short)uVar14) - sVar40;

  sVar18 = (sVar15 + (short)((ulonglong)uVar14 >> 0x10)) - sVar41;

  sVar33 = (sVar22 + (short)((ulonglong)uVar14 >> 0x20)) - sVar44;

  sVar29 = (sVar24 + (short)((ulonglong)uVar14 >> 0x30)) - sVar47;

  sVar36 = (short)uVar31 - sVar17;

  sVar37 = (short)((ulonglong)uVar31 >> 0x10) - sVar18;

  sVar38 = (short)((ulonglong)uVar31 >> 0x20) - sVar33;

  sVar39 = (short)((ulonglong)uVar31 >> 0x30) - sVar29;

  sVar16 = (short)(uVar1 >> 0x10);

  sVar13 = (short)(uVar1 >> 0x20);

  sVar23 = (short)(uVar1 >> 0x30);

  uVar2 = param_3[0xd];

  sVar46 = ((short)uVar45 - (short)uVar21) + sVar36;

  sVar48 = ((short)((ulonglong)uVar45 >> 0x10) - sVar15) + sVar37;

  sVar42 = ((short)((ulonglong)uVar45 >> 0x20) - sVar22) + sVar38;

  sVar43 = ((short)((ulonglong)uVar45 >> 0x30) - sVar24) + sVar39;

  param_3[1] = CONCAT26(sVar23 + sVar47,

                        CONCAT24(sVar13 + sVar44,CONCAT22(sVar16 + sVar41,(short)uVar1 + sVar40)));

  uVar3 = param_3[9];

  param_3[7] = CONCAT26(sVar34 - sVar43,

                        CONCAT24(sVar27 - sVar42,CONCAT22(sVar26 - sVar48,sVar25 - sVar46)));

  sVar32 = (short)(uVar2 >> 0x10);

  sVar28 = (short)(uVar2 >> 0x20);

  sVar35 = (short)(uVar2 >> 0x30);

  sVar22 = (short)(uVar3 >> 0x10);

  sVar15 = (short)(uVar3 >> 0x20);

  sVar24 = (short)(uVar3 >> 0x30);

  param_3[3] = CONCAT26(sVar35 + sVar29,

                        CONCAT24(sVar28 + sVar33,CONCAT22(sVar32 + sVar18,(short)uVar2 + sVar17)));

  param_3[5] = CONCAT26(sVar24 + sVar39,

                        CONCAT24(sVar15 + sVar38,CONCAT22(sVar22 + sVar37,(short)uVar3 + sVar36)));

  uVar14 = DAT_008333b0;

  uVar12 = CONCAT22(sVar15 - sVar38,sVar27 + sVar42);

  uVar4 = *param_3;

  uVar5 = param_3[2];

  uVar20 = CONCAT22(sVar13 - sVar44,sVar28 - sVar33);

  uVar21 = psraw(CONCAT44(CONCAT22((short)uVar1 - sVar40,(short)uVar2 - sVar17),

                          CONCAT22((short)uVar3 - sVar36,sVar25 + sVar46)),4);

  uVar21 = paddsw(uVar21,DAT_008333b0);

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar21 >> 0x20);

  sVar15 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[9] = (ulonglong)

               CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15) *

                                                                                      (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar21 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar21 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                        CONCAT12(cVar9,uVar11)) >> 0x10),uVar11) &

               0xffffffff00ff00ff;

  uVar21 = psraw(CONCAT44(CONCAT22(sVar16 - sVar41,sVar32 - sVar18),

                          CONCAT22(sVar22 - sVar37,sVar26 + sVar48)),4);

  uVar31 = paddsw(uVar21,uVar14);

  uVar21 = psraw(CONCAT44(uVar20,uVar12),4);

  sVar13 = (short)uVar31;

  sVar15 = (short)((ulonglong)uVar31 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar31 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar31 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar31 >> 0x20);

  sVar15 = (short)((ulonglong)uVar31 >> 0x30);

  param_3[0xb] = (ulonglong)

                 CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15)

                                                                                        * (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar31 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar31 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                          CONCAT12(cVar9,uVar11)) >> 0x10),uVar11) &

                 0xffffffff00ff00ff;

  uVar21 = paddsw(uVar21,uVar14);

  uVar31 = psraw(CONCAT44((int)(CONCAT26(sVar23 - sVar47,CONCAT24(sVar35 - sVar29,uVar20)) >> 0x20),

                          (int)(CONCAT26(sVar24 - sVar39,CONCAT24(sVar34 + sVar43,uVar12)) >> 0x20))

                 ,4);

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  sVar16 = (short)((ulonglong)uVar21 >> 0x20);

  sVar22 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[0xd] = (ulonglong)

                 CONCAT52(CONCAT41((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar22) *

                                                                                 (sVar22 < 0x100) *

                                                                                 (char)((ulonglong)

                                                                                        uVar21 >>

                                                                                       0x30) -

                                                                                (0xff < sVar22)) <<

                                                                  0x30) >> 0x28),

                                                          (0 < sVar16) * (sVar16 < 0x100) *

                                                          (char)((ulonglong)uVar21 >> 0x20) -

                                                          (0xff < sVar16)) << 0x20) >> 0x18),

                                   (0 < sVar15) * (sVar15 < 0x100) *

                                   (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar15)),

                          (ushort)(byte)((0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 -

                                        (0xff < sVar13)));

  uVar21 = paddsw(uVar31,uVar14);

  uVar20 = CONCAT22((short)(uVar5 >> 0x20),(short)(uVar4 >> 0x20));

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar21 >> 0x20);

  sVar15 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[0xf] = (ulonglong)

                 CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15)

                                                                                        * (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar21 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar21 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                          CONCAT12(cVar9,uVar11)) >> 0x10),uVar11) &

                 0xffffffff00ff00ff;

  uVar1 = param_3[6];

  uVar2 = param_3[4];

  uVar12 = CONCAT22((short)(uVar1 >> 0x20),(short)(uVar2 >> 0x20));

  uVar21 = psraw(CONCAT44(CONCAT22((short)uVar1,(short)uVar2),CONCAT22((short)uVar5,(short)uVar4)),4

                );

  uVar21 = paddsw(uVar21,uVar14);

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  sVar16 = (short)((ulonglong)uVar21 >> 0x20);

  sVar22 = (short)((ulonglong)uVar21 >> 0x30);

  *param_3 = (ulonglong)

             CONCAT52(CONCAT41((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar22) *

                                                                             (sVar22 < 0x100) *

                                                                             (char)((ulonglong)

                                                                                    uVar21 >> 0x30)

                                                                            - (0xff < sVar22)) <<

                                                              0x30) >> 0x28),

                                                      (0 < sVar16) * (sVar16 < 0x100) *

                                                      (char)((ulonglong)uVar21 >> 0x20) -

                                                      (0xff < sVar16)) << 0x20) >> 0x18),

                               (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) -

                               (0xff < sVar15)),

                      (ushort)(byte)((0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 -

                                    (0xff < sVar13)));

  uVar21 = psraw(CONCAT44(CONCAT22((short)(uVar1 >> 0x10),(short)(uVar2 >> 0x10)),

                          CONCAT22((short)(uVar5 >> 0x10),(short)(uVar4 >> 0x10))),4);

  uVar21 = paddsw(uVar21,uVar14);

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  sVar16 = (short)((ulonglong)uVar21 >> 0x20);

  sVar22 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[2] = (ulonglong)

               CONCAT52(CONCAT41((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar22) *

                                                                               (sVar22 < 0x100) *

                                                                               (char)((ulonglong)

                                                                                      uVar21 >> 0x30

                                                                                     ) -

                                                                              (0xff < sVar22)) <<

                                                                0x30) >> 0x28),

                                                        (0 < sVar16) * (sVar16 < 0x100) *

                                                        (char)((ulonglong)uVar21 >> 0x20) -

                                                        (0xff < sVar16)) << 0x20) >> 0x18),

                                 (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10)

                                 - (0xff < sVar15)),

                        (ushort)(byte)((0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 -

                                      (0xff < sVar13)));

  uVar21 = psraw(CONCAT44(uVar12,uVar20),4);

  uVar21 = paddsw(uVar21,uVar14);

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar21 >> 0x20);

  sVar15 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[4] = (ulonglong)

               CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15) *

                                                                                      (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar21 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar21 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                        CONCAT12(cVar9,uVar11)) >> 0x10),uVar11) &

               0xffffffff00ff00ff;

  uVar21 = psraw(CONCAT44((int)(CONCAT26((short)(uVar1 >> 0x30),

                                         CONCAT24((short)(uVar2 >> 0x30),uVar12)) >> 0x20),

                          (int)(CONCAT26((short)(uVar5 >> 0x30),

                                         CONCAT24((short)(uVar4 >> 0x30),uVar20)) >> 0x20)),4);

  uVar21 = paddsw(uVar21,uVar14);

  uVar1 = param_3[1];

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  sVar16 = (short)((ulonglong)uVar21 >> 0x20);

  sVar22 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[6] = (ulonglong)

               CONCAT52(CONCAT41((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar22) *

                                                                               (sVar22 < 0x100) *

                                                                               (char)((ulonglong)

                                                                                      uVar21 >> 0x30

                                                                                     ) -

                                                                              (0xff < sVar22)) <<

                                                                0x30) >> 0x28),

                                                        (0 < sVar16) * (sVar16 < 0x100) *

                                                        (char)((ulonglong)uVar21 >> 0x20) -

                                                        (0xff < sVar16)) << 0x20) >> 0x18),

                                 (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10)

                                 - (0xff < sVar15)),

                        (ushort)(byte)((0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 -

                                      (0xff < sVar13)));

  uVar2 = param_3[3];

  uVar3 = param_3[5];

  uVar20 = CONCAT22((short)(uVar2 >> 0x20),(short)(uVar1 >> 0x20));

  uVar4 = param_3[7];

  uVar30 = CONCAT22((short)(uVar4 >> 0x20),(short)(uVar3 >> 0x20));

  uVar5 = param_3[8];

  uVar21 = psraw(CONCAT44(CONCAT22((short)uVar4,(short)uVar3),CONCAT22((short)uVar2,(short)uVar1)),4

                );

  uVar21 = paddsw(uVar21,uVar14);

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar21 >> 0x20);

  sVar15 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[8] = (ulonglong)

               CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15) *

                                                                                      (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar21 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar21 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                        CONCAT12(cVar9,uVar11)) >> 0x10),uVar11) &

               0xffffffff00ff00ff;

  uVar21 = psraw(CONCAT44(uVar30,uVar20),4);

  uVar6 = param_3[10];

  uVar31 = paddsw(uVar21,uVar14);

  uVar7 = param_3[0xc];

  uVar21 = psraw(CONCAT44(CONCAT22((short)(uVar4 >> 0x10),(short)(uVar3 >> 0x10)),

                          CONCAT22((short)(uVar2 >> 0x10),(short)(uVar1 >> 0x10))),4);

  uVar21 = paddsw(uVar21,uVar14);

  sVar13 = (short)uVar31;

  sVar15 = (short)((ulonglong)uVar31 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar31 >> 0x10) - (0xff < sVar15);

  uVar19 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar31 - (0xff < sVar13));

  sVar16 = (short)((ulonglong)uVar31 >> 0x20);

  sVar22 = (short)((ulonglong)uVar31 >> 0x30);

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  cVar10 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar10,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar21 >> 0x20);

  sVar15 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[10] = (ulonglong)

                CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15)

                                                                                       * (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar21 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar21 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                         CONCAT12(cVar10,uVar11)) >> 0x10),uVar11) &

                0xffffffffffff00ff;

  uVar12 = CONCAT22((short)(uVar6 >> 0x20),(short)(uVar5 >> 0x20));

  uVar8 = param_3[0xe];

  param_3[0xc] = (ulonglong)

                 CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar22)

                                                                                        * (sVar22 < 

                                                  0x100) * (char)((ulonglong)uVar31 >> 0x30) -

                                                  (0xff < sVar22)) << 0x30) >> 0x28),

                                                  (0 < sVar16) * (sVar16 < 0x100) *

                                                  (char)((ulonglong)uVar31 >> 0x20) -

                                                  (0xff < sVar16)) << 0x20) >> 0x18),

                                          CONCAT12(cVar9,uVar19)) >> 0x10),uVar19) &

                 0xffffffff00ff00ff;

  uVar21 = psraw(CONCAT44((int)(CONCAT26((short)(uVar4 >> 0x30),

                                         CONCAT24((short)(uVar3 >> 0x30),uVar30)) >> 0x20),

                          (int)(CONCAT26((short)(uVar2 >> 0x30),

                                         CONCAT24((short)(uVar1 >> 0x30),uVar20)) >> 0x20)),4);

  uVar21 = paddsw(uVar21,uVar14);

  uVar20 = CONCAT22((short)(uVar8 >> 0x20),(short)(uVar7 >> 0x20));

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar21 >> 0x20);

  sVar15 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[0xe] = (ulonglong)

                 CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15)

                                                                                        * (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar21 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar21 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                          CONCAT12(cVar9,uVar11)) >> 0x10),uVar11) &

                 0xffffffff00ff00ff;

  uVar21 = psraw(CONCAT44(CONCAT22((short)uVar8,(short)uVar7),CONCAT22((short)uVar6,(short)uVar5)),4

                );

  uVar21 = paddsw(uVar21,uVar14);

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar21 >> 0x20);

  sVar15 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[1] = (ulonglong)

               CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15) *

                                                                                      (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar21 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar21 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                        CONCAT12(cVar9,uVar11)) >> 0x10),uVar11) &

               0xffffffff00ff00ff;

  uVar21 = psraw(CONCAT44(CONCAT22((short)(uVar8 >> 0x10),(short)(uVar7 >> 0x10)),

                          CONCAT22((short)(uVar6 >> 0x10),(short)(uVar5 >> 0x10))),4);

  uVar21 = paddsw(uVar21,uVar14);

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar21 >> 0x20);

  sVar15 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[3] = (ulonglong)

               CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15) *

                                                                                      (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar21 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar21 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                        CONCAT12(cVar9,uVar11)) >> 0x10),uVar11) &

               0xffffffff00ff00ff;

  uVar21 = psraw(CONCAT44(uVar20,uVar12),4);

  uVar21 = paddsw(uVar21,uVar14);

  sVar13 = (short)uVar21;

  sVar15 = (short)((ulonglong)uVar21 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar21 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar21 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar21 >> 0x20);

  sVar15 = (short)((ulonglong)uVar21 >> 0x30);

  param_3[5] = (ulonglong)

               CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15) *

                                                                                      (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar21 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar21 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                        CONCAT12(cVar9,uVar11)) >> 0x10),uVar11) &

               0xffffffff00ff00ff;

  uVar21 = psraw(CONCAT44((int)(CONCAT26((short)(uVar8 >> 0x30),

                                         CONCAT24((short)(uVar7 >> 0x30),uVar20)) >> 0x20),

                          (int)(CONCAT26((short)(uVar6 >> 0x30),

                                         CONCAT24((short)(uVar5 >> 0x30),uVar12)) >> 0x20)),4);

  uVar14 = paddsw(uVar21,uVar14);

  sVar13 = (short)uVar14;

  sVar15 = (short)((ulonglong)uVar14 >> 0x10);

  cVar9 = (0 < sVar15) * (sVar15 < 0x100) * (char)((ulonglong)uVar14 >> 0x10) - (0xff < sVar15);

  uVar11 = CONCAT11(cVar9,(0 < sVar13) * (sVar13 < 0x100) * (char)uVar14 - (0xff < sVar13));

  sVar13 = (short)((ulonglong)uVar14 >> 0x20);

  sVar15 = (short)((ulonglong)uVar14 >> 0x30);

  param_3[7] = (ulonglong)

               CONCAT52((int5)(CONCAT43((int)(((uint7)CONCAT21((short)(((uint7)(byte)((0 < sVar15) *

                                                                                      (sVar15 < 

                                                  0x100) * (char)((ulonglong)uVar14 >> 0x30) -

                                                  (0xff < sVar15)) << 0x30) >> 0x28),

                                                  (0 < sVar13) * (sVar13 < 0x100) *

                                                  (char)((ulonglong)uVar14 >> 0x20) -

                                                  (0xff < sVar13)) << 0x20) >> 0x18),

                                        CONCAT12(cVar9,uVar11)) >> 0x10),uVar11) &

               0xffffffff00ff00ff;

  return CONCAT44(param_2,in_EAX);

}





// --- FUN_0064e820 at 0x0064E820 (size: 501) ---


void FUN_0064e820(undefined8 *param_1,undefined8 *param_2)



{

  undefined8 uVar1;

  undefined8 uVar2;

  undefined8 uVar3;

  undefined8 uVar4;

  

  uVar2 = *param_2;

  uVar4 = param_2[1];

  uVar1 = psllw(*param_1,3);

  uVar3 = psllw(param_1[1],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  *param_1 = uVar2;

  param_1[1] = uVar4;

  uVar2 = param_2[2];

  uVar4 = param_2[3];

  uVar1 = psllw(param_1[2],3);

  uVar3 = psllw(param_1[3],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[2] = uVar2;

  param_1[3] = uVar4;

  uVar2 = param_2[4];

  uVar4 = param_2[5];

  uVar1 = psllw(param_1[4],3);

  uVar3 = psllw(param_1[5],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[4] = uVar2;

  param_1[5] = uVar4;

  uVar2 = param_2[6];

  uVar4 = param_2[7];

  uVar1 = psllw(param_1[6],3);

  uVar3 = psllw(param_1[7],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[6] = uVar2;

  param_1[7] = uVar4;

  uVar2 = param_2[8];

  uVar4 = param_2[9];

  uVar1 = psllw(param_1[8],3);

  uVar3 = psllw(param_1[9],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[8] = uVar2;

  param_1[9] = uVar4;

  uVar2 = param_2[10];

  uVar4 = param_2[0xb];

  uVar1 = psllw(param_1[10],3);

  uVar3 = psllw(param_1[0xb],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[10] = uVar2;

  param_1[0xb] = uVar4;

  uVar2 = param_2[0xc];

  uVar4 = param_2[0xd];

  uVar1 = psllw(param_1[0xc],3);

  uVar3 = psllw(param_1[0xd],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[0xc] = uVar2;

  param_1[0xd] = uVar4;

  uVar2 = param_2[0xe];

  uVar4 = param_2[0xf];

  uVar1 = psllw(param_1[0xe],3);

  uVar3 = psllw(param_1[0xf],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[0xe] = uVar2;

  param_1[0xf] = uVar4;

  return;

}





// --- FUN_0064ea20 at 0x0064EA20 (size: 501) ---


void FUN_0064ea20(undefined8 *param_1,undefined8 *param_2)



{

  undefined8 uVar1;

  undefined8 uVar2;

  undefined8 uVar3;

  undefined8 uVar4;

  

  uVar2 = *param_2;

  uVar4 = param_2[1];

  uVar1 = psllw(*param_1,3);

  uVar3 = psllw(param_1[1],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  *param_1 = uVar2;

  param_1[1] = uVar4;

  uVar2 = param_2[2];

  uVar4 = param_2[3];

  uVar1 = psllw(param_1[2],3);

  uVar3 = psllw(param_1[3],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[2] = uVar2;

  param_1[3] = uVar4;

  uVar2 = param_2[4];

  uVar4 = param_2[5];

  uVar1 = psllw(param_1[4],3);

  uVar3 = psllw(param_1[5],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[4] = uVar2;

  param_1[5] = uVar4;

  uVar2 = param_2[6];

  uVar4 = param_2[7];

  uVar1 = psllw(param_1[6],3);

  uVar3 = psllw(param_1[7],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[6] = uVar2;

  param_1[7] = uVar4;

  uVar2 = param_2[8];

  uVar4 = param_2[9];

  uVar1 = psllw(param_1[8],3);

  uVar3 = psllw(param_1[9],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[8] = uVar2;

  param_1[9] = uVar4;

  uVar2 = param_2[10];

  uVar4 = param_2[0xb];

  uVar1 = psllw(param_1[10],3);

  uVar3 = psllw(param_1[0xb],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[10] = uVar2;

  param_1[0xb] = uVar4;

  uVar2 = param_2[0xc];

  uVar4 = param_2[0xd];

  uVar1 = psllw(param_1[0xc],3);

  uVar3 = psllw(param_1[0xd],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[0xc] = uVar2;

  param_1[0xd] = uVar4;

  uVar2 = param_2[0xe];

  uVar4 = param_2[0xf];

  uVar1 = psllw(param_1[0xe],3);

  uVar3 = psllw(param_1[0xf],3);

  uVar2 = pmulhw(uVar1,CONCAT26((ushort)((ulonglong)uVar2 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar2 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar2 >> 0x10) >> 1,

                                                  (ushort)uVar2 >> 1))));

  uVar4 = pmulhw(uVar3,CONCAT26((ushort)((ulonglong)uVar4 >> 0x31),

                                CONCAT24((ushort)((ulonglong)uVar4 >> 0x20) >> 1,

                                         CONCAT22((ushort)((ulonglong)uVar4 >> 0x10) >> 1,

                                                  (ushort)uVar4 >> 1))));

  uVar2 = psraw(CONCAT26((short)((ulonglong)uVar2 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar2 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar2 >> 0x10) + 1,(short)uVar2 + 1)))

                ,1);

  uVar4 = psraw(CONCAT26((short)((ulonglong)uVar4 >> 0x30) + 1,

                         CONCAT24((short)((ulonglong)uVar4 >> 0x20) + 1,

                                  CONCAT22((short)((ulonglong)uVar4 >> 0x10) + 1,(short)uVar4 + 1)))

                ,1);

  param_1[0xe] = uVar2;

  param_1[0xf] = uVar4;

  return;

}





// --- FUN_0064ec20 at 0x0064EC20 (size: 1282) ---


void FUN_0064ec20(undefined1 (*param_1) [16],ushort *param_2)



{

  undefined1 auVar1 [16];

  undefined1 auVar2 [16];

  undefined1 auVar3 [16];

  undefined1 auVar4 [16];

  undefined1 auVar5 [16];

  undefined1 auVar6 [16];

  undefined1 auVar7 [16];

  undefined1 auVar8 [16];

  undefined1 auVar9 [16];

  undefined1 auVar10 [16];

  undefined1 auVar11 [16];

  undefined1 auVar12 [16];

  undefined1 auVar13 [16];

  undefined1 auVar14 [16];

  undefined1 auVar15 [16];

  undefined1 auVar16 [16];

  undefined1 auVar17 [16];

  undefined1 auVar18 [16];

  undefined1 auVar19 [16];

  undefined1 auVar20 [16];

  undefined1 auVar21 [16];

  undefined1 auVar22 [16];

  undefined1 auVar23 [16];

  undefined1 auVar24 [16];

  undefined1 auVar25 [16];

  undefined1 auVar26 [16];

  undefined1 auVar27 [16];

  undefined1 auVar28 [16];

  undefined1 auVar29 [16];

  undefined1 auVar30 [16];

  undefined1 auVar31 [16];

  undefined1 auVar32 [16];

  undefined1 auVar33 [16];

  undefined1 auVar34 [16];

  undefined1 auVar35 [16];

  undefined1 auVar36 [16];

  undefined1 auVar37 [16];

  undefined1 auVar38 [16];

  undefined1 auVar39 [16];

  undefined1 auVar40 [16];

  undefined1 auVar41 [16];

  undefined1 auVar42 [16];

  undefined1 auVar43 [16];

  undefined1 auVar44 [16];

  undefined1 auVar45 [16];

  undefined1 auVar46 [16];

  undefined1 auVar47 [16];

  undefined1 auVar48 [16];

  undefined1 auVar49 [16];

  undefined1 auVar50 [16];

  undefined1 auVar51 [16];

  undefined1 auVar52 [16];

  undefined1 auVar53 [16];

  undefined1 auVar54 [16];

  undefined1 auVar55 [16];

  undefined1 auVar56 [16];

  undefined1 auVar57 [16];

  undefined1 auVar58 [16];

  undefined1 auVar59 [16];

  undefined1 auVar60 [16];

  undefined1 auVar61 [16];

  undefined1 auVar62 [16];

  undefined1 auVar63 [16];

  undefined1 auVar64 [16];

  undefined1 auVar65 [16];

  

  if (((uint)param_1 & 0xf) == 0) {

    if (((uint)param_2 & 0xf) == 0) {

      auVar1 = psllw(*param_1,3);

      auVar32 = psllw(param_1[1],3);

      auVar28._0_2_ = *param_2 >> 1;

      auVar28._2_2_ = param_2[1] >> 1;

      auVar28._4_2_ = param_2[2] >> 1;

      auVar28._6_2_ = param_2[3] >> 1;

      auVar28._8_2_ = param_2[4] >> 1;

      auVar28._10_2_ = param_2[5] >> 1;

      auVar28._12_2_ = param_2[6] >> 1;

      auVar28._14_2_ = param_2[7] >> 1;

      auVar62._0_2_ = param_2[8] >> 1;

      auVar62._2_2_ = param_2[9] >> 1;

      auVar62._4_2_ = param_2[10] >> 1;

      auVar62._6_2_ = param_2[0xb] >> 1;

      auVar62._8_2_ = param_2[0xc] >> 1;

      auVar62._10_2_ = param_2[0xd] >> 1;

      auVar62._12_2_ = param_2[0xe] >> 1;

      auVar62._14_2_ = param_2[0xf] >> 1;

      auVar1 = pmulhw(auVar1,auVar28);

      auVar45 = pmulhw(auVar32,auVar62);

      auVar32._0_2_ = auVar1._0_2_ + 1;

      auVar32._2_2_ = auVar1._2_2_ + 1;

      auVar32._4_2_ = auVar1._4_2_ + 1;

      auVar32._6_2_ = auVar1._6_2_ + 1;

      auVar32._8_2_ = auVar1._8_2_ + 1;

      auVar32._10_2_ = auVar1._10_2_ + 1;

      auVar32._12_2_ = auVar1._12_2_ + 1;

      auVar32._14_2_ = auVar1._14_2_ + 1;

      auVar46._0_2_ = auVar45._0_2_ + 1;

      auVar46._2_2_ = auVar45._2_2_ + 1;

      auVar46._4_2_ = auVar45._4_2_ + 1;

      auVar46._6_2_ = auVar45._6_2_ + 1;

      auVar46._8_2_ = auVar45._8_2_ + 1;

      auVar46._10_2_ = auVar45._10_2_ + 1;

      auVar46._12_2_ = auVar45._12_2_ + 1;

      auVar46._14_2_ = auVar45._14_2_ + 1;

      auVar1 = psraw(auVar32,1);

      auVar32 = psraw(auVar46,1);

      *param_1 = auVar1;

      param_1[1] = auVar32;

      auVar1 = psllw(param_1[2],3);

      auVar32 = psllw(param_1[3],3);

      auVar29._0_2_ = param_2[0x10] >> 1;

      auVar29._2_2_ = param_2[0x11] >> 1;

      auVar29._4_2_ = param_2[0x12] >> 1;

      auVar29._6_2_ = param_2[0x13] >> 1;

      auVar29._8_2_ = param_2[0x14] >> 1;

      auVar29._10_2_ = param_2[0x15] >> 1;

      auVar29._12_2_ = param_2[0x16] >> 1;

      auVar29._14_2_ = param_2[0x17] >> 1;

      auVar63._0_2_ = param_2[0x18] >> 1;

      auVar63._2_2_ = param_2[0x19] >> 1;

      auVar63._4_2_ = param_2[0x1a] >> 1;

      auVar63._6_2_ = param_2[0x1b] >> 1;

      auVar63._8_2_ = param_2[0x1c] >> 1;

      auVar63._10_2_ = param_2[0x1d] >> 1;

      auVar63._12_2_ = param_2[0x1e] >> 1;

      auVar63._14_2_ = param_2[0x1f] >> 1;

      auVar1 = pmulhw(auVar1,auVar29);

      auVar32 = pmulhw(auVar32,auVar63);

      auVar45._0_2_ = auVar1._0_2_ + 1;

      auVar45._2_2_ = auVar1._2_2_ + 1;

      auVar45._4_2_ = auVar1._4_2_ + 1;

      auVar45._6_2_ = auVar1._6_2_ + 1;

      auVar45._8_2_ = auVar1._8_2_ + 1;

      auVar45._10_2_ = auVar1._10_2_ + 1;

      auVar45._12_2_ = auVar1._12_2_ + 1;

      auVar45._14_2_ = auVar1._14_2_ + 1;

      auVar47._0_2_ = auVar32._0_2_ + 1;

      auVar47._2_2_ = auVar32._2_2_ + 1;

      auVar47._4_2_ = auVar32._4_2_ + 1;

      auVar47._6_2_ = auVar32._6_2_ + 1;

      auVar47._8_2_ = auVar32._8_2_ + 1;

      auVar47._10_2_ = auVar32._10_2_ + 1;

      auVar47._12_2_ = auVar32._12_2_ + 1;

      auVar47._14_2_ = auVar32._14_2_ + 1;

      auVar1 = psraw(auVar45,1);

      auVar32 = psraw(auVar47,1);

      param_1[2] = auVar1;

      param_1[3] = auVar32;

      auVar1 = psllw(param_1[4],3);

      auVar32 = psllw(param_1[5],3);

      auVar30._0_2_ = param_2[0x20] >> 1;

      auVar30._2_2_ = param_2[0x21] >> 1;

      auVar30._4_2_ = param_2[0x22] >> 1;

      auVar30._6_2_ = param_2[0x23] >> 1;

      auVar30._8_2_ = param_2[0x24] >> 1;

      auVar30._10_2_ = param_2[0x25] >> 1;

      auVar30._12_2_ = param_2[0x26] >> 1;

      auVar30._14_2_ = param_2[0x27] >> 1;

      auVar64._0_2_ = param_2[0x28] >> 1;

      auVar64._2_2_ = param_2[0x29] >> 1;

      auVar64._4_2_ = param_2[0x2a] >> 1;

      auVar64._6_2_ = param_2[0x2b] >> 1;

      auVar64._8_2_ = param_2[0x2c] >> 1;

      auVar64._10_2_ = param_2[0x2d] >> 1;

      auVar64._12_2_ = param_2[0x2e] >> 1;

      auVar64._14_2_ = param_2[0x2f] >> 1;

      auVar1 = pmulhw(auVar1,auVar30);

      auVar32 = pmulhw(auVar32,auVar64);

      auVar14._0_2_ = auVar1._0_2_ + 1;

      auVar14._2_2_ = auVar1._2_2_ + 1;

      auVar14._4_2_ = auVar1._4_2_ + 1;

      auVar14._6_2_ = auVar1._6_2_ + 1;

      auVar14._8_2_ = auVar1._8_2_ + 1;

      auVar14._10_2_ = auVar1._10_2_ + 1;

      auVar14._12_2_ = auVar1._12_2_ + 1;

      auVar14._14_2_ = auVar1._14_2_ + 1;

      auVar48._0_2_ = auVar32._0_2_ + 1;

      auVar48._2_2_ = auVar32._2_2_ + 1;

      auVar48._4_2_ = auVar32._4_2_ + 1;

      auVar48._6_2_ = auVar32._6_2_ + 1;

      auVar48._8_2_ = auVar32._8_2_ + 1;

      auVar48._10_2_ = auVar32._10_2_ + 1;

      auVar48._12_2_ = auVar32._12_2_ + 1;

      auVar48._14_2_ = auVar32._14_2_ + 1;

      auVar1 = psraw(auVar14,1);

      auVar32 = psraw(auVar48,1);

      param_1[4] = auVar1;

      param_1[5] = auVar32;

      auVar1 = psllw(param_1[6],3);

      auVar32 = psllw(param_1[7],3);

      auVar31._0_2_ = param_2[0x30] >> 1;

      auVar31._2_2_ = param_2[0x31] >> 1;

      auVar31._4_2_ = param_2[0x32] >> 1;

      auVar31._6_2_ = param_2[0x33] >> 1;

      auVar31._8_2_ = param_2[0x34] >> 1;

      auVar31._10_2_ = param_2[0x35] >> 1;

      auVar31._12_2_ = param_2[0x36] >> 1;

      auVar31._14_2_ = param_2[0x37] >> 1;

      auVar65._0_2_ = param_2[0x38] >> 1;

      auVar65._2_2_ = param_2[0x39] >> 1;

      auVar65._4_2_ = param_2[0x3a] >> 1;

      auVar65._6_2_ = param_2[0x3b] >> 1;

      auVar65._8_2_ = param_2[0x3c] >> 1;

      auVar65._10_2_ = param_2[0x3d] >> 1;

      auVar65._12_2_ = param_2[0x3e] >> 1;

      auVar65._14_2_ = param_2[0x3f] >> 1;

      auVar1 = pmulhw(auVar1,auVar31);

      auVar32 = pmulhw(auVar32,auVar65);

      auVar15._0_2_ = auVar1._0_2_ + 1;

      auVar15._2_2_ = auVar1._2_2_ + 1;

      auVar15._4_2_ = auVar1._4_2_ + 1;

      auVar15._6_2_ = auVar1._6_2_ + 1;

      auVar15._8_2_ = auVar1._8_2_ + 1;

      auVar15._10_2_ = auVar1._10_2_ + 1;

      auVar15._12_2_ = auVar1._12_2_ + 1;

      auVar15._14_2_ = auVar1._14_2_ + 1;

      auVar49._0_2_ = auVar32._0_2_ + 1;

      auVar49._2_2_ = auVar32._2_2_ + 1;

      auVar49._4_2_ = auVar32._4_2_ + 1;

      auVar49._6_2_ = auVar32._6_2_ + 1;

      auVar49._8_2_ = auVar32._8_2_ + 1;

      auVar49._10_2_ = auVar32._10_2_ + 1;

      auVar49._12_2_ = auVar32._12_2_ + 1;

      auVar49._14_2_ = auVar32._14_2_ + 1;

      auVar1 = psraw(auVar15,1);

      auVar32 = psraw(auVar49,1);

      param_1[6] = auVar1;

      param_1[7] = auVar32;

    }

    else {

      auVar1 = psllw(*param_1,3);

      auVar32 = psllw(param_1[1],3);

      auVar24._0_2_ = *param_2 >> 1;

      auVar24._2_2_ = param_2[1] >> 1;

      auVar24._4_2_ = param_2[2] >> 1;

      auVar24._6_2_ = param_2[3] >> 1;

      auVar24._8_2_ = param_2[4] >> 1;

      auVar24._10_2_ = param_2[5] >> 1;

      auVar24._12_2_ = param_2[6] >> 1;

      auVar24._14_2_ = param_2[7] >> 1;

      auVar58._0_2_ = param_2[8] >> 1;

      auVar58._2_2_ = param_2[9] >> 1;

      auVar58._4_2_ = param_2[10] >> 1;

      auVar58._6_2_ = param_2[0xb] >> 1;

      auVar58._8_2_ = param_2[0xc] >> 1;

      auVar58._10_2_ = param_2[0xd] >> 1;

      auVar58._12_2_ = param_2[0xe] >> 1;

      auVar58._14_2_ = param_2[0xf] >> 1;

      auVar1 = pmulhw(auVar1,auVar24);

      auVar32 = pmulhw(auVar32,auVar58);

      auVar10._0_2_ = auVar1._0_2_ + 1;

      auVar10._2_2_ = auVar1._2_2_ + 1;

      auVar10._4_2_ = auVar1._4_2_ + 1;

      auVar10._6_2_ = auVar1._6_2_ + 1;

      auVar10._8_2_ = auVar1._8_2_ + 1;

      auVar10._10_2_ = auVar1._10_2_ + 1;

      auVar10._12_2_ = auVar1._12_2_ + 1;

      auVar10._14_2_ = auVar1._14_2_ + 1;

      auVar41._0_2_ = auVar32._0_2_ + 1;

      auVar41._2_2_ = auVar32._2_2_ + 1;

      auVar41._4_2_ = auVar32._4_2_ + 1;

      auVar41._6_2_ = auVar32._6_2_ + 1;

      auVar41._8_2_ = auVar32._8_2_ + 1;

      auVar41._10_2_ = auVar32._10_2_ + 1;

      auVar41._12_2_ = auVar32._12_2_ + 1;

      auVar41._14_2_ = auVar32._14_2_ + 1;

      auVar1 = psraw(auVar10,1);

      auVar32 = psraw(auVar41,1);

      *param_1 = auVar1;

      param_1[1] = auVar32;

      auVar1 = psllw(param_1[2],3);

      auVar32 = psllw(param_1[3],3);

      auVar25._0_2_ = param_2[0x10] >> 1;

      auVar25._2_2_ = param_2[0x11] >> 1;

      auVar25._4_2_ = param_2[0x12] >> 1;

      auVar25._6_2_ = param_2[0x13] >> 1;

      auVar25._8_2_ = param_2[0x14] >> 1;

      auVar25._10_2_ = param_2[0x15] >> 1;

      auVar25._12_2_ = param_2[0x16] >> 1;

      auVar25._14_2_ = param_2[0x17] >> 1;

      auVar59._0_2_ = param_2[0x18] >> 1;

      auVar59._2_2_ = param_2[0x19] >> 1;

      auVar59._4_2_ = param_2[0x1a] >> 1;

      auVar59._6_2_ = param_2[0x1b] >> 1;

      auVar59._8_2_ = param_2[0x1c] >> 1;

      auVar59._10_2_ = param_2[0x1d] >> 1;

      auVar59._12_2_ = param_2[0x1e] >> 1;

      auVar59._14_2_ = param_2[0x1f] >> 1;

      auVar1 = pmulhw(auVar1,auVar25);

      auVar32 = pmulhw(auVar32,auVar59);

      auVar11._0_2_ = auVar1._0_2_ + 1;

      auVar11._2_2_ = auVar1._2_2_ + 1;

      auVar11._4_2_ = auVar1._4_2_ + 1;

      auVar11._6_2_ = auVar1._6_2_ + 1;

      auVar11._8_2_ = auVar1._8_2_ + 1;

      auVar11._10_2_ = auVar1._10_2_ + 1;

      auVar11._12_2_ = auVar1._12_2_ + 1;

      auVar11._14_2_ = auVar1._14_2_ + 1;

      auVar42._0_2_ = auVar32._0_2_ + 1;

      auVar42._2_2_ = auVar32._2_2_ + 1;

      auVar42._4_2_ = auVar32._4_2_ + 1;

      auVar42._6_2_ = auVar32._6_2_ + 1;

      auVar42._8_2_ = auVar32._8_2_ + 1;

      auVar42._10_2_ = auVar32._10_2_ + 1;

      auVar42._12_2_ = auVar32._12_2_ + 1;

      auVar42._14_2_ = auVar32._14_2_ + 1;

      auVar1 = psraw(auVar11,1);

      auVar32 = psraw(auVar42,1);

      param_1[2] = auVar1;

      param_1[3] = auVar32;

      auVar1 = psllw(param_1[4],3);

      auVar32 = psllw(param_1[5],3);

      auVar26._0_2_ = param_2[0x20] >> 1;

      auVar26._2_2_ = param_2[0x21] >> 1;

      auVar26._4_2_ = param_2[0x22] >> 1;

      auVar26._6_2_ = param_2[0x23] >> 1;

      auVar26._8_2_ = param_2[0x24] >> 1;

      auVar26._10_2_ = param_2[0x25] >> 1;

      auVar26._12_2_ = param_2[0x26] >> 1;

      auVar26._14_2_ = param_2[0x27] >> 1;

      auVar60._0_2_ = param_2[0x28] >> 1;

      auVar60._2_2_ = param_2[0x29] >> 1;

      auVar60._4_2_ = param_2[0x2a] >> 1;

      auVar60._6_2_ = param_2[0x2b] >> 1;

      auVar60._8_2_ = param_2[0x2c] >> 1;

      auVar60._10_2_ = param_2[0x2d] >> 1;

      auVar60._12_2_ = param_2[0x2e] >> 1;

      auVar60._14_2_ = param_2[0x2f] >> 1;

      auVar1 = pmulhw(auVar1,auVar26);

      auVar32 = pmulhw(auVar32,auVar60);

      auVar12._0_2_ = auVar1._0_2_ + 1;

      auVar12._2_2_ = auVar1._2_2_ + 1;

      auVar12._4_2_ = auVar1._4_2_ + 1;

      auVar12._6_2_ = auVar1._6_2_ + 1;

      auVar12._8_2_ = auVar1._8_2_ + 1;

      auVar12._10_2_ = auVar1._10_2_ + 1;

      auVar12._12_2_ = auVar1._12_2_ + 1;

      auVar12._14_2_ = auVar1._14_2_ + 1;

      auVar43._0_2_ = auVar32._0_2_ + 1;

      auVar43._2_2_ = auVar32._2_2_ + 1;

      auVar43._4_2_ = auVar32._4_2_ + 1;

      auVar43._6_2_ = auVar32._6_2_ + 1;

      auVar43._8_2_ = auVar32._8_2_ + 1;

      auVar43._10_2_ = auVar32._10_2_ + 1;

      auVar43._12_2_ = auVar32._12_2_ + 1;

      auVar43._14_2_ = auVar32._14_2_ + 1;

      auVar1 = psraw(auVar12,1);

      auVar32 = psraw(auVar43,1);

      param_1[4] = auVar1;

      param_1[5] = auVar32;

      auVar1 = psllw(param_1[6],3);

      auVar32 = psllw(param_1[7],3);

      auVar27._0_2_ = param_2[0x30] >> 1;

      auVar27._2_2_ = param_2[0x31] >> 1;

      auVar27._4_2_ = param_2[0x32] >> 1;

      auVar27._6_2_ = param_2[0x33] >> 1;

      auVar27._8_2_ = param_2[0x34] >> 1;

      auVar27._10_2_ = param_2[0x35] >> 1;

      auVar27._12_2_ = param_2[0x36] >> 1;

      auVar27._14_2_ = param_2[0x37] >> 1;

      auVar61._0_2_ = param_2[0x38] >> 1;

      auVar61._2_2_ = param_2[0x39] >> 1;

      auVar61._4_2_ = param_2[0x3a] >> 1;

      auVar61._6_2_ = param_2[0x3b] >> 1;

      auVar61._8_2_ = param_2[0x3c] >> 1;

      auVar61._10_2_ = param_2[0x3d] >> 1;

      auVar61._12_2_ = param_2[0x3e] >> 1;

      auVar61._14_2_ = param_2[0x3f] >> 1;

      auVar1 = pmulhw(auVar1,auVar27);

      auVar32 = pmulhw(auVar32,auVar61);

      auVar13._0_2_ = auVar1._0_2_ + 1;

      auVar13._2_2_ = auVar1._2_2_ + 1;

      auVar13._4_2_ = auVar1._4_2_ + 1;

      auVar13._6_2_ = auVar1._6_2_ + 1;

      auVar13._8_2_ = auVar1._8_2_ + 1;

      auVar13._10_2_ = auVar1._10_2_ + 1;

      auVar13._12_2_ = auVar1._12_2_ + 1;

      auVar13._14_2_ = auVar1._14_2_ + 1;

      auVar44._0_2_ = auVar32._0_2_ + 1;

      auVar44._2_2_ = auVar32._2_2_ + 1;

      auVar44._4_2_ = auVar32._4_2_ + 1;

      auVar44._6_2_ = auVar32._6_2_ + 1;

      auVar44._8_2_ = auVar32._8_2_ + 1;

      auVar44._10_2_ = auVar32._10_2_ + 1;

      auVar44._12_2_ = auVar32._12_2_ + 1;

      auVar44._14_2_ = auVar32._14_2_ + 1;

      auVar1 = psraw(auVar13,1);

      auVar32 = psraw(auVar44,1);

      param_1[6] = auVar1;

      param_1[7] = auVar32;

    }

  }

  else if (((uint)param_2 & 0xf) == 0) {

    auVar1 = psllw(*param_1,3);

    auVar32 = psllw(param_1[1],3);

    auVar20._0_2_ = *param_2 >> 1;

    auVar20._2_2_ = param_2[1] >> 1;

    auVar20._4_2_ = param_2[2] >> 1;

    auVar20._6_2_ = param_2[3] >> 1;

    auVar20._8_2_ = param_2[4] >> 1;

    auVar20._10_2_ = param_2[5] >> 1;

    auVar20._12_2_ = param_2[6] >> 1;

    auVar20._14_2_ = param_2[7] >> 1;

    auVar54._0_2_ = param_2[8] >> 1;

    auVar54._2_2_ = param_2[9] >> 1;

    auVar54._4_2_ = param_2[10] >> 1;

    auVar54._6_2_ = param_2[0xb] >> 1;

    auVar54._8_2_ = param_2[0xc] >> 1;

    auVar54._10_2_ = param_2[0xd] >> 1;

    auVar54._12_2_ = param_2[0xe] >> 1;

    auVar54._14_2_ = param_2[0xf] >> 1;

    auVar1 = pmulhw(auVar1,auVar20);

    auVar32 = pmulhw(auVar32,auVar54);

    auVar6._0_2_ = auVar1._0_2_ + 1;

    auVar6._2_2_ = auVar1._2_2_ + 1;

    auVar6._4_2_ = auVar1._4_2_ + 1;

    auVar6._6_2_ = auVar1._6_2_ + 1;

    auVar6._8_2_ = auVar1._8_2_ + 1;

    auVar6._10_2_ = auVar1._10_2_ + 1;

    auVar6._12_2_ = auVar1._12_2_ + 1;

    auVar6._14_2_ = auVar1._14_2_ + 1;

    auVar37._0_2_ = auVar32._0_2_ + 1;

    auVar37._2_2_ = auVar32._2_2_ + 1;

    auVar37._4_2_ = auVar32._4_2_ + 1;

    auVar37._6_2_ = auVar32._6_2_ + 1;

    auVar37._8_2_ = auVar32._8_2_ + 1;

    auVar37._10_2_ = auVar32._10_2_ + 1;

    auVar37._12_2_ = auVar32._12_2_ + 1;

    auVar37._14_2_ = auVar32._14_2_ + 1;

    auVar1 = psraw(auVar6,1);

    auVar32 = psraw(auVar37,1);

    *param_1 = auVar1;

    param_1[1] = auVar32;

    auVar1 = psllw(param_1[2],3);

    auVar32 = psllw(param_1[3],3);

    auVar21._0_2_ = param_2[0x10] >> 1;

    auVar21._2_2_ = param_2[0x11] >> 1;

    auVar21._4_2_ = param_2[0x12] >> 1;

    auVar21._6_2_ = param_2[0x13] >> 1;

    auVar21._8_2_ = param_2[0x14] >> 1;

    auVar21._10_2_ = param_2[0x15] >> 1;

    auVar21._12_2_ = param_2[0x16] >> 1;

    auVar21._14_2_ = param_2[0x17] >> 1;

    auVar55._0_2_ = param_2[0x18] >> 1;

    auVar55._2_2_ = param_2[0x19] >> 1;

    auVar55._4_2_ = param_2[0x1a] >> 1;

    auVar55._6_2_ = param_2[0x1b] >> 1;

    auVar55._8_2_ = param_2[0x1c] >> 1;

    auVar55._10_2_ = param_2[0x1d] >> 1;

    auVar55._12_2_ = param_2[0x1e] >> 1;

    auVar55._14_2_ = param_2[0x1f] >> 1;

    auVar1 = pmulhw(auVar1,auVar21);

    auVar32 = pmulhw(auVar32,auVar55);

    auVar7._0_2_ = auVar1._0_2_ + 1;

    auVar7._2_2_ = auVar1._2_2_ + 1;

    auVar7._4_2_ = auVar1._4_2_ + 1;

    auVar7._6_2_ = auVar1._6_2_ + 1;

    auVar7._8_2_ = auVar1._8_2_ + 1;

    auVar7._10_2_ = auVar1._10_2_ + 1;

    auVar7._12_2_ = auVar1._12_2_ + 1;

    auVar7._14_2_ = auVar1._14_2_ + 1;

    auVar38._0_2_ = auVar32._0_2_ + 1;

    auVar38._2_2_ = auVar32._2_2_ + 1;

    auVar38._4_2_ = auVar32._4_2_ + 1;

    auVar38._6_2_ = auVar32._6_2_ + 1;

    auVar38._8_2_ = auVar32._8_2_ + 1;

    auVar38._10_2_ = auVar32._10_2_ + 1;

    auVar38._12_2_ = auVar32._12_2_ + 1;

    auVar38._14_2_ = auVar32._14_2_ + 1;

    auVar1 = psraw(auVar7,1);

    auVar32 = psraw(auVar38,1);

    param_1[2] = auVar1;

    param_1[3] = auVar32;

    auVar1 = psllw(param_1[4],3);

    auVar32 = psllw(param_1[5],3);

    auVar22._0_2_ = param_2[0x20] >> 1;

    auVar22._2_2_ = param_2[0x21] >> 1;

    auVar22._4_2_ = param_2[0x22] >> 1;

    auVar22._6_2_ = param_2[0x23] >> 1;

    auVar22._8_2_ = param_2[0x24] >> 1;

    auVar22._10_2_ = param_2[0x25] >> 1;

    auVar22._12_2_ = param_2[0x26] >> 1;

    auVar22._14_2_ = param_2[0x27] >> 1;

    auVar56._0_2_ = param_2[0x28] >> 1;

    auVar56._2_2_ = param_2[0x29] >> 1;

    auVar56._4_2_ = param_2[0x2a] >> 1;

    auVar56._6_2_ = param_2[0x2b] >> 1;

    auVar56._8_2_ = param_2[0x2c] >> 1;

    auVar56._10_2_ = param_2[0x2d] >> 1;

    auVar56._12_2_ = param_2[0x2e] >> 1;

    auVar56._14_2_ = param_2[0x2f] >> 1;

    auVar1 = pmulhw(auVar1,auVar22);

    auVar32 = pmulhw(auVar32,auVar56);

    auVar8._0_2_ = auVar1._0_2_ + 1;

    auVar8._2_2_ = auVar1._2_2_ + 1;

    auVar8._4_2_ = auVar1._4_2_ + 1;

    auVar8._6_2_ = auVar1._6_2_ + 1;

    auVar8._8_2_ = auVar1._8_2_ + 1;

    auVar8._10_2_ = auVar1._10_2_ + 1;

    auVar8._12_2_ = auVar1._12_2_ + 1;

    auVar8._14_2_ = auVar1._14_2_ + 1;

    auVar39._0_2_ = auVar32._0_2_ + 1;

    auVar39._2_2_ = auVar32._2_2_ + 1;

    auVar39._4_2_ = auVar32._4_2_ + 1;

    auVar39._6_2_ = auVar32._6_2_ + 1;

    auVar39._8_2_ = auVar32._8_2_ + 1;

    auVar39._10_2_ = auVar32._10_2_ + 1;

    auVar39._12_2_ = auVar32._12_2_ + 1;

    auVar39._14_2_ = auVar32._14_2_ + 1;

    auVar1 = psraw(auVar8,1);

    auVar32 = psraw(auVar39,1);

    param_1[4] = auVar1;

    param_1[5] = auVar32;

    auVar1 = psllw(param_1[6],3);

    auVar32 = psllw(param_1[7],3);

    auVar23._0_2_ = param_2[0x30] >> 1;

    auVar23._2_2_ = param_2[0x31] >> 1;

    auVar23._4_2_ = param_2[0x32] >> 1;

    auVar23._6_2_ = param_2[0x33] >> 1;

    auVar23._8_2_ = param_2[0x34] >> 1;

    auVar23._10_2_ = param_2[0x35] >> 1;

    auVar23._12_2_ = param_2[0x36] >> 1;

    auVar23._14_2_ = param_2[0x37] >> 1;

    auVar57._0_2_ = param_2[0x38] >> 1;

    auVar57._2_2_ = param_2[0x39] >> 1;

    auVar57._4_2_ = param_2[0x3a] >> 1;

    auVar57._6_2_ = param_2[0x3b] >> 1;

    auVar57._8_2_ = param_2[0x3c] >> 1;

    auVar57._10_2_ = param_2[0x3d] >> 1;

    auVar57._12_2_ = param_2[0x3e] >> 1;

    auVar57._14_2_ = param_2[0x3f] >> 1;

    auVar1 = pmulhw(auVar1,auVar23);

    auVar32 = pmulhw(auVar32,auVar57);

    auVar9._0_2_ = auVar1._0_2_ + 1;

    auVar9._2_2_ = auVar1._2_2_ + 1;

    auVar9._4_2_ = auVar1._4_2_ + 1;

    auVar9._6_2_ = auVar1._6_2_ + 1;

    auVar9._8_2_ = auVar1._8_2_ + 1;

    auVar9._10_2_ = auVar1._10_2_ + 1;

    auVar9._12_2_ = auVar1._12_2_ + 1;

    auVar9._14_2_ = auVar1._14_2_ + 1;

    auVar40._0_2_ = auVar32._0_2_ + 1;

    auVar40._2_2_ = auVar32._2_2_ + 1;

    auVar40._4_2_ = auVar32._4_2_ + 1;

    auVar40._6_2_ = auVar32._6_2_ + 1;

    auVar40._8_2_ = auVar32._8_2_ + 1;

    auVar40._10_2_ = auVar32._10_2_ + 1;

    auVar40._12_2_ = auVar32._12_2_ + 1;

    auVar40._14_2_ = auVar32._14_2_ + 1;

    auVar1 = psraw(auVar9,1);

    auVar32 = psraw(auVar40,1);

    param_1[6] = auVar1;

    param_1[7] = auVar32;

  }

  else {

    auVar1 = psllw(*param_1,3);

    auVar32 = psllw(param_1[1],3);

    auVar16._0_2_ = *param_2 >> 1;

    auVar16._2_2_ = param_2[1] >> 1;

    auVar16._4_2_ = param_2[2] >> 1;

    auVar16._6_2_ = param_2[3] >> 1;

    auVar16._8_2_ = param_2[4] >> 1;

    auVar16._10_2_ = param_2[5] >> 1;

    auVar16._12_2_ = param_2[6] >> 1;

    auVar16._14_2_ = param_2[7] >> 1;

    auVar50._0_2_ = param_2[8] >> 1;

    auVar50._2_2_ = param_2[9] >> 1;

    auVar50._4_2_ = param_2[10] >> 1;

    auVar50._6_2_ = param_2[0xb] >> 1;

    auVar50._8_2_ = param_2[0xc] >> 1;

    auVar50._10_2_ = param_2[0xd] >> 1;

    auVar50._12_2_ = param_2[0xe] >> 1;

    auVar50._14_2_ = param_2[0xf] >> 1;

    auVar1 = pmulhw(auVar1,auVar16);

    auVar32 = pmulhw(auVar32,auVar50);

    auVar2._0_2_ = auVar1._0_2_ + 1;

    auVar2._2_2_ = auVar1._2_2_ + 1;

    auVar2._4_2_ = auVar1._4_2_ + 1;

    auVar2._6_2_ = auVar1._6_2_ + 1;

    auVar2._8_2_ = auVar1._8_2_ + 1;

    auVar2._10_2_ = auVar1._10_2_ + 1;

    auVar2._12_2_ = auVar1._12_2_ + 1;

    auVar2._14_2_ = auVar1._14_2_ + 1;

    auVar33._0_2_ = auVar32._0_2_ + 1;

    auVar33._2_2_ = auVar32._2_2_ + 1;

    auVar33._4_2_ = auVar32._4_2_ + 1;

    auVar33._6_2_ = auVar32._6_2_ + 1;

    auVar33._8_2_ = auVar32._8_2_ + 1;

    auVar33._10_2_ = auVar32._10_2_ + 1;

    auVar33._12_2_ = auVar32._12_2_ + 1;

    auVar33._14_2_ = auVar32._14_2_ + 1;

    auVar1 = psraw(auVar2,1);

    auVar32 = psraw(auVar33,1);

    *param_1 = auVar1;

    param_1[1] = auVar32;

    auVar1 = psllw(param_1[2],3);

    auVar32 = psllw(param_1[3],3);

    auVar17._0_2_ = param_2[0x10] >> 1;

    auVar17._2_2_ = param_2[0x11] >> 1;

    auVar17._4_2_ = param_2[0x12] >> 1;

    auVar17._6_2_ = param_2[0x13] >> 1;

    auVar17._8_2_ = param_2[0x14] >> 1;

    auVar17._10_2_ = param_2[0x15] >> 1;

    auVar17._12_2_ = param_2[0x16] >> 1;

    auVar17._14_2_ = param_2[0x17] >> 1;

    auVar51._0_2_ = param_2[0x18] >> 1;

    auVar51._2_2_ = param_2[0x19] >> 1;

    auVar51._4_2_ = param_2[0x1a] >> 1;

    auVar51._6_2_ = param_2[0x1b] >> 1;

    auVar51._8_2_ = param_2[0x1c] >> 1;

    auVar51._10_2_ = param_2[0x1d] >> 1;

    auVar51._12_2_ = param_2[0x1e] >> 1;

    auVar51._14_2_ = param_2[0x1f] >> 1;

    auVar1 = pmulhw(auVar1,auVar17);

    auVar32 = pmulhw(auVar32,auVar51);

    auVar3._0_2_ = auVar1._0_2_ + 1;

    auVar3._2_2_ = auVar1._2_2_ + 1;

    auVar3._4_2_ = auVar1._4_2_ + 1;

    auVar3._6_2_ = auVar1._6_2_ + 1;

    auVar3._8_2_ = auVar1._8_2_ + 1;

    auVar3._10_2_ = auVar1._10_2_ + 1;

    auVar3._12_2_ = auVar1._12_2_ + 1;

    auVar3._14_2_ = auVar1._14_2_ + 1;

    auVar34._0_2_ = auVar32._0_2_ + 1;

    auVar34._2_2_ = auVar32._2_2_ + 1;

    auVar34._4_2_ = auVar32._4_2_ + 1;

    auVar34._6_2_ = auVar32._6_2_ + 1;

    auVar34._8_2_ = auVar32._8_2_ + 1;

    auVar34._10_2_ = auVar32._10_2_ + 1;

    auVar34._12_2_ = auVar32._12_2_ + 1;

    auVar34._14_2_ = auVar32._14_2_ + 1;

    auVar1 = psraw(auVar3,1);

    auVar32 = psraw(auVar34,1);

    param_1[2] = auVar1;

    param_1[3] = auVar32;

    auVar1 = psllw(param_1[4],3);

    auVar32 = psllw(param_1[5],3);

    auVar18._0_2_ = param_2[0x20] >> 1;

    auVar18._2_2_ = param_2[0x21] >> 1;

    auVar18._4_2_ = param_2[0x22] >> 1;

    auVar18._6_2_ = param_2[0x23] >> 1;

    auVar18._8_2_ = param_2[0x24] >> 1;

    auVar18._10_2_ = param_2[0x25] >> 1;

    auVar18._12_2_ = param_2[0x26] >> 1;

    auVar18._14_2_ = param_2[0x27] >> 1;

    auVar52._0_2_ = param_2[0x28] >> 1;

    auVar52._2_2_ = param_2[0x29] >> 1;

    auVar52._4_2_ = param_2[0x2a] >> 1;

    auVar52._6_2_ = param_2[0x2b] >> 1;

    auVar52._8_2_ = param_2[0x2c] >> 1;

    auVar52._10_2_ = param_2[0x2d] >> 1;

    auVar52._12_2_ = param_2[0x2e] >> 1;

    auVar52._14_2_ = param_2[0x2f] >> 1;

    auVar1 = pmulhw(auVar1,auVar18);

    auVar32 = pmulhw(auVar32,auVar52);

    auVar4._0_2_ = auVar1._0_2_ + 1;

    auVar4._2_2_ = auVar1._2_2_ + 1;

    auVar4._4_2_ = auVar1._4_2_ + 1;

    auVar4._6_2_ = auVar1._6_2_ + 1;

    auVar4._8_2_ = auVar1._8_2_ + 1;

    auVar4._10_2_ = auVar1._10_2_ + 1;

    auVar4._12_2_ = auVar1._12_2_ + 1;

    auVar4._14_2_ = auVar1._14_2_ + 1;

    auVar35._0_2_ = auVar32._0_2_ + 1;

    auVar35._2_2_ = auVar32._2_2_ + 1;

    auVar35._4_2_ = auVar32._4_2_ + 1;

    auVar35._6_2_ = auVar32._6_2_ + 1;

    auVar35._8_2_ = auVar32._8_2_ + 1;

    auVar35._10_2_ = auVar32._10_2_ + 1;

    auVar35._12_2_ = auVar32._12_2_ + 1;

    auVar35._14_2_ = auVar32._14_2_ + 1;

    auVar1 = psraw(auVar4,1);

    auVar32 = psraw(auVar35,1);

    param_1[4] = auVar1;

    param_1[5] = auVar32;

    auVar1 = psllw(param_1[6],3);

    auVar32 = psllw(param_1[7],3);

    auVar19._0_2_ = param_2[0x30] >> 1;

    auVar19._2_2_ = param_2[0x31] >> 1;

    auVar19._4_2_ = param_2[0x32] >> 1;

    auVar19._6_2_ = param_2[0x33] >> 1;

    auVar19._8_2_ = param_2[0x34] >> 1;

    auVar19._10_2_ = param_2[0x35] >> 1;

    auVar19._12_2_ = param_2[0x36] >> 1;

    auVar19._14_2_ = param_2[0x37] >> 1;

    auVar53._0_2_ = param_2[0x38] >> 1;

    auVar53._2_2_ = param_2[0x39] >> 1;

    auVar53._4_2_ = param_2[0x3a] >> 1;

    auVar53._6_2_ = param_2[0x3b] >> 1;

    auVar53._8_2_ = param_2[0x3c] >> 1;

    auVar53._10_2_ = param_2[0x3d] >> 1;

    auVar53._12_2_ = param_2[0x3e] >> 1;

    auVar53._14_2_ = param_2[0x3f] >> 1;

    auVar1 = pmulhw(auVar1,auVar19);

    auVar32 = pmulhw(auVar32,auVar53);

    auVar5._0_2_ = auVar1._0_2_ + 1;

    auVar5._2_2_ = auVar1._2_2_ + 1;

    auVar5._4_2_ = auVar1._4_2_ + 1;

    auVar5._6_2_ = auVar1._6_2_ + 1;

    auVar5._8_2_ = auVar1._8_2_ + 1;

    auVar5._10_2_ = auVar1._10_2_ + 1;

    auVar5._12_2_ = auVar1._12_2_ + 1;

    auVar5._14_2_ = auVar1._14_2_ + 1;

    auVar36._0_2_ = auVar32._0_2_ + 1;

    auVar36._2_2_ = auVar32._2_2_ + 1;

    auVar36._4_2_ = auVar32._4_2_ + 1;

    auVar36._6_2_ = auVar32._6_2_ + 1;

    auVar36._8_2_ = auVar32._8_2_ + 1;

    auVar36._10_2_ = auVar32._10_2_ + 1;

    auVar36._12_2_ = auVar32._12_2_ + 1;

    auVar36._14_2_ = auVar32._14_2_ + 1;

    auVar1 = psraw(auVar5,1);

    auVar32 = psraw(auVar36,1);

    param_1[6] = auVar1;

    param_1[7] = auVar32;

  }

  return;

}





// --- FUN_0064f130 at 0x0064F130 (size: 2007) ---


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



void FUN_0064f130(undefined8 *param_1)



{

  undefined8 uVar1;

  undefined8 uVar2;

  ulonglong uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  undefined8 uVar7;

  ulonglong uVar8;

  undefined8 uVar9;

  undefined8 uVar10;

  int iVar11;

  undefined8 uVar12;

  int iVar13;

  

  uVar1 = paddsw(param_1[2],param_1[0xc]);

  uVar1 = psllw(uVar1,3);

  uVar5 = paddsw(param_1[10],param_1[4]);

  uVar7 = paddsw(*param_1,param_1[0xe]);

  uVar6 = psllw(uVar5,3);

  uVar4 = psubsw(param_1[2],param_1[0xc]);

  uVar5 = psubsw(uVar1,uVar6);

  uVar2 = pmulhw(DAT_00833400,uVar5);

  uVar12 = paddsw(param_1[6],param_1[8]);

  uVar7 = psllw(uVar7,3);

  uVar9 = paddsw(uVar1,uVar6);

  uVar6 = psllw(uVar12,3);

  uVar1 = psubsw(uVar7,uVar6);

  uVar3 = paddsw(uVar2,uVar1);

  uVar2 = paddsw(uVar7,uVar6);

  uVar4 = psllw(uVar4,4);

  uVar12 = pmulhw(uVar1,DAT_00833400);

  uVar1 = psubsw(param_1[4],param_1[10]);

  uVar6 = psubsw(uVar2,uVar9);

  param_1[4] = uVar3 | _DAT_008333d0;

  uVar9 = paddsw(uVar2,uVar9);

  uVar7 = psllw(uVar1,4);

  uVar2 = psubsw(param_1[6],param_1[8]);

  param_1[8] = uVar6;

  uVar1 = DAT_00833410;

  uVar6 = paddsw(uVar4,uVar7);

  uVar3 = pmulhw(uVar6,_DAT_00833430);

  uVar4 = psubsw(uVar4,uVar7);

  uVar6 = pmulhw(uVar4,_DAT_00833430);

  uVar8 = psubsw(uVar12,uVar5);

  uVar8 = uVar8 | _DAT_008333d0;

  uVar5 = psllw(uVar2,3);

  uVar3 = uVar3 | _DAT_008333d0;

  uVar2 = paddsw(uVar5,uVar6);

  uVar4 = psubsw(*param_1,param_1[0xe]);

  uVar6 = psubsw(uVar5,uVar6);

  uVar4 = psllw(uVar4,3);

  uVar5 = pmulhw(DAT_008333f0,uVar2);

  *param_1 = uVar9;

  uVar7 = pmulhw(uVar1,uVar6);

  param_1[0xc] = uVar8;

  uVar12 = psubsw(uVar4,uVar3);

  uVar1 = paddsw(uVar4,uVar3);

  uVar4 = pmulhw(DAT_00833410,uVar12);

  uVar3 = paddsw(uVar5,uVar1);

  uVar7 = paddsw(uVar7,uVar6);

  uVar1 = pmulhw(uVar1,DAT_008333f0);

  uVar5 = paddsw(uVar4,uVar12);

  uVar4 = psubsw(uVar12,uVar7);

  param_1[2] = uVar3 | _DAT_008333d0;

  uVar5 = paddsw(uVar5,uVar6);

  param_1[6] = uVar4;

  uVar1 = psubsw(uVar1,uVar2);

  param_1[10] = uVar5;

  param_1[0xe] = uVar1;

  uVar1 = paddsw(param_1[3],param_1[0xd]);

  uVar1 = psllw(uVar1,3);

  uVar5 = paddsw(param_1[0xb],param_1[5]);

  uVar7 = paddsw(param_1[1],param_1[0xf]);

  uVar6 = psllw(uVar5,3);

  uVar4 = psubsw(param_1[3],param_1[0xd]);

  uVar5 = psubsw(uVar1,uVar6);

  uVar2 = pmulhw(DAT_00833400,uVar5);

  uVar12 = paddsw(param_1[7],param_1[9]);

  uVar7 = psllw(uVar7,3);

  uVar9 = paddsw(uVar1,uVar6);

  uVar6 = psllw(uVar12,3);

  uVar1 = psubsw(uVar7,uVar6);

  uVar3 = paddsw(uVar2,uVar1);

  uVar2 = paddsw(uVar7,uVar6);

  uVar4 = psllw(uVar4,4);

  uVar12 = pmulhw(uVar1,DAT_00833400);

  uVar1 = psubsw(param_1[5],param_1[0xb]);

  uVar6 = psubsw(uVar2,uVar9);

  param_1[5] = uVar3 | _DAT_008333d0;

  uVar9 = paddsw(uVar2,uVar9);

  uVar7 = psllw(uVar1,4);

  uVar2 = psubsw(param_1[7],param_1[9]);

  param_1[9] = uVar6;

  uVar1 = DAT_00833410;

  uVar6 = paddsw(uVar4,uVar7);

  uVar3 = pmulhw(uVar6,_DAT_00833430);

  uVar4 = psubsw(uVar4,uVar7);

  uVar6 = pmulhw(uVar4,_DAT_00833430);

  uVar8 = psubsw(uVar12,uVar5);

  uVar8 = uVar8 | _DAT_008333d0;

  uVar5 = psllw(uVar2,3);

  uVar3 = uVar3 | _DAT_008333d0;

  uVar2 = paddsw(uVar5,uVar6);

  uVar4 = psubsw(param_1[1],param_1[0xf]);

  uVar6 = psubsw(uVar5,uVar6);

  uVar4 = psllw(uVar4,3);

  uVar5 = pmulhw(DAT_008333f0,uVar2);

  param_1[1] = uVar9;

  uVar7 = pmulhw(uVar1,uVar6);

  param_1[0xd] = uVar8;

  uVar12 = psubsw(uVar4,uVar3);

  uVar1 = paddsw(uVar4,uVar3);

  uVar4 = pmulhw(DAT_00833410,uVar12);

  uVar3 = paddsw(uVar5,uVar1);

  uVar7 = paddsw(uVar7,uVar6);

  uVar1 = pmulhw(uVar1,DAT_008333f0);

  uVar5 = paddsw(uVar4,uVar12);

  uVar4 = psubsw(uVar12,uVar7);

  param_1[3] = uVar3 | _DAT_008333d0;

  uVar5 = paddsw(uVar5,uVar6);

  param_1[7] = uVar4;

  uVar1 = psubsw(uVar1,uVar2);

  param_1[0xb] = uVar5;

  param_1[0xf] = uVar1;

  uVar1 = param_1[1];

  uVar5 = CONCAT44(CONCAT22((short)uVar1,(short)((ulonglong)uVar1 >> 0x10)),

                   CONCAT22((short)((ulonglong)uVar1 >> 0x20),(short)((ulonglong)uVar1 >> 0x30)));

  uVar1 = paddsw(*param_1,uVar5);

  uVar2 = psubsw(*param_1,uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar7 = pmaddwd(DAT_00833440,uVar5);

  uVar6 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar12 = pmaddwd(DAT_00833448,uVar6);

  uVar10 = pmaddwd(DAT_00833450,uVar5);

  uVar2 = pmaddwd(DAT_00833458,uVar6);

  iVar11 = (int)DAT_008333e0;

  iVar13 = (int)((ulonglong)DAT_008333e0 >> 0x20);

  uVar4 = pmaddwd(DAT_00833460,uVar5);

  uVar9 = pmaddwd(DAT_00833468,uVar6);

  uVar1 = pmaddwd(uVar5,_DAT_00833470);

  uVar2 = packssdw(CONCAT44((int)((ulonglong)uVar7 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar7 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar10 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar2 >> 0x20) >> 0x14,

                            (int)uVar10 + iVar11 + (int)uVar2 >> 0x14));

  uVar5 = pmaddwd(uVar6,_DAT_00833478);

  *param_1 = uVar2;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar9 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar9 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[1] = uVar1;

  uVar1 = param_1[3];

  uVar5 = CONCAT44(CONCAT22((short)uVar1,(short)((ulonglong)uVar1 >> 0x10)),

                   CONCAT22((short)((ulonglong)uVar1 >> 0x20),(short)((ulonglong)uVar1 >> 0x30)));

  uVar1 = paddsw(param_1[2],uVar5);

  uVar2 = psubsw(param_1[2],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar7 = pmaddwd(DAT_00833480,uVar5);

  uVar6 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar12 = pmaddwd(DAT_00833488,uVar6);

  uVar10 = pmaddwd(DAT_00833490,uVar5);

  uVar2 = pmaddwd(DAT_00833498,uVar6);

  uVar4 = pmaddwd(DAT_008334a0,uVar5);

  uVar9 = pmaddwd(DAT_008334a8,uVar6);

  uVar1 = pmaddwd(uVar5,_DAT_008334b0);

  uVar2 = packssdw(CONCAT44((int)((ulonglong)uVar7 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar7 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar10 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar2 >> 0x20) >> 0x14,

                            (int)uVar10 + iVar11 + (int)uVar2 >> 0x14));

  uVar5 = pmaddwd(uVar6,_DAT_008334b8);

  param_1[2] = uVar2;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar9 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar9 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[3] = uVar1;

  uVar1 = param_1[5];

  uVar5 = CONCAT44(CONCAT22((short)uVar1,(short)((ulonglong)uVar1 >> 0x10)),

                   CONCAT22((short)((ulonglong)uVar1 >> 0x20),(short)((ulonglong)uVar1 >> 0x30)));

  uVar1 = paddsw(param_1[4],uVar5);

  uVar2 = psubsw(param_1[4],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar7 = pmaddwd(DAT_008334c0,uVar5);

  uVar6 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar12 = pmaddwd(DAT_008334c8,uVar6);

  uVar10 = pmaddwd(DAT_008334d0,uVar5);

  uVar2 = pmaddwd(DAT_008334d8,uVar6);

  uVar4 = pmaddwd(DAT_008334e0,uVar5);

  uVar9 = pmaddwd(DAT_008334e8,uVar6);

  uVar1 = pmaddwd(uVar5,_DAT_008334f0);

  uVar2 = packssdw(CONCAT44((int)((ulonglong)uVar7 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar7 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar10 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar2 >> 0x20) >> 0x14,

                            (int)uVar10 + iVar11 + (int)uVar2 >> 0x14));

  uVar5 = pmaddwd(uVar6,_DAT_008334f8);

  param_1[4] = uVar2;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar9 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar9 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[5] = uVar1;

  uVar1 = param_1[7];

  uVar5 = CONCAT44(CONCAT22((short)uVar1,(short)((ulonglong)uVar1 >> 0x10)),

                   CONCAT22((short)((ulonglong)uVar1 >> 0x20),(short)((ulonglong)uVar1 >> 0x30)));

  uVar1 = paddsw(param_1[6],uVar5);

  uVar2 = psubsw(param_1[6],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar7 = pmaddwd(DAT_00833500,uVar5);

  uVar6 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar12 = pmaddwd(DAT_00833508,uVar6);

  uVar10 = pmaddwd(DAT_00833510,uVar5);

  uVar2 = pmaddwd(DAT_00833518,uVar6);

  uVar4 = pmaddwd(DAT_00833520,uVar5);

  uVar9 = pmaddwd(DAT_00833528,uVar6);

  uVar1 = pmaddwd(uVar5,_DAT_00833530);

  uVar2 = packssdw(CONCAT44((int)((ulonglong)uVar7 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar7 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar10 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar2 >> 0x20) >> 0x14,

                            (int)uVar10 + iVar11 + (int)uVar2 >> 0x14));

  uVar5 = pmaddwd(uVar6,_DAT_00833538);

  param_1[6] = uVar2;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar9 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar9 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[7] = uVar1;

  uVar1 = param_1[9];

  uVar5 = CONCAT44(CONCAT22((short)uVar1,(short)((ulonglong)uVar1 >> 0x10)),

                   CONCAT22((short)((ulonglong)uVar1 >> 0x20),(short)((ulonglong)uVar1 >> 0x30)));

  uVar1 = paddsw(param_1[8],uVar5);

  uVar2 = psubsw(param_1[8],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar7 = pmaddwd(DAT_00833440,uVar5);

  uVar6 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar12 = pmaddwd(DAT_00833448,uVar6);

  uVar10 = pmaddwd(DAT_00833450,uVar5);

  uVar2 = pmaddwd(DAT_00833458,uVar6);

  uVar4 = pmaddwd(DAT_00833460,uVar5);

  uVar9 = pmaddwd(DAT_00833468,uVar6);

  uVar1 = pmaddwd(uVar5,_DAT_00833470);

  uVar2 = packssdw(CONCAT44((int)((ulonglong)uVar7 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar7 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar10 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar2 >> 0x20) >> 0x14,

                            (int)uVar10 + iVar11 + (int)uVar2 >> 0x14));

  uVar5 = pmaddwd(uVar6,_DAT_00833478);

  param_1[8] = uVar2;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar9 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar9 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[9] = uVar1;

  uVar1 = param_1[0xb];

  uVar5 = CONCAT44(CONCAT22((short)uVar1,(short)((ulonglong)uVar1 >> 0x10)),

                   CONCAT22((short)((ulonglong)uVar1 >> 0x20),(short)((ulonglong)uVar1 >> 0x30)));

  uVar1 = paddsw(param_1[10],uVar5);

  uVar2 = psubsw(param_1[10],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar7 = pmaddwd(DAT_00833500,uVar5);

  uVar6 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar12 = pmaddwd(DAT_00833508,uVar6);

  uVar10 = pmaddwd(DAT_00833510,uVar5);

  uVar2 = pmaddwd(DAT_00833518,uVar6);

  uVar4 = pmaddwd(DAT_00833520,uVar5);

  uVar9 = pmaddwd(DAT_00833528,uVar6);

  uVar1 = pmaddwd(uVar5,_DAT_00833530);

  uVar2 = packssdw(CONCAT44((int)((ulonglong)uVar7 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar7 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar10 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar2 >> 0x20) >> 0x14,

                            (int)uVar10 + iVar11 + (int)uVar2 >> 0x14));

  uVar5 = pmaddwd(uVar6,_DAT_00833538);

  param_1[10] = uVar2;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar9 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar9 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[0xb] = uVar1;

  uVar1 = param_1[0xd];

  uVar5 = CONCAT44(CONCAT22((short)uVar1,(short)((ulonglong)uVar1 >> 0x10)),

                   CONCAT22((short)((ulonglong)uVar1 >> 0x20),(short)((ulonglong)uVar1 >> 0x30)));

  uVar1 = paddsw(param_1[0xc],uVar5);

  uVar2 = psubsw(param_1[0xc],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar7 = pmaddwd(DAT_008334c0,uVar5);

  uVar6 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar12 = pmaddwd(DAT_008334c8,uVar6);

  uVar10 = pmaddwd(DAT_008334d0,uVar5);

  uVar2 = pmaddwd(DAT_008334d8,uVar6);

  uVar4 = pmaddwd(DAT_008334e0,uVar5);

  uVar9 = pmaddwd(DAT_008334e8,uVar6);

  uVar1 = pmaddwd(uVar5,_DAT_008334f0);

  uVar2 = packssdw(CONCAT44((int)((ulonglong)uVar7 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar7 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar10 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar2 >> 0x20) >> 0x14,

                            (int)uVar10 + iVar11 + (int)uVar2 >> 0x14));

  uVar5 = pmaddwd(uVar6,_DAT_008334f8);

  param_1[0xc] = uVar2;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar9 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar9 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[0xd] = uVar1;

  uVar1 = param_1[0xf];

  uVar5 = CONCAT44(CONCAT22((short)uVar1,(short)((ulonglong)uVar1 >> 0x10)),

                   CONCAT22((short)((ulonglong)uVar1 >> 0x20),(short)((ulonglong)uVar1 >> 0x30)));

  uVar1 = paddsw(param_1[0xe],uVar5);

  uVar2 = psubsw(param_1[0xe],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar7 = pmaddwd(DAT_00833480,uVar5);

  uVar6 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar12 = pmaddwd(DAT_00833488,uVar6);

  uVar10 = pmaddwd(DAT_00833490,uVar5);

  uVar2 = pmaddwd(DAT_00833498,uVar6);

  uVar4 = pmaddwd(DAT_008334a0,uVar5);

  uVar9 = pmaddwd(DAT_008334a8,uVar6);

  uVar1 = pmaddwd(uVar5,_DAT_008334b0);

  uVar2 = packssdw(CONCAT44((int)((ulonglong)uVar7 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar7 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar10 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar2 >> 0x20) >> 0x14,

                            (int)uVar10 + iVar11 + (int)uVar2 >> 0x14));

  uVar5 = pmaddwd(uVar6,_DAT_008334b8);

  param_1[0xe] = uVar2;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar9 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar9 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[0xf] = uVar1;

  return;

}





// --- FUN_0064f910 at 0x0064F910 (size: 1879) ---


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



void FUN_0064f910(undefined8 *param_1)



{

  undefined8 uVar1;

  undefined8 uVar2;

  ulonglong uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  undefined8 uVar7;

  ulonglong uVar8;

  undefined8 uVar9;

  undefined8 uVar10;

  int iVar11;

  undefined8 uVar12;

  int iVar13;

  

  uVar1 = paddsw(param_1[2],param_1[0xc]);

  uVar1 = psllw(uVar1,3);

  uVar5 = paddsw(param_1[10],param_1[4]);

  uVar7 = paddsw(*param_1,param_1[0xe]);

  uVar6 = psllw(uVar5,3);

  uVar4 = psubsw(param_1[2],param_1[0xc]);

  uVar5 = psubsw(uVar1,uVar6);

  uVar2 = pmulhw(DAT_00833400,uVar5);

  uVar12 = paddsw(param_1[6],param_1[8]);

  uVar7 = psllw(uVar7,3);

  uVar9 = paddsw(uVar1,uVar6);

  uVar6 = psllw(uVar12,3);

  uVar1 = psubsw(uVar7,uVar6);

  uVar3 = paddsw(uVar2,uVar1);

  uVar2 = paddsw(uVar7,uVar6);

  uVar4 = psllw(uVar4,4);

  uVar12 = pmulhw(uVar1,DAT_00833400);

  uVar1 = psubsw(param_1[4],param_1[10]);

  uVar6 = psubsw(uVar2,uVar9);

  param_1[4] = uVar3 | _DAT_008333d0;

  uVar9 = paddsw(uVar2,uVar9);

  uVar7 = psllw(uVar1,4);

  uVar2 = psubsw(param_1[6],param_1[8]);

  param_1[8] = uVar6;

  uVar1 = DAT_00833410;

  uVar6 = paddsw(uVar4,uVar7);

  uVar3 = pmulhw(uVar6,_DAT_00833430);

  uVar4 = psubsw(uVar4,uVar7);

  uVar6 = pmulhw(uVar4,_DAT_00833430);

  uVar8 = psubsw(uVar12,uVar5);

  uVar8 = uVar8 | _DAT_008333d0;

  uVar5 = psllw(uVar2,3);

  uVar3 = uVar3 | _DAT_008333d0;

  uVar2 = paddsw(uVar5,uVar6);

  uVar4 = psubsw(*param_1,param_1[0xe]);

  uVar6 = psubsw(uVar5,uVar6);

  uVar4 = psllw(uVar4,3);

  uVar5 = pmulhw(DAT_008333f0,uVar2);

  *param_1 = uVar9;

  uVar7 = pmulhw(uVar1,uVar6);

  param_1[0xc] = uVar8;

  uVar12 = psubsw(uVar4,uVar3);

  uVar1 = paddsw(uVar4,uVar3);

  uVar4 = pmulhw(DAT_00833410,uVar12);

  uVar3 = paddsw(uVar5,uVar1);

  uVar7 = paddsw(uVar7,uVar6);

  uVar1 = pmulhw(uVar1,DAT_008333f0);

  uVar5 = paddsw(uVar4,uVar12);

  uVar4 = psubsw(uVar12,uVar7);

  param_1[2] = uVar3 | _DAT_008333d0;

  uVar5 = paddsw(uVar5,uVar6);

  param_1[6] = uVar4;

  uVar1 = psubsw(uVar1,uVar2);

  param_1[10] = uVar5;

  param_1[0xe] = uVar1;

  uVar1 = paddsw(param_1[3],param_1[0xd]);

  uVar1 = psllw(uVar1,3);

  uVar5 = paddsw(param_1[0xb],param_1[5]);

  uVar7 = paddsw(param_1[1],param_1[0xf]);

  uVar6 = psllw(uVar5,3);

  uVar4 = psubsw(param_1[3],param_1[0xd]);

  uVar5 = psubsw(uVar1,uVar6);

  uVar2 = pmulhw(DAT_00833400,uVar5);

  uVar12 = paddsw(param_1[7],param_1[9]);

  uVar7 = psllw(uVar7,3);

  uVar9 = paddsw(uVar1,uVar6);

  uVar6 = psllw(uVar12,3);

  uVar1 = psubsw(uVar7,uVar6);

  uVar3 = paddsw(uVar2,uVar1);

  uVar2 = paddsw(uVar7,uVar6);

  uVar4 = psllw(uVar4,4);

  uVar12 = pmulhw(uVar1,DAT_00833400);

  uVar1 = psubsw(param_1[5],param_1[0xb]);

  uVar6 = psubsw(uVar2,uVar9);

  param_1[5] = uVar3 | _DAT_008333d0;

  uVar9 = paddsw(uVar2,uVar9);

  uVar7 = psllw(uVar1,4);

  uVar2 = psubsw(param_1[7],param_1[9]);

  param_1[9] = uVar6;

  uVar1 = DAT_00833410;

  uVar6 = paddsw(uVar4,uVar7);

  uVar3 = pmulhw(uVar6,_DAT_00833430);

  uVar4 = psubsw(uVar4,uVar7);

  uVar6 = pmulhw(uVar4,_DAT_00833430);

  uVar8 = psubsw(uVar12,uVar5);

  uVar8 = uVar8 | _DAT_008333d0;

  uVar5 = psllw(uVar2,3);

  uVar3 = uVar3 | _DAT_008333d0;

  uVar2 = paddsw(uVar5,uVar6);

  uVar4 = psubsw(param_1[1],param_1[0xf]);

  uVar6 = psubsw(uVar5,uVar6);

  uVar4 = psllw(uVar4,3);

  uVar5 = pmulhw(DAT_008333f0,uVar2);

  param_1[1] = uVar9;

  uVar7 = pmulhw(uVar1,uVar6);

  param_1[0xd] = uVar8;

  uVar12 = psubsw(uVar4,uVar3);

  uVar1 = paddsw(uVar4,uVar3);

  uVar4 = pmulhw(DAT_00833410,uVar12);

  uVar3 = paddsw(uVar5,uVar1);

  uVar7 = paddsw(uVar7,uVar6);

  uVar1 = pmulhw(uVar1,DAT_008333f0);

  uVar5 = paddsw(uVar4,uVar12);

  uVar4 = psubsw(uVar12,uVar7);

  param_1[3] = uVar3 | _DAT_008333d0;

  uVar5 = paddsw(uVar5,uVar6);

  param_1[7] = uVar4;

  uVar1 = psubsw(uVar1,uVar2);

  param_1[0xb] = uVar5;

  param_1[0xf] = uVar1;

  uVar5 = pshufw(param_1[1],param_1[1],0x1b);

  uVar1 = paddsw(*param_1,uVar5);

  uVar2 = psubsw(*param_1,uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar6 = pmaddwd(DAT_00833440,uVar5);

  uVar2 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar7 = pmaddwd(DAT_00833448,uVar2);

  uVar9 = pmaddwd(DAT_00833450,uVar5);

  uVar10 = pmaddwd(DAT_00833458,uVar2);

  iVar11 = (int)DAT_008333e0;

  iVar13 = (int)((ulonglong)DAT_008333e0 >> 0x20);

  uVar4 = pmaddwd(DAT_00833460,uVar5);

  uVar12 = pmaddwd(DAT_00833468,uVar2);

  uVar1 = pmaddwd(uVar5,_DAT_00833470);

  uVar6 = packssdw(CONCAT44((int)((ulonglong)uVar6 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar7 >> 0x20) >> 0x14,

                            (int)uVar6 + iVar11 + (int)uVar7 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar9 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar10 >> 0x20) >> 0x14,

                            (int)uVar9 + iVar11 + (int)uVar10 >> 0x14));

  uVar5 = pmaddwd(uVar2,_DAT_00833478);

  *param_1 = uVar6;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[1] = uVar1;

  uVar5 = pshufw(param_1[3],param_1[3],0x1b);

  uVar1 = paddsw(param_1[2],uVar5);

  uVar2 = psubsw(param_1[2],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar6 = pmaddwd(DAT_00833480,uVar5);

  uVar2 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar7 = pmaddwd(DAT_00833488,uVar2);

  uVar9 = pmaddwd(DAT_00833490,uVar5);

  uVar10 = pmaddwd(DAT_00833498,uVar2);

  uVar4 = pmaddwd(DAT_008334a0,uVar5);

  uVar12 = pmaddwd(DAT_008334a8,uVar2);

  uVar1 = pmaddwd(uVar5,_DAT_008334b0);

  uVar6 = packssdw(CONCAT44((int)((ulonglong)uVar6 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar7 >> 0x20) >> 0x14,

                            (int)uVar6 + iVar11 + (int)uVar7 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar9 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar10 >> 0x20) >> 0x14,

                            (int)uVar9 + iVar11 + (int)uVar10 >> 0x14));

  uVar5 = pmaddwd(uVar2,_DAT_008334b8);

  param_1[2] = uVar6;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[3] = uVar1;

  uVar5 = pshufw(param_1[5],param_1[5],0x1b);

  uVar1 = paddsw(param_1[4],uVar5);

  uVar2 = psubsw(param_1[4],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar6 = pmaddwd(DAT_008334c0,uVar5);

  uVar2 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar7 = pmaddwd(DAT_008334c8,uVar2);

  uVar9 = pmaddwd(DAT_008334d0,uVar5);

  uVar10 = pmaddwd(DAT_008334d8,uVar2);

  uVar4 = pmaddwd(DAT_008334e0,uVar5);

  uVar12 = pmaddwd(DAT_008334e8,uVar2);

  uVar1 = pmaddwd(uVar5,_DAT_008334f0);

  uVar6 = packssdw(CONCAT44((int)((ulonglong)uVar6 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar7 >> 0x20) >> 0x14,

                            (int)uVar6 + iVar11 + (int)uVar7 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar9 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar10 >> 0x20) >> 0x14,

                            (int)uVar9 + iVar11 + (int)uVar10 >> 0x14));

  uVar5 = pmaddwd(uVar2,_DAT_008334f8);

  param_1[4] = uVar6;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[5] = uVar1;

  uVar5 = pshufw(param_1[7],param_1[7],0x1b);

  uVar1 = paddsw(param_1[6],uVar5);

  uVar2 = psubsw(param_1[6],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar6 = pmaddwd(DAT_00833500,uVar5);

  uVar2 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar7 = pmaddwd(DAT_00833508,uVar2);

  uVar9 = pmaddwd(DAT_00833510,uVar5);

  uVar10 = pmaddwd(DAT_00833518,uVar2);

  uVar4 = pmaddwd(DAT_00833520,uVar5);

  uVar12 = pmaddwd(DAT_00833528,uVar2);

  uVar1 = pmaddwd(uVar5,_DAT_00833530);

  uVar6 = packssdw(CONCAT44((int)((ulonglong)uVar6 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar7 >> 0x20) >> 0x14,

                            (int)uVar6 + iVar11 + (int)uVar7 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar9 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar10 >> 0x20) >> 0x14,

                            (int)uVar9 + iVar11 + (int)uVar10 >> 0x14));

  uVar5 = pmaddwd(uVar2,_DAT_00833538);

  param_1[6] = uVar6;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[7] = uVar1;

  uVar5 = pshufw(param_1[9],param_1[9],0x1b);

  uVar1 = paddsw(param_1[8],uVar5);

  uVar2 = psubsw(param_1[8],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar6 = pmaddwd(DAT_00833440,uVar5);

  uVar2 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar7 = pmaddwd(DAT_00833448,uVar2);

  uVar9 = pmaddwd(DAT_00833450,uVar5);

  uVar10 = pmaddwd(DAT_00833458,uVar2);

  uVar4 = pmaddwd(DAT_00833460,uVar5);

  uVar12 = pmaddwd(DAT_00833468,uVar2);

  uVar1 = pmaddwd(uVar5,_DAT_00833470);

  uVar6 = packssdw(CONCAT44((int)((ulonglong)uVar6 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar7 >> 0x20) >> 0x14,

                            (int)uVar6 + iVar11 + (int)uVar7 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar9 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar10 >> 0x20) >> 0x14,

                            (int)uVar9 + iVar11 + (int)uVar10 >> 0x14));

  uVar5 = pmaddwd(uVar2,_DAT_00833478);

  param_1[8] = uVar6;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[9] = uVar1;

  uVar5 = pshufw(param_1[0xb],param_1[0xb],0x1b);

  uVar1 = paddsw(param_1[10],uVar5);

  uVar2 = psubsw(param_1[10],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar6 = pmaddwd(DAT_00833500,uVar5);

  uVar2 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar7 = pmaddwd(DAT_00833508,uVar2);

  uVar9 = pmaddwd(DAT_00833510,uVar5);

  uVar10 = pmaddwd(DAT_00833518,uVar2);

  uVar4 = pmaddwd(DAT_00833520,uVar5);

  uVar12 = pmaddwd(DAT_00833528,uVar2);

  uVar1 = pmaddwd(uVar5,_DAT_00833530);

  uVar6 = packssdw(CONCAT44((int)((ulonglong)uVar6 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar7 >> 0x20) >> 0x14,

                            (int)uVar6 + iVar11 + (int)uVar7 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar9 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar10 >> 0x20) >> 0x14,

                            (int)uVar9 + iVar11 + (int)uVar10 >> 0x14));

  uVar5 = pmaddwd(uVar2,_DAT_00833538);

  param_1[10] = uVar6;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[0xb] = uVar1;

  uVar5 = pshufw(param_1[0xd],param_1[0xd],0x1b);

  uVar1 = paddsw(param_1[0xc],uVar5);

  uVar2 = psubsw(param_1[0xc],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar6 = pmaddwd(DAT_008334c0,uVar5);

  uVar2 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar7 = pmaddwd(DAT_008334c8,uVar2);

  uVar9 = pmaddwd(DAT_008334d0,uVar5);

  uVar10 = pmaddwd(DAT_008334d8,uVar2);

  uVar4 = pmaddwd(DAT_008334e0,uVar5);

  uVar12 = pmaddwd(DAT_008334e8,uVar2);

  uVar1 = pmaddwd(uVar5,_DAT_008334f0);

  uVar6 = packssdw(CONCAT44((int)((ulonglong)uVar6 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar7 >> 0x20) >> 0x14,

                            (int)uVar6 + iVar11 + (int)uVar7 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar9 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar10 >> 0x20) >> 0x14,

                            (int)uVar9 + iVar11 + (int)uVar10 >> 0x14));

  uVar5 = pmaddwd(uVar2,_DAT_008334f8);

  param_1[0xc] = uVar6;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[0xd] = uVar1;

  uVar5 = pshufw(param_1[0xf],param_1[0xf],0x1b);

  uVar1 = paddsw(param_1[0xe],uVar5);

  uVar2 = psubsw(param_1[0xe],uVar5);

  uVar5 = CONCAT44((int)uVar2,(int)uVar1);

  uVar6 = pmaddwd(DAT_00833480,uVar5);

  uVar2 = CONCAT44((int)((ulonglong)uVar2 >> 0x20),(int)((ulonglong)uVar1 >> 0x20));

  uVar7 = pmaddwd(DAT_00833488,uVar2);

  uVar9 = pmaddwd(DAT_00833490,uVar5);

  uVar10 = pmaddwd(DAT_00833498,uVar2);

  uVar4 = pmaddwd(DAT_008334a0,uVar5);

  uVar12 = pmaddwd(DAT_008334a8,uVar2);

  uVar1 = pmaddwd(uVar5,_DAT_008334b0);

  uVar6 = packssdw(CONCAT44((int)((ulonglong)uVar6 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar7 >> 0x20) >> 0x14,

                            (int)uVar6 + iVar11 + (int)uVar7 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar9 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar10 >> 0x20) >> 0x14,

                            (int)uVar9 + iVar11 + (int)uVar10 >> 0x14));

  uVar5 = pmaddwd(uVar2,_DAT_008334b8);

  param_1[0xe] = uVar6;

  uVar1 = packssdw(CONCAT44((int)((ulonglong)uVar4 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar12 >> 0x20) >> 0x14,

                            (int)uVar4 + iVar11 + (int)uVar12 >> 0x14),

                   CONCAT44((int)((ulonglong)uVar1 >> 0x20) + iVar13 +

                            (int)((ulonglong)uVar5 >> 0x20) >> 0x14,

                            (int)uVar1 + iVar11 + (int)uVar5 >> 0x14));

  param_1[0xf] = uVar1;

  return;

}





