original_code:
static void gi_Player_ComputeQSTs(gi_Player* const pThis)
{
 float level = (float)pThis->m_rawLevel;
 const float experience = pThis->m_experience;
 const float injuryFraction = ConvertInjuryToFraction(pThis->m_injury);
 float Q = (float)(pThis->m_rawQST[GI_QST_Q])/100.0f;
 float S = (float)(pThis->m_rawQST[GI_QST_S])/100.0f;
 float T = (float)(pThis->m_rawQST[GI_QST_T])/100.0f;
 level += experience;
 level *= injuryFraction;
 if (level < 1.0f)
 {
  level = 1;
 }
 Q *= level;
 S *= level;
 T *= level;
 pThis->m_level = level;
 pThis->m_QST[GI_QST_Q] = Q;
 pThis->m_QST[GI_QST_S] = S;
 pThis->m_QST[GI_QST_T] = T;
}

canonical_original_code:
static void gi_Player_ComputeQSTs(struct gi_Player *pThis)
{
 float level = (float)pThis->m_rawLevel;
 float experience = pThis->m_experience;
 float injuryFraction = ConvertInjuryToFraction(pThis->m_injury);
 float Q = (float)(pThis->m_rawQST[GI_QST_Q])/100.0f;
 float S = (float)(pThis->m_rawQST[GI_QST_S])/100.0f;
 float T = (float)(pThis->m_rawQST[GI_QST_T])/100.0f;
 level += experience;
 level *= injuryFraction;
 if (level < 1.0f)
 {
  level = 1;
 }
 Q *= level;
 S *= level;
 T *= level;
 pThis->m_level = level;
 pThis->m_QST[GI_QST_Q] = Q;
 pThis->m_QST[GI_QST_S] = S;
 pThis->m_QST[GI_QST_T] = T;
}

variable_types: struct gi_Player { char m_name[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; unsigned long m_rawLevel; unsigned long m_rawQST[-1]; float m_experience; enum GI_UNIT { GI_UNIT_OFFENCE=0, GI_UNIT_DEFENCE=1, GI_UNIT_SPECIALTEAMS=2, GI_UNIT_UNKNOWN=3, GI_UNIT_NUM=expr } m_unit; unsigned long m_age; float m_level; float m_QST[-1]; enum GI_INJURY { GI_INJURY_A=0, GI_INJURY_B=1, GI_INJURY_C=2, GI_INJURY_D=3, GI_INJURY_E=4, GI_INJURY_F=5, GI_INJURY_G=6, GI_INJURY_H=7, GI_INJURY_UNKNOWN=8, GI_INJURY_NUM=expr } m_injury; } *

variable_types: level float

variable_types: experience float

variable_types: injuryFraction float

variable_types: Q float

variable_types: S float

variable_types: T float

user_defined_types: struct gi_Player { char m_name[-1]; enum GI_POSITION m_position; unsigned long m_rawLevel; unsigned long m_rawQST[-1]; float m_experience; enum GI_UNIT m_unit; unsigned long m_age; float m_level; float m_QST[-1]; enum GI_INJURY m_injury; }


original_code:
void gi_Player_Init(gi_Player* const pThis)
{
 pThis->m_name[0] = '\0';
 pThis->m_position = GI_POSITION_UNKNOWN;
 pThis->m_rawLevel = 0;
 pThis->m_rawQST[0] = 0;
 pThis->m_rawQST[1] = 0;
 pThis->m_rawQST[2] = 0;
 pThis->m_experience = 0.0f;
 pThis->m_unit = GI_UNIT_UNKNOWN;
 pThis->m_age = 0;
 pThis->m_level = 0.0f;
 pThis->m_QST[0] = 0.0f;
 pThis->m_QST[1] = 0.0f;
 pThis->m_QST[2] = 0.0f;
 pThis->m_injury = GI_INJURY_UNKNOWN;
}

canonical_original_code:
void gi_Player_Init(struct gi_Player *pThis)
{
 pThis->m_name[0] = '\0';
 pThis->m_position = GI_POSITION_UNKNOWN;
 pThis->m_rawLevel = 0;
 pThis->m_rawQST[0] = 0;
 pThis->m_rawQST[1] = 0;
 pThis->m_rawQST[2] = 0;
 pThis->m_experience = 0.0f;
 pThis->m_unit = GI_UNIT_UNKNOWN;
 pThis->m_age = 0;
 pThis->m_level = 0.0f;
 pThis->m_QST[0] = 0.0f;
 pThis->m_QST[1] = 0.0f;
 pThis->m_QST[2] = 0.0f;
 pThis->m_injury = GI_INJURY_UNKNOWN;
}

return_type: void

user_defined_types: enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr }

user_defined_types: enum GI_UNIT { GI_UNIT_OFFENCE=0, GI_UNIT_DEFENCE=1, GI_UNIT_SPECIALTEAMS=2, GI_UNIT_UNKNOWN=3, GI_UNIT_NUM=expr }

user_defined_types: enum GI_INJURY { GI_INJURY_A=0, GI_INJURY_B=1, GI_INJURY_C=2, GI_INJURY_D=3, GI_INJURY_E=4, GI_INJURY_F=5, GI_INJURY_G=6, GI_INJURY_H=7, GI_INJURY_UNKNOWN=8, GI_INJURY_NUM=expr }


decompiled_code:
__int64 __fastcall gi_Player_GetName(__int64 a1)
{
return a1;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1)
{
return a1;
}

original_code:
const char* gi_Player_GetName(const gi_Player* const pThis)
{
 return pThis->m_name;
}

canonical_original_code:
char *gi_Player_GetName(struct gi_Player *pThis)
{
 return pThis->m_name;
}

return_type: char *


decompiled_code:
__int64 __fastcall gi_Player_GetPosition(__int64 a1)
{
return *(unsigned int *)(a1 + 128);
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1)
{
return *(unsigned int *)(a1 + 128);
}

original_code:
GI_POSITION gi_Player_GetPosition(const gi_Player* const pThis)
{
 return pThis->m_position;
}

canonical_original_code:
enum GI_POSITION gi_Player_GetPosition(struct gi_Player *pThis)
{
 return pThis->m_position;
}

return_type: enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr }


decompiled_code:
__int64 __fastcall gi_Player_GetRawLevel(__int64 a1)
{
return *(_QWORD *)(a1 + 132);
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1)
{
return *(_QWORD *)(a1 + 132);
}

original_code:
size_t gi_Player_GetRawLevel(const gi_Player* const pThis)
{
 return pThis->m_rawLevel;
}

canonical_original_code:
unsigned long gi_Player_GetRawLevel(struct gi_Player *pThis)
{
 return pThis->m_rawLevel;
}

return_type: unsigned long


decompiled_code:
__int64 __fastcall gi_Player_GetRawQST(__int64 a1)
{
return a1 + 140;
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1)
{
return a1 + 140;
}

original_code:
const size_t* gi_Player_GetRawQST(const gi_Player* const pThis)
{
 return pThis->m_rawQST;
}

canonical_original_code:
unsigned long *gi_Player_GetRawQST(struct gi_Player *pThis)
{
 return pThis->m_rawQST;
}

return_type: unsigned long *


decompiled_code:
float __fastcall gi_Player_GetExperience(__int64 a1)
{
return *(float *)(a1 + 180);
}

canonical_decompiled_code:
float __fastcall func10(__int64 a1)
{
return *(float *)(a1 + 180);
}

original_code:
float gi_Player_GetExperience(const gi_Player* const pThis)
{
 return pThis->m_experience;
}

canonical_original_code:
float gi_Player_GetExperience(struct gi_Player *pThis)
{
 return pThis->m_experience;
}

return_type: float


decompiled_code:
__int64 __fastcall gi_Player_GetUnit(__int64 a1)
{
return *(unsigned int *)(a1 + 184);
}

canonical_decompiled_code:
__int64 __fastcall func11(__int64 a1)
{
return *(unsigned int *)(a1 + 184);
}

original_code:
GI_UNIT gi_Player_GetUnit(const gi_Player* const pThis)
{
 return pThis->m_unit;
}

canonical_original_code:
enum GI_UNIT gi_Player_GetUnit(struct gi_Player *pThis)
{
 return pThis->m_unit;
}

return_type: enum GI_UNIT { GI_UNIT_OFFENCE=0, GI_UNIT_DEFENCE=1, GI_UNIT_SPECIALTEAMS=2, GI_UNIT_UNKNOWN=3, GI_UNIT_NUM=expr }


decompiled_code:
__int64 __fastcall gi_Player_GetAge(__int64 a1)
{
return *(_QWORD *)(a1 + 188);
}

canonical_decompiled_code:
__int64 __fastcall func12(__int64 a1)
{
return *(_QWORD *)(a1 + 188);
}

original_code:
size_t gi_Player_GetAge(const gi_Player* const pThis)
{
 return pThis->m_age;
}

canonical_original_code:
unsigned long gi_Player_GetAge(struct gi_Player *pThis)
{
 return pThis->m_age;
}


decompiled_code:
float __fastcall gi_Player_GetLevel(__int64 a1)
{
return *(float *)(a1 + 196);
}

canonical_decompiled_code:
float __fastcall func13(__int64 a1)
{
return *(float *)(a1 + 196);
}

original_code:
float gi_Player_GetLevel(const gi_Player* const pThis)
{
 return pThis->m_level;
}

canonical_original_code:
float gi_Player_GetLevel(struct gi_Player *pThis)
{
 return pThis->m_level;
}


decompiled_code:
__int64 __fastcall gi_Player_GetQST(__int64 a1)
{
return a1 + 200;
}

canonical_decompiled_code:
__int64 __fastcall func14(__int64 a1)
{
return a1 + 200;
}

original_code:
const float* gi_Player_GetQST(const gi_Player* const pThis)
{
 return pThis->m_QST;
}

canonical_original_code:
float *gi_Player_GetQST(struct gi_Player *pThis)
{
 return pThis->m_QST;
}

return_type: float *


decompiled_code:
__int64 __fastcall gi_Player_GetInjury(__int64 a1)
{
return *(unsigned int *)(a1 + 220);
}

canonical_decompiled_code:
__int64 __fastcall func15(__int64 a1)
{
return *(unsigned int *)(a1 + 220);
}

original_code:
GI_INJURY gi_Player_GetInjury(const gi_Player* const pThis)
{
 return pThis->m_injury;
}

canonical_original_code:
enum GI_INJURY gi_Player_GetInjury(struct gi_Player *pThis)
{
 return pThis->m_injury;
}

return_type: enum GI_INJURY { GI_INJURY_A=0, GI_INJURY_B=1, GI_INJURY_C=2, GI_INJURY_D=3, GI_INJURY_E=4, GI_INJURY_F=5, GI_INJURY_G=6, GI_INJURY_H=7, GI_INJURY_UNKNOWN=8, GI_INJURY_NUM=expr }


decompiled_code:
__int64 __fastcall gi_Player_GetPositionName(__int64 a1)
{
return gi_GetPositionName(*(unsigned int *)(a1 + 128));
}

canonical_decompiled_code:
__int64 __fastcall func16(__int64 a1)
{
return gi_GetPositionName(*(unsigned int *)(a1 + 128));
}

original_code:
const char* gi_Player_GetPositionName(const gi_Player* const pThis)
{
 return gi_GetPositionName(pThis->m_position);
}

canonical_original_code:
char *gi_Player_GetPositionName(struct gi_Player *pThis)
{
 return gi_GetPositionName(pThis->m_position);
}


decompiled_code:
void __fastcall gi_Player_SetInjury(__int64 a1, int a2)
{
*(_DWORD *)(a1 + 220) = a2;
}

canonical_decompiled_code:
void __fastcall func17(__int64 a1, int a2)
{
*(_DWORD *)(a1 + 220) = a2;
}

original_code:
void gi_Player_SetInjury(gi_Player* const pThis, const GI_INJURY injury)
{
 pThis->m_injury = injury;
}

canonical_original_code:
void gi_Player_SetInjury(struct gi_Player *pThis, enum GI_INJURY injury)
{
 pThis->m_injury = injury;
}

variable_types: enum GI_INJURY { GI_INJURY_A=0, GI_INJURY_B=1, GI_INJURY_C=2, GI_INJURY_D=3, GI_INJURY_E=4, GI_INJURY_F=5, GI_INJURY_G=6, GI_INJURY_H=7, GI_INJURY_UNKNOWN=8, GI_INJURY_NUM=expr }


original_code:
float gi_Player_GetSpecialTeamsLevelQST(const gi_Player* const pThis, float* const pQ, float* const pS, float* const pT)
{
 const GI_POSITION position = pThis->m_position;
 const float injuryFraction = ConvertInjuryToFraction(pThis->m_injury);
 float level = (float)(pThis->m_rawLevel);
 float experience = pThis->m_experience;
 float Q = (float)(pThis->m_rawQST[GI_QST_Q])/100.0f;
 float S = (float)(pThis->m_rawQST[GI_QST_S])/100.0f;
 float T = (float)(pThis->m_rawQST[GI_QST_T])/100.0f;
 switch (position)
 {
  case GI_POSITION_R:
  case GI_POSITION_K:
  case GI_POSITION_P:
   experience = 0.0f;
   break;
  default:
   break;
 };
 level += experience;
 level *= injuryFraction;
 if (level > 10.0f)
 {
  level = 10.0f+((level-10.0f)*0.2f);
 }
 if (level < 1.0f)
 {
  level = 1;
 }
 Q *= level;
 S *= level;
 T *= level;
 *pQ = Q;
 *pS = S;
 *pT = T;
 return level;
}

canonical_original_code:
float gi_Player_GetSpecialTeamsLevelQST(struct gi_Player *pThis, float *pQ, float *pS, float *pT)
{
 enum GI_POSITION position = pThis->m_position;
 float injuryFraction = ConvertInjuryToFraction(pThis->m_injury);
 float level = (float)(pThis->m_rawLevel);
 float experience = pThis->m_experience;
 float Q = (float)(pThis->m_rawQST[GI_QST_Q])/100.0f;
 float S = (float)(pThis->m_rawQST[GI_QST_S])/100.0f;
 float T = (float)(pThis->m_rawQST[GI_QST_T])/100.0f;
 switch (position)
 {
  case GI_POSITION_R:
  case GI_POSITION_K:
  case GI_POSITION_P:
   experience = 0.0f;
   break;
  default:
   break;
 };
 level += experience;
 level *= injuryFraction;
 if (level > 10.0f)
 {
  level = 10.0f+((level-10.0f)*0.2f);
 }
 if (level < 1.0f)
 {
  level = 1;
 }
 Q *= level;
 S *= level;
 T *= level;
 *pQ = Q;
 *pS = S;
 *pT = T;
 return level;
}

variable_types:
pQ
float *

variable_types:
pS
float *

variable_types:
pT
float *

variable_types: enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr }


main

canonical_name: main

decompiled_code:
// local variable allocation has failed, the output may be wrong!
int __cdecl main(int argc, const char **argv, const char **envp)
{
const char **v3; // r14
__int64 v4; // rbp
__int64 v5; // rbx
__int64 v6; // r15
bool v7; // cf
bool v8; // zf
__int64 v9; // rcx

if ( argc <= 0 )
{
v6 = 0LL;
}
else
{
v3 = argv;
v4 = argc;
v5 = 0LL;
v6 = 0LL;
do
{
printf("argv[%d] '%s'\n", (unsigned int)v5, v3[v5]);
argv = (const char **)v3[v5];
v9 = 7LL;
*(_QWORD *)&argc = "-debug";
do
{
if ( !v9 )
break;
v7 = *(_BYTE *)argv < **(_BYTE **)&argc;
v8 = *(_BYTE *)argv == **(_BYTE **)&argc;
argv = (const char **)((char *)argv + 1);
++*(_QWORD *)&argc;
--v9;
}
while ( v8 );
if ( (!v7 && !v8) == v7 )
v6 = 1LL;
++v5;
}
while ( v5 != v4 );
}
gi_Init(*(_QWORD *)&argc, argv);
gi_LoadFile("data/london_monarchs.json", v6);
gi_LoadFile("data/offence/proset.json", v6);
gi_LoadFile("data/defence/3-4.json", 1LL);
gi_LoadFile("data/defence/3-5.json", 1LL);
gi_Compute();
gi_Output();
return -1;
}

original_code:
int main(int argc, char* argv[])
{
 size_t debug = 0;
 int i;
 for (i = 0; i < argc; i++)
 {
  printf("argv[%d] '%s'\n", i, argv[i]);
  if (strcmp(argv[i], "-debug") == 0)
  {
   debug = 1;
  }
 }
 gi_Init();
 gi_LoadFile("data/london_monarchs.json", debug);
 gi_LoadFile("data/offence/proset.json", debug);
 gi_LoadFile("data/defence/3-4.json", 1);
 gi_LoadFile("data/defence/3-5.json", 1);
 gi_Compute();
 gi_Output();
 return -1;
}

canonical_original_code:
int main(int argc, char *argv[])
{
 unsigned long debug = 0;
 int i;
 for (i = 0; i < argc; i++)
 {
  printf("argv[%d] '%s'\n", i, argv[i]);
  if (strcmp(argv[i], "-debug") == 0)
  {
   debug = 1;
  }
 }
 gi_Init();
 gi_LoadFile("data/london_monarchs.json", debug);
 gi_LoadFile("data/offence/proset.json", debug);
 gi_LoadFile("data/defence/3-4.json", 1);
 gi_LoadFile("data/defence/3-5.json", 1);
 gi_Compute();
 gi_Output();
 return -1;
}

variable_types: argc int

variable_types:
argv
char *[]

variable_types:
debug
unsigned long

variable_types: i int

return_type: int


decompiled_code:
void gi_Logger_Shutdown()
{
;
}

canonical_decompiled_code:
void func0()
{
;
}

original_code:
void gi_Logger_Shutdown(void)
{
}

canonical_original_code:
void gi_Logger_Shutdown()
{
}


decompiled_code:
__int64 gi_Logger_GetErrorStatus()
{
return (unsigned int)s_errorFlag;
}

canonical_decompiled_code:
__int64 func1()
{
return (unsigned int)s_errorFlag;
}

original_code:
GI_BOOL gi_Logger_GetErrorStatus(void)
{
 return s_errorFlag;
}

canonical_original_code:
enum GI_BOOL gi_Logger_GetErrorStatus()
{
 return s_errorFlag;
}

return_type: enum GI_BOOL { GI_TRUE=0, GI_FALSE=1 }


decompiled_code:
void gi_Logger_ClearErrorStatus()
{
s_errorFlag = 1;
}

canonical_decompiled_code:
void func2()
{
s_errorFlag = 1;
}

original_code:
void gi_Logger_ClearErrorStatus(void)
{
 s_errorFlag = GI_FALSE;
}

canonical_original_code:
void gi_Logger_ClearErrorStatus()
{
 s_errorFlag = GI_FALSE;
}


decompiled_code:
void gi_Logger_SetErrorStatus()
{
s_errorFlag = 0;
}

canonical_decompiled_code:
void func3()
{
s_errorFlag = 0;
}

original_code:
void gi_Logger_SetErrorStatus(void)
{
 s_errorFlag = GI_TRUE;
}

canonical_original_code:
void gi_Logger_SetErrorStatus()
{
 s_errorFlag = GI_TRUE;
}


decompiled_code:
__int64 __fastcall gi_Logger_GetDefaultChannel(unsigned int a1)
{
__int64 result; // rax

if ( a1 > 3 )
result = 0LL;
else
result = *((_QWORD *)&s_defaultChannels + (int)a1);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(unsigned int a1)
{
__int64 result; // rax

if ( a1 > 3 )
result = 0LL;
else
result = *((_QWORD *)&s_defaultChannels + (int)a1);
return result;
}

original_code:
gi_LoggerChannel* gi_Logger_GetDefaultChannel(const int channel)
{
 if ((channel < 0) || (channel >= GI_CHANNEL_NUM_DEFAULT_CHANNELS))
 {
  return ((void *)0);
 }
 return s_defaultChannels[channel];
}

canonical_original_code:
struct gi_LoggerChannel *gi_Logger_GetDefaultChannel(int channel)
{
 if ((channel < 0) || (channel >= GI_CHANNEL_NUM_DEFAULT_CHANNELS))
 {
  return ((void *)0);
 }
 return s_defaultChannels[channel];
}

variable_types: channel int

return_type: struct gi_LoggerChannel { char *m_nickName; char *m_prefixStr; char *m_outputFileName; unsigned int m_flags; } *


decompiled_code:
__int64 __fastcall gi_Logger_GetChannelFlags(unsigned int a1)
{
__int64 v1; // rdi
__int64 result; // rax

v1 = gi_Logger_GetDefaultChannel(a1);
result = 0LL;
if ( v1 )
result = gi_LoggerChannel_GetFlags();
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(unsigned int a1)
{
__int64 v1; // rdi
__int64 result; // rax

v1 = func4(a1);
result = 0LL;
if ( v1 )
result = gi_LoggerChannel_GetFlags();
return result;
}

original_code:
unsigned int gi_Logger_GetChannelFlags(const int channel)
{
 gi_LoggerChannel* const channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  return gi_LoggerChannel_GetFlags(channelPtr);
 }
 return 0;
}

canonical_original_code:
unsigned int gi_Logger_GetChannelFlags(int channel)
{
 struct gi_LoggerChannel *channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  return gi_LoggerChannel_GetFlags(channelPtr);
 }
 return 0;
}

variable_types: struct gi_LoggerChannel { char *m_nickName; char *m_prefixStr; char *m_outputFileName; unsigned int m_flags; } *

return_type: unsigned int


decompiled_code:
__int64 __fastcall gi_Logger_SetChannelFlags(unsigned int a1)
{
__int64 result; // rax

result = gi_Logger_GetDefaultChannel(a1);
if ( result )
result = gi_LoggerChannel_SetFlags(result);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func6(unsigned int a1)
{
__int64 result; // rax

result = func4(a1);
if ( result )
result = gi_LoggerChannel_SetFlags(result);
return result;
}

original_code:
void gi_Logger_SetChannelFlags(const int channel, const size_t flags)
{
 gi_LoggerChannel* const channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  gi_LoggerChannel_SetFlags(channelPtr, flags);
 }
}

canonical_original_code:
void gi_Logger_SetChannelFlags(int channel, unsigned long flags)
{
 struct gi_LoggerChannel *channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  gi_LoggerChannel_SetFlags(channelPtr, flags);
 }
}

variable_types:
flags
unsigned long

user_defined_types: struct gi_LoggerChannel { char *m_nickName; char *m_prefixStr; char *m_outputFileName; unsigned int m_flags; }


decompiled_code:
__int64 __fastcall gi_Logger_SetFatal(unsigned int a1, unsigned int a2)
{
__int64 result; // rax

result = gi_Logger_GetDefaultChannel(a1);
if ( result )
result = gi_LoggerChannel_ChangeFlags(result, 1LL, a2);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func7(unsigned int a1, unsigned int a2)
{
__int64 result; // rax

result = func4(a1);
if ( result )
result = gi_LoggerChannel_ChangeFlags(result, 1LL, a2);
return result;
}

original_code:
void gi_Logger_SetFatal(const int channel, const GI_BOOL fatal)
{
 gi_LoggerChannel* const channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  gi_LoggerChannel_ChangeFlags(channelPtr, GI_LOGGERCHANNEL_FLAGS_FATAL, fatal);
 }
}

canonical_original_code:
void gi_Logger_SetFatal(int channel, enum GI_BOOL fatal)
{
 struct gi_LoggerChannel *channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  gi_LoggerChannel_ChangeFlags(channelPtr, GI_LOGGERCHANNEL_FLAGS_FATAL, fatal);
 }
}

variable_types:
fatal
enum GI_BOOL { GI_TRUE=0, GI_FALSE=1 }


decompiled_code:
__int64 __fastcall gi_Logger_SetConsoleOutput(unsigned int a1, unsigned int a2)
{
__int64 result; // rax

result = gi_Logger_GetDefaultChannel(a1);
if ( result )
result = gi_LoggerChannel_ChangeFlags(result, 2LL, a2);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func8(unsigned int a1, unsigned int a2)
{
__int64 result; // rax

result = func4(a1);
if ( result )
result = gi_LoggerChannel_ChangeFlags(result, 2LL, a2);
return result;
}

original_code:
void gi_Logger_SetConsoleOutput(const int channel, const GI_BOOL consoleOutput)
{
 gi_LoggerChannel* const channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  gi_LoggerChannel_ChangeFlags(channelPtr, GI_LOGGERCHANNEL_FLAGS_CONSOLE_OUTPUT, consoleOutput);
 }
}

canonical_original_code:
void gi_Logger_SetConsoleOutput(int channel, enum GI_BOOL consoleOutput)
{
 struct gi_LoggerChannel *channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  gi_LoggerChannel_ChangeFlags(channelPtr, GI_LOGGERCHANNEL_FLAGS_CONSOLE_OUTPUT, consoleOutput);
 }
}

variable_types:
consoleOutput
enum GI_BOOL { GI_TRUE=0, GI_FALSE=1 }


decompiled_code:
__int64 __fastcall gi_Logger_SetFileOutput(unsigned int a1, unsigned int a2)
{
__int64 result; // rax

result = gi_Logger_GetDefaultChannel(a1);
if ( result )
result = gi_LoggerChannel_ChangeFlags(result, 4LL, a2);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func9(unsigned int a1, unsigned int a2)
{
__int64 result; // rax

result = func4(a1);
if ( result )
result = gi_LoggerChannel_ChangeFlags(result, 4LL, a2);
return result;
}

original_code:
void gi_Logger_SetFileOutput(const int channel, const GI_BOOL fileOutput)
{
 gi_LoggerChannel* const channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  gi_LoggerChannel_ChangeFlags(channelPtr, GI_LOGGERCHANNEL_FLAGS_FILE_OUTPUT, fileOutput);
 }
}

canonical_original_code:
void gi_Logger_SetFileOutput(int channel, enum GI_BOOL fileOutput)
{
 struct gi_LoggerChannel *channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  gi_LoggerChannel_ChangeFlags(channelPtr, GI_LOGGERCHANNEL_FLAGS_FILE_OUTPUT, fileOutput);
 }
}

variable_types:
fileOutput
enum GI_BOOL { GI_TRUE=0, GI_FALSE=1 }


decompiled_code:
__int64 __fastcall gi_Logger_SetChannelOutputFileName(unsigned int a1)
{
__int64 result; // rax

result = gi_Logger_GetDefaultChannel(a1);
if ( result )
result = gi_LoggerChannel_SetOutputFileName(result);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func10(unsigned int a1)
{
__int64 result; // rax

result = func4(a1);
if ( result )
result = gi_LoggerChannel_SetOutputFileName(result);
return result;
}

original_code:
void gi_Logger_SetChannelOutputFileName(const int channel, const char* const fname)
{
 gi_LoggerChannel* const channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  gi_LoggerChannel_SetOutputFileName(channelPtr, fname);
 }
}

canonical_original_code:
void gi_Logger_SetChannelOutputFileName(int channel, char *fname)
{
 struct gi_LoggerChannel *channelPtr = gi_Logger_GetDefaultChannel(channel);
 if (channelPtr)
 {
  gi_LoggerChannel_SetOutputFileName(channelPtr, fname);
 }
}

variable_types:
fname
char *


decompiled_code:
void gi_Logger_FatalError(__int64 a1, ...)
{
__int64 v1; // rdi
__int64 v2; // r10
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
v1 = gi_Logger_GetDefaultChannel(0);
gi_Logger_SetErrorStatus();
if ( v1 )
gi_LoggerChannel_InternalOutput(v1, v2, va);
}

canonical_decompiled_code:
void func11(__int64 a1, ...)
{
__int64 v1; // rdi
__int64 v2; // r10
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
v1 = func4(0);
func3();
if ( v1 )
gi_LoggerChannel_InternalOutput(v1, v2, va);
}

original_code:
void gi_Logger_FatalError(const char* const fmt, ...)
{
 gi_LoggerChannel* const channelPtr = gi_Logger_GetDefaultChannel(GI_CHANNEL_FATAL_ERROR);
 va_list argPtr;
 __builtin_va_start(argPtr,fmt);
 gi_Logger_SetErrorStatus();
 if (channelPtr)
 {
  gi_LoggerChannel_InternalOutput(channelPtr, fmt, &argPtr);
 }
}

canonical_original_code:
void gi_Logger_FatalError(char *fmt, ...)
{
 struct gi_LoggerChannel *channelPtr = gi_Logger_GetDefaultChannel(GI_CHANNEL_FATAL_ERROR);
 __builtin_va_list argPtr;
 __builtin_va_start(argPtr,fmt);
 gi_Logger_SetErrorStatus();
 if (channelPtr)
 {
  gi_LoggerChannel_InternalOutput(channelPtr, fmt, &argPtr);
 }
}

variable_types:
fmt
char *


decompiled_code:
void gi_Logger_Error(__int64 a1, ...)
{
__int64 v1; // rdi
__int64 v2; // r10
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
v1 = gi_Logger_GetDefaultChannel(1u);
gi_Logger_SetErrorStatus();
if ( v1 )
gi_LoggerChannel_InternalOutput(v1, v2, va);
}

canonical_decompiled_code:
void func12(__int64 a1, ...)
{
__int64 v1; // rdi
__int64 v2; // r10
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
v1 = func4(1u);
func3();
if ( v1 )
gi_LoggerChannel_InternalOutput(v1, v2, va);
}

original_code:
void gi_Logger_Error(const char* const fmt, ...)
{
 gi_LoggerChannel* const channelPtr = gi_Logger_GetDefaultChannel(GI_CHANNEL_ERROR);
 va_list argPtr;
 __builtin_va_start(argPtr,fmt);
 gi_Logger_SetErrorStatus();
 if (channelPtr)
 {
  gi_LoggerChannel_InternalOutput(channelPtr, fmt, &argPtr);
 }
}

canonical_original_code:
void gi_Logger_Error(char *fmt, ...)
{
 struct gi_LoggerChannel *channelPtr = gi_Logger_GetDefaultChannel(GI_CHANNEL_ERROR);
 __builtin_va_list argPtr;
 __builtin_va_start(argPtr,fmt);
 gi_Logger_SetErrorStatus();
 if (channelPtr)
 {
  gi_LoggerChannel_InternalOutput(channelPtr, fmt, &argPtr);
 }
}


decompiled_code:
void *gi_Logger_Warning(__int64 a1, ...)
{
__int64 v1; // rdi
__int64 v2; // r10
void *result; // rax
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
v1 = gi_Logger_GetDefaultChannel(2u);
result = va[0].reg_save_area;
if ( v1 )
result = (void *)gi_LoggerChannel_InternalOutput(v1, v2, va);
return result;
}

canonical_decompiled_code:
void *func13(__int64 a1, ...)
{
__int64 v1; // rdi
__int64 v2; // r10
void *result; // rax
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
v1 = func4(2u);
result = va[0].reg_save_area;
if ( v1 )
result = (void *)gi_LoggerChannel_InternalOutput(v1, v2, va);
return result;
}

original_code:
void gi_Logger_Warning(const char* const fmt, ...)
{
 gi_LoggerChannel* const channelPtr = gi_Logger_GetDefaultChannel(GI_CHANNEL_WARNING);
 va_list argPtr;
 __builtin_va_start(argPtr,fmt);
 if (channelPtr)
 {
  gi_LoggerChannel_InternalOutput(channelPtr, fmt, &argPtr);
 }
}

canonical_original_code:
void gi_Logger_Warning(char *fmt, ...)
{
 struct gi_LoggerChannel *channelPtr = gi_Logger_GetDefaultChannel(GI_CHANNEL_WARNING);
 __builtin_va_list argPtr;
 __builtin_va_start(argPtr,fmt);
 if (channelPtr)
 {
  gi_LoggerChannel_InternalOutput(channelPtr, fmt, &argPtr);
 }
}


decompiled_code:
void *gi_Logger_Log(__int64 a1, ...)
{
__int64 v1; // rdi
__int64 v2; // r10
void *result; // rax
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
v1 = gi_Logger_GetDefaultChannel(3u);
result = va[0].reg_save_area;
if ( v1 )
result = (void *)gi_LoggerChannel_InternalOutput(v1, v2, va);
return result;
}

canonical_decompiled_code:
void *func14(__int64 a1, ...)
{
__int64 v1; // rdi
__int64 v2; // r10
void *result; // rax
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
v1 = func4(3u);
result = va[0].reg_save_area;
if ( v1 )
result = (void *)gi_LoggerChannel_InternalOutput(v1, v2, va);
return result;
}

original_code:
void gi_Logger_Log(const char* const fmt, ...)
{
 gi_LoggerChannel* const channelPtr = gi_Logger_GetDefaultChannel(GI_CHANNEL_LOG);
 va_list argPtr;
 __builtin_va_start(argPtr,fmt);
 if (channelPtr)
 {
  gi_LoggerChannel_InternalOutput(channelPtr, fmt, &argPtr);
 }
}

canonical_original_code:
void gi_Logger_Log(char *fmt, ...)
{
 struct gi_LoggerChannel *channelPtr = gi_Logger_GetDefaultChannel(GI_CHANNEL_LOG);
 __builtin_va_list argPtr;
 __builtin_va_start(argPtr,fmt);
 if (channelPtr)
 {
  gi_LoggerChannel_InternalOutput(channelPtr, fmt, &argPtr);
 }
}


decompiled_code:
void *__fastcall gi_Logger_CreateChannel(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 i; // rbx
void *v7; // r12

for ( i = 0LL; i != 1024; i += 8LL )
{
if ( !*(_QWORD *)(s_channelPtrs + i) )
{
v7 = malloc(0x1CuLL);
gi_LoggerChannel_Init(v7, a1, a2, a3, a4);
*(_QWORD *)(s_channelPtrs + i) = v7;
return v7;
}
}
return 0LL;
}

canonical_decompiled_code:
void *__fastcall func15(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 i; // rbx
void *v7; // r12

for ( i = 0LL; i != 1024; i += 8LL )
{
if ( !*(_QWORD *)(s_channelPtrs + i) )
{
v7 = malloc(0x1CuLL);
gi_LoggerChannel_Init(v7, a1, a2, a3, a4);
*(_QWORD *)(s_channelPtrs + i) = v7;
return v7;
}
}
return 0LL;
}

original_code:
gi_LoggerChannel* gi_Logger_CreateChannel(const char* const nickName, const char* const prefix,
                       const char* const outputFileName, const size_t flags)
{
 size_t channel;
 for (channel = 0; channel < 128; channel++)
 {
  gi_LoggerChannel* const channelPtr = s_channelPtrs[channel];
  if (channelPtr == ((void *)0))
  {
   gi_LoggerChannel* const newChannel = (gi_LoggerChannel* const)malloc(sizeof(gi_LoggerChannel));
   gi_LoggerChannel_Init(newChannel, nickName, prefix, outputFileName, flags);
   s_channelPtrs[channel] = newChannel;
   return newChannel;
  }
 }
 return ((void *)0);
}

canonical_original_code:
struct gi_LoggerChannel *gi_Logger_CreateChannel(char *nickName, char *prefix, char *outputFileName, unsigned long flags)
{
 unsigned long channel;
 for (channel = 0; channel < 128; channel++)
 {
  struct gi_LoggerChannel *channelPtr = s_channelPtrs[channel];
  if (channelPtr == ((void *)0))
  {
   struct gi_LoggerChannel *newChannel = (gi_LoggerChannel* const)malloc(sizeof(gi_LoggerChannel));
   gi_LoggerChannel_Init(newChannel, nickName, prefix, outputFileName, flags);
   s_channelPtrs[channel] = newChannel;
   return newChannel;
  }
 }
 return ((void *)0);
}

variable_types:
nickName
char *

variable_types:
prefix
char *

variable_types:
outputFileName
char *

variable_types:
channel
unsigned long


decompiled_code:
void *gi_Logger_Init()
{
void *result; // rax

result = calloc(0x400uLL, 1uLL);
s_channelPtrs = (__int64)result;
if ( result )
{
s_defaultChannels = 0LL;
*(&s_defaultChannels + 1) = 0LL;
*(_QWORD *)&s_defaultChannels = gi_Logger_CreateChannel(
(__int64)"FATAL_ERROR",
(__int64)"FATAL_ERROR: ",
(__int64)"log.txt",
7LL);
*((_QWORD *)&s_defaultChannels + 1) = gi_Logger_CreateChannel(
(__int64)"ERROR",
(__int64)"ERROR: ",
(__int64)"log.txt",
6LL);
*((_QWORD *)&s_defaultChannels + 2) = gi_Logger_CreateChannel(
(__int64)"WARNING",
(__int64)"WARNING: ",
(__int64)"log.txt",
6LL);
result = gi_Logger_CreateChannel((__int64)"LOG", (__int64)&unk_60A, (__int64)"log.txt", 6LL);
*((_QWORD *)&s_defaultChannels + 3) = result;
}
return result;
}

canonical_decompiled_code:
void *func16()
{
void *result; // rax

result = calloc(0x400uLL, 1uLL);
s_channelPtrs = (__int64)result;
if ( result )
{
s_defaultChannels = 0LL;
*(&s_defaultChannels + 1) = 0LL;
*(_QWORD *)&s_defaultChannels = func15(
(__int64)"FATAL_ERROR",
(__int64)"FATAL_ERROR: ",
(__int64)"log.txt",
7LL);
*((_QWORD *)&s_defaultChannels + 1) = func15(
(__int64)"ERROR",
(__int64)"ERROR: ",
(__int64)"log.txt",
6LL);
*((_QWORD *)&s_defaultChannels + 2) = func15(
(__int64)"WARNING",
(__int64)"WARNING: ",
(__int64)"log.txt",
6LL);
result = func15((__int64)"LOG", (__int64)&unk_60A, (__int64)"log.txt", 6LL);
*((_QWORD *)&s_defaultChannels + 3) = result;
}
return result;
}

original_code:
void gi_Logger_Init(void)
{
 size_t defaultFlags;
 s_channelPtrs = (gi_LoggerChannel**)malloc(sizeof(gi_LoggerChannel*)*128);
 if (s_channelPtrs == ((void *)0))
 {
  return;
 }
 memset(s_channelPtrs, 0, sizeof(gi_LoggerChannel*)*128);
 memset(s_defaultChannels, 0, sizeof(gi_LoggerChannel*)*GI_CHANNEL_NUM_DEFAULT_CHANNELS);
 defaultFlags = FLAGS_DEFAULT;
 s_defaultChannels[GI_CHANNEL_FATAL_ERROR] = gi_Logger_CreateChannel("FATAL_ERROR", "FATAL_ERROR: ", "log.txt",
                              defaultFlags | GI_LOGGERCHANNEL_FLAGS_FATAL);
 s_defaultChannels[GI_CHANNEL_ERROR] = gi_Logger_CreateChannel("ERROR", "ERROR: ", "log.txt", defaultFlags);
 s_defaultChannels[GI_CHANNEL_WARNING] = gi_Logger_CreateChannel("WARNING", "WARNING: ", "log.txt", defaultFlags);
 s_defaultChannels[GI_CHANNEL_LOG] = gi_Logger_CreateChannel("LOG", "", "log.txt", defaultFlags);
}

canonical_original_code:
void gi_Logger_Init()
{
 unsigned long defaultFlags;
 s_channelPtrs = (struct gi_LoggerChannel **)malloc(sizeof(struct gi_LoggerChannel *)*128);
 if (s_channelPtrs == ((void *)0))
 {
  return;
 }
 memset(s_channelPtrs, 0, sizeof(struct gi_LoggerChannel *)*128);
 memset(s_defaultChannels, 0, sizeof(struct gi_LoggerChannel *)*GI_CHANNEL_NUM_DEFAULT_CHANNELS);
 defaultFlags = FLAGS_DEFAULT;
 s_defaultChannels[GI_CHANNEL_FATAL_ERROR] = gi_Logger_CreateChannel("FATAL_ERROR", "FATAL_ERROR: ", "log.txt",
                              defaultFlags | GI_LOGGERCHANNEL_FLAGS_FATAL);
 s_defaultChannels[GI_CHANNEL_ERROR] = gi_Logger_CreateChannel("ERROR", "ERROR: ", "log.txt", defaultFlags);
 s_defaultChannels[GI_CHANNEL_WARNING] = gi_Logger_CreateChannel("WARNING", "WARNING: ", "log.txt", defaultFlags);
 s_defaultChannels[GI_CHANNEL_LOG] = gi_Logger_CreateChannel("LOG", "", "log.txt", defaultFlags);
}

variable_types:
defaultFlags
unsigned long


decompiled_code:
__int64 __fastcall gi_DefencePlay_Init(__int64 a1)
{
__int64 v2; // rbp
__int64 v3; // rbx
__int64 v4; // rdi
__int64 result; // rax

v2 = a1 + 1376;
v3 = a1 + 32;
*(_BYTE *)a1 = 0;
*(_BYTE *)(a1 + 16) = 0;
do
{
gi_PositionValue_Init(v3);
gi_PositionValue_Init(v3 + 1344);
v4 = v3 + 2688;
v3 += 32LL;
result = gi_PositionValue_Init(v4);
}
while ( v3 != v2 );
*(_QWORD *)(a1 + 4064) = 0LL;
*(_QWORD *)(a1 + 4072) = 0LL;
*(_QWORD *)(a1 + 4080) = 0LL;
return result;
}

original_code:
void gi_DefencePlay_Init(gi_DefencePlay* const pThis)
{
 size_t i;
 pThis->m_name[0] = '\0';
 pThis->m_zone[0] = '\0';
 for (i = 0; i < GI_POSITION_NUM; i++)
 {
  gi_PositionValue_Init(&pThis->m_base[i]);
  gi_PositionValue_Init(&pThis->m_tackler[i]);
  gi_PositionValue_Init(&pThis->m_weighting[i]);
 }
 pThis->m_numBase = 0;
 pThis->m_numTackler = 0;
 pThis->m_numWeighting = 0;
}

canonical_original_code:
void gi_DefencePlay_Init(struct gi_DefencePlay *pThis)
{
 unsigned long i;
 pThis->m_name[0] = '\0';
 pThis->m_zone[0] = '\0';
 for (i = 0; i < GI_POSITION_NUM; i++)
 {
  gi_PositionValue_Init(&pThis->m_base[i]);
  gi_PositionValue_Init(&pThis->m_tackler[i]);
  gi_PositionValue_Init(&pThis->m_weighting[i]);
 }
 pThis->m_numBase = 0;
 pThis->m_numTackler = 0;
 pThis->m_numWeighting = 0;
}

variable_types: struct gi_DefencePlay { char m_name[-1]; char m_zone[-1]; struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } m_base[-1]; struct gi_PositionValue m_tackler[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numTackler; unsigned long m_numWeighting; } *

variable_types:
i
unsigned long

user_defined_types: struct gi_DefencePlay { char m_name[-1]; char m_zone[-1]; struct gi_PositionValue m_base[-1]; struct gi_PositionValue m_tackler[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numTackler; unsigned long m_numWeighting; }

user_defined_types: struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION m_position; enum GI_POSITION m_basePosition; union PositionValue_Value m_value; enum GI_QST m_qst; enum GI_TYPE m_valueType; }


decompiled_code:
float __fastcall gi_DefencePlay_ComputeBase(__int64 a1, int a2, __int64 a3)
{
unsigned __int64 v4; // rbx
float v6; // [rsp+8h] [rbp-30h]
float v7; // [rsp+Ch] [rbp-2Ch]

if ( !*(_QWORD *)(a1 + 4064) )
return 0.0;
v6 = 0.0;
v4 = 0LL;
do
{
while ( 1 )
{
++v4;
if ( (unsigned int)gi_PositionValue_GetBasePosition(a1 + 32 * v4) == a2
&& !(unsigned int)gi_PositionValue_GetValueType(a1 + 32 * v4) )
{
break;
}
if ( *(_QWORD *)(a1 + 4064) <= v4 )
return v6;
}
v7 = *(float *)(a3 + 4LL * (unsigned int)gi_PositionValue_GetQST(a1 + 32 * v4));
v6 = (float)(gi_PositionValue_GetFloatValue(a1 + 32 * v4) * v7) + v6;
}
while ( *(_QWORD *)(a1 + 4064) > v4 );
return v6;
}

canonical_decompiled_code:
float __fastcall func4(__int64 a1, int a2, __int64 a3)
{
unsigned __int64 v4; // rbx
float v6; // [rsp+8h] [rbp-30h]
float v7; // [rsp+Ch] [rbp-2Ch]

if ( !*(_QWORD *)(a1 + 4064) )
return 0.0;
v6 = 0.0;
v4 = 0LL;
do
{
while ( 1 )
{
++v4;
if ( (unsigned int)gi_PositionValue_GetBasePosition(a1 + 32 * v4) == a2
&& !(unsigned int)gi_PositionValue_GetValueType(a1 + 32 * v4) )
{
break;
}
if ( *(_QWORD *)(a1 + 4064) <= v4 )
return v6;
}
v7 = *(float *)(a3 + 4LL * (unsigned int)gi_PositionValue_GetQST(a1 + 32 * v4));
v6 = (float)(gi_PositionValue_GetFloatValue(a1 + 32 * v4) * v7) + v6;
}
while ( *(_QWORD *)(a1 + 4064) > v4 );
return v6;
}

original_code:
float gi_DefencePlay_ComputeBase(const gi_DefencePlay* const pThis, const GI_POSITION playerPosition, const float* const playerQST)
{
 size_t i;
 float baseValue = 0.0f;
 for (i = 0; i < pThis->m_numBase; i++)
 {
  const gi_PositionValue* const pPositionValue = &pThis->m_base[i];
  if (gi_PositionValue_GetBasePosition(pPositionValue) == playerPosition)
  {
   if (gi_PositionValue_GetValueType(pPositionValue) == GI_TYPE_FLOAT)
   {
    const GI_QST playQST = gi_PositionValue_GetQST(pPositionValue);
    const float playerStat = playerQST[playQST] * gi_PositionValue_GetFloatValue(pPositionValue);
    baseValue += playerStat;
   }
  }
 }
 return baseValue;
}

canonical_original_code:
float gi_DefencePlay_ComputeBase(struct gi_DefencePlay *pThis, enum GI_POSITION playerPosition, float *playerQST)
{
 unsigned long i;
 float baseValue = 0.0f;
 for (i = 0; i < pThis->m_numBase; i++)
 {
  struct gi_PositionValue *pPositionValue = &pThis->m_base[i];
  if (gi_PositionValue_GetBasePosition(pPositionValue) == playerPosition)
  {
   if (gi_PositionValue_GetValueType(pPositionValue) == GI_TYPE_FLOAT)
   {
    enum GI_QST playQST = gi_PositionValue_GetQST(pPositionValue);
    float playerStat = playerQST[playQST] * gi_PositionValue_GetFloatValue(pPositionValue);
    baseValue += playerStat;
   }
  }
 }
 return baseValue;
}

variable_types:
playerQST
float *

variable_types: baseValue float

variable_types: struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } *

variable_types: playerStat float


decompiled_code:
__int64 __fastcall gi_DefencePlay_GetName(__int64 a1)
{
return a1;
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1)
{
return a1;
}

original_code:
const char* gi_DefencePlay_GetName(const gi_DefencePlay* const pThis)
{
 return pThis->m_name;
}

canonical_original_code:
char *gi_DefencePlay_GetName(struct gi_DefencePlay *pThis)
{
 return pThis->m_name;
}

user_defined_types: union PositionValue_Value { float f; unsigned long i; }

user_defined_types: enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr }

user_defined_types: enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 }


decompiled_code:
__int64 __fastcall gi_DefencePlay_GetZone(__int64 a1)
{
return a1 + 16;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1)
{
return a1 + 16;
}

original_code:
const char* gi_DefencePlay_GetZone(const gi_DefencePlay* const pThis)
{
 return pThis->m_zone;
}

canonical_original_code:
char *gi_DefencePlay_GetZone(struct gi_DefencePlay *pThis)
{
 return pThis->m_zone;
}


decompiled_code:
__int64 __fastcall gi_PlayInfo_Init(_QWORD *a1)
{
_QWORD *v1; // r12
_QWORD *v3; // rbx
_QWORD *v4; // rdi
_QWORD *v5; // rbx
_QWORD *v6; // rdi
_QWORD *v7; // rbx
_QWORD *v8; // rbp
_QWORD *v9; // rdi
__int64 result; // rax

v1 = a1 + 73345;
v3 = a1 + 1;
*a1 = 0LL;
do
{
v4 = v3;
v3 += 573;
gi_OffencePlay_Init(v4);
}
while ( v1 != v3 );
memset(v1, 0, 0x10000uLL);
v5 = a1 + 81538;
a1[81537] = 0LL;
do
{
v6 = v5;
v5 += 511;
gi_DefencePlay_Init(v6);
}
while ( a1 + 146946 != v5 );
memset(a1 + 146946, 0, 0x10000uLL);
v7 = a1 + 155138;
v8 = a1 + 155266;
do
{
v9 = v7;
v7 += 2;
result = gi_SpecialTeamsValues_Init(v9);
}
while ( v8 != v7 );
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(_QWORD *a1)
{
_QWORD *v1; // r12
_QWORD *v3; // rbx
_QWORD *v4; // rdi
_QWORD *v5; // rbx
_QWORD *v6; // rdi
_QWORD *v7; // rbx
_QWORD *v8; // rbp
_QWORD *v9; // rdi
__int64 result; // rax

v1 = a1 + 73345;
v3 = a1 + 1;
*a1 = 0LL;
do
{
v4 = v3;
v3 += 573;
gi_OffencePlay_Init(v4);
}
while ( v1 != v3 );
memset(v1, 0, 0x10000uLL);
v5 = a1 + 81538;
a1[81537] = 0LL;
do
{
v6 = v5;
v5 += 511;
gi_DefencePlay_Init(v6);
}
while ( a1 + 146946 != v5 );
memset(a1 + 146946, 0, 0x10000uLL);
v7 = a1 + 155138;
v8 = a1 + 155266;
do
{
v9 = v7;
v7 += 2;
result = gi_SpecialTeamsValues_Init(v9);
}
while ( v8 != v7 );
return result;
}

original_code:
void gi_PlayInfo_Init(gi_PlayInfo* const pThis)
{
 size_t i;
 pThis->m_numOffencePlays = 0;
 for (i = 0; i < (128); i++)
 {
  gi_OffencePlay_Init(&pThis->m_offencePlays[i]);
 }
 for (i = 0; i < (128); i++)
 {
  size_t p;
  for (p = 0; p < (64); p++)
  {
   pThis->m_offenceStatsBase[i][p] = 0.0f;
   pThis->m_offenceStatsBC[i][p] = 0.0f;
  }
 }
 pThis->m_numDefencePlays = 0;
 for (i = 0; i < (128); i++)
 {
  gi_DefencePlay_Init(&pThis->m_defencePlays[i]);
 }
 for (i = 0; i < (128); i++)
 {
  size_t p;
  for (p = 0; p < (64); p++)
  {
   pThis->m_defenceStatsBase[i][p] = 0.0f;
   pThis->m_defenceStatsTackler[i][p] = 0.0f;
  }
 }
 for (i = 0; i < (64); i++)
 {
  gi_SpecialTeamsValues_Init(&pThis->m_specialTeamsValues[i]);
 }
}

canonical_original_code:
void gi_PlayInfo_Init(struct gi_PlayInfo *pThis)
{
 unsigned long i;
 pThis->m_numOffencePlays = 0;
 for (i = 0; i < (128); i++)
 {
  gi_OffencePlay_Init(&pThis->m_offencePlays[i]);
 }
 for (i = 0; i < (128); i++)
 {
  unsigned long p;
  for (p = 0; p < (64); p++)
  {
   pThis->m_offenceStatsBase[i][p] = 0.0f;
   pThis->m_offenceStatsBC[i][p] = 0.0f;
  }
 }
 pThis->m_numDefencePlays = 0;
 for (i = 0; i < (128); i++)
 {
  gi_DefencePlay_Init(&pThis->m_defencePlays[i]);
 }
 for (i = 0; i < (128); i++)
 {
  unsigned long p;
  for (p = 0; p < (64); p++)
  {
   pThis->m_defenceStatsBase[i][p] = 0.0f;
   pThis->m_defenceStatsTackler[i][p] = 0.0f;
  }
 }
 for (i = 0; i < (64); i++)
 {
  gi_SpecialTeamsValues_Init(&pThis->m_specialTeamsValues[i]);
 }
}

variable_types: struct gi_PlayInfo { unsigned long m_numOffencePlays; struct gi_OffencePlay { char m_name[-1]; char m_defence[-1][-1]; struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } m_base[-1]; struct gi_PositionValue m_bc[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numBC; unsigned long m_numWeighting; } m_offencePlays[-1]; float m_offenceStatsBase[-1][-1]; float m_offenceStatsBC[-1][-1]; unsigned long m_numDefencePlays; struct gi_DefencePlay { char m_name[-1]; char m_zone[-1]; struct gi_PositionValue m_base[-1]; struct gi_PositionValue m_tackler[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numTackler; unsigned long m_numWeighting; } m_defencePlays[-1]; float m_defenceStatsBase[-1][-1]; float m_defenceStatsTackler[-1][-1]; struct gi_SpecialTeamsValues { float m_protector; float m_blocker; float m_runner; float m_gunner; } m_specialTeamsValues[-1]; } *

variable_types:
p
unsigned long

user_defined_types: struct gi_PlayInfo { unsigned long m_numOffencePlays; struct gi_OffencePlay m_offencePlays[-1]; float m_offenceStatsBase[-1][-1]; float m_offenceStatsBC[-1][-1]; unsigned long m_numDefencePlays; struct gi_DefencePlay m_defencePlays[-1]; float m_defenceStatsBase[-1][-1]; float m_defenceStatsTackler[-1][-1]; struct gi_SpecialTeamsValues m_specialTeamsValues[-1]; }

user_defined_types: struct gi_OffencePlay { char m_name[-1]; char m_defence[-1][-1]; struct gi_PositionValue m_base[-1]; struct gi_PositionValue m_bc[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numBC; unsigned long m_numWeighting; }


decompiled_code:
__int64 __fastcall gi_PlayInfo_AddOffencePlay(__int64 *a1, char *a2)
{
__int64 v2; // rdx
unsigned int v4; // er8
unsigned __int64 v5; // rdi
_QWORD *v6; // rcx

v2 = *a1;
v4 = 0;
if ( (unsigned __int64)*a1 <= 0x7F )
{
v5 = (unsigned __int64)&a1[573 * v2];
*(_QWORD *)(v5 + 8) = *(_QWORD *)a2;
v6 = (_QWORD *)(v5 + 8);
v5 += 16LL;
*(_QWORD *)(v5 + 4568) = *((_QWORD *)a2 + 572);
v4 = 1;
qmemcpy(
(void *)(v5 & 0xFFFFFFFFFFFFFFF8LL),
(const void *)(a2 - ((char *)v6 - (v5 & 0xFFFFFFFFFFFFFFF8LL))),
8 * (((unsigned int)v6 - (v5 & 0xFFFFFFF8) + 4584) >> 3));
*a1 = v2 + 1;
}
return v4;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 *a1, char *a2)
{
__int64 v2; // rdx
unsigned int v4; // er8
unsigned __int64 v5; // rdi
_QWORD *v6; // rcx

v2 = *a1;
v4 = 0;
if ( (unsigned __int64)*a1 <= 0x7F )
{
v5 = (unsigned __int64)&a1[573 * v2];
*(_QWORD *)(v5 + 8) = *(_QWORD *)a2;
v6 = (_QWORD *)(v5 + 8);
v5 += 16LL;
*(_QWORD *)(v5 + 4568) = *((_QWORD *)a2 + 572);
v4 = 1;
qmemcpy(
(void *)(v5 & 0xFFFFFFFFFFFFFFF8LL),
(const void *)(a2 - ((char *)v6 - (v5 & 0xFFFFFFFFFFFFFFF8LL))),
8 * (((unsigned int)v6 - (v5 & 0xFFFFFFF8) + 4584) >> 3));
*a1 = v2 + 1;
}
return v4;
}

original_code:
GI_RETURN gi_PlayInfo_AddOffencePlay(gi_PlayInfo* const pThis, gi_OffencePlay* const pOffencePlay)
{
 size_t index = pThis->m_numOffencePlays;
 if (pThis->m_numOffencePlays >= (128))
 {
  return GI_RETURN_ERROR;
 }
 pThis->m_offencePlays[index] = *pOffencePlay;
 pThis->m_numOffencePlays++;
 return GI_RETURN_SUCCESS;
}

canonical_original_code:
enum GI_RETURN gi_PlayInfo_AddOffencePlay(struct gi_PlayInfo *pThis, struct gi_OffencePlay *pOffencePlay)
{
 unsigned long index = pThis->m_numOffencePlays;
 if (pThis->m_numOffencePlays >= (128))
 {
  return GI_RETURN_ERROR;
 }
 pThis->m_offencePlays[index] = *pOffencePlay;
 pThis->m_numOffencePlays++;
 return GI_RETURN_SUCCESS;
}

variable_types:
pOffencePlay
struct gi_OffencePlay *

variable_types:
index
unsigned long

return_type: enum GI_RETURN { GI_RETURN_ERROR=0, GI_RETURN_SUCCESS=1 }

user_defined_types: struct gi_SpecialTeamsValues { float m_protector; float m_blocker; float m_runner; float m_gunner; }


original_code:
GI_RETURN gi_PlayInfo_AddDefencePlay(gi_PlayInfo* const pThis, gi_DefencePlay* const pDefencePlay)
{
 size_t index = pThis->m_numDefencePlays;
 if (pThis->m_numDefencePlays >= (128))
 {
  return GI_RETURN_ERROR;
 }
 pThis->m_defencePlays[index] = *pDefencePlay;
 pThis->m_numDefencePlays++;
 return GI_RETURN_SUCCESS;
}

canonical_original_code:
enum GI_RETURN gi_PlayInfo_AddDefencePlay(struct gi_PlayInfo *pThis, struct gi_DefencePlay *pDefencePlay)
{
 unsigned long index = pThis->m_numDefencePlays;
 if (pThis->m_numDefencePlays >= (128))
 {
  return GI_RETURN_ERROR;
 }
 pThis->m_defencePlays[index] = *pDefencePlay;
 pThis->m_numDefencePlays++;
 return GI_RETURN_SUCCESS;
}

variable_types:
pDefencePlay
struct gi_DefencePlay *

user_defined_types: enum GI_RETURN { GI_RETURN_ERROR=0, GI_RETURN_SUCCESS=1 }


decompiled_code:
__int64 __fastcall gi_PlayInfo_GetOffencePlay(__int64 a1, __int64 a2)
{
return 4584 * a2 + a1 + 8;
}

original_code:
const gi_OffencePlay* gi_PlayInfo_GetOffencePlay(const gi_PlayInfo* const pThis, const size_t playIndex)
{
 return &pThis->m_offencePlays[playIndex];
}

canonical_original_code:
struct gi_OffencePlay *gi_PlayInfo_GetOffencePlay(struct gi_PlayInfo *pThis, unsigned long playIndex)
{
 return &pThis->m_offencePlays[playIndex];
}

variable_types: struct gi_PlayInfo { unsigned long m_numOffencePlays; struct gi_OffencePlay m_offencePlays[-1]; float m_offenceStatsBase[-1][-1]; float m_offenceStatsBC[-1][-1]; unsigned long m_numDefencePlays; struct gi_DefencePlay { char m_name[-1]; char m_zone[-1]; struct gi_PositionValue m_base[-1]; struct gi_PositionValue m_tackler[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numTackler; unsigned long m_numWeighting; } m_defencePlays[-1]; float m_defenceStatsBase[-1][-1]; float m_defenceStatsTackler[-1][-1]; struct gi_SpecialTeamsValues { float m_protector; float m_blocker; float m_runner; float m_gunner; } m_specialTeamsValues[-1]; } *

variable_types:
playIndex
unsigned long

return_type: struct gi_OffencePlay { char m_name[-1]; char m_defence[-1][-1]; struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } m_base[-1]; struct gi_PositionValue m_bc[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numBC; unsigned long m_numWeighting; } *


decompiled_code:
float __fastcall gi_PlayInfo_GetOffenceStatsBaseValue(__int64 a1, __int64 a2, __int64 a3)
{
return *(float *)(a1 + 4 * ((a2 << 6) + a3 + 146688) + 8);
}

original_code:
float gi_PlayInfo_GetOffenceStatsBaseValue(const gi_PlayInfo* const pThis, const size_t playIndex, const size_t playerIndex)
{
 return pThis->m_offenceStatsBase[playIndex][playerIndex];
}

canonical_original_code:
float gi_PlayInfo_GetOffenceStatsBaseValue(struct gi_PlayInfo *pThis, unsigned long playIndex, unsigned long playerIndex)
{
 return pThis->m_offenceStatsBase[playIndex][playerIndex];
}

variable_types:
playerIndex
unsigned long


decompiled_code:
__int64 __fastcall gi_PlayInfo_GetDefencePlay(__int64 a1, __int64 a2)
{
return a1 + 4088 * a2 + 652304;
}

original_code:
const gi_DefencePlay* gi_PlayInfo_GetDefencePlay(const gi_PlayInfo* const pThis, const size_t playIndex)
{
 return &pThis->m_defencePlays[playIndex];
}

canonical_original_code:
struct gi_DefencePlay *gi_PlayInfo_GetDefencePlay(struct gi_PlayInfo *pThis, unsigned long playIndex)
{
 return &pThis->m_defencePlays[playIndex];
}

variable_types: struct gi_PlayInfo { unsigned long m_numOffencePlays; struct gi_OffencePlay { char m_name[-1]; char m_defence[-1][-1]; struct gi_PositionValue m_base[-1]; struct gi_PositionValue m_bc[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numBC; unsigned long m_numWeighting; } m_offencePlays[-1]; float m_offenceStatsBase[-1][-1]; float m_offenceStatsBC[-1][-1]; unsigned long m_numDefencePlays; struct gi_DefencePlay m_defencePlays[-1]; float m_defenceStatsBase[-1][-1]; float m_defenceStatsTackler[-1][-1]; struct gi_SpecialTeamsValues { float m_protector; float m_blocker; float m_runner; float m_gunner; } m_specialTeamsValues[-1]; } *

return_type: struct gi_DefencePlay { char m_name[-1]; char m_zone[-1]; struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } m_base[-1]; struct gi_PositionValue m_tackler[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numTackler; unsigned long m_numWeighting; } *


decompiled_code:
float __fastcall gi_PlayInfo_GetDefenceStatsBaseValue(__int64 a1, __int64 a2, __int64 a3)
{
return *(float *)(a1 + 4 * ((a2 << 6) + a3 + 293892));
}

original_code:
float gi_PlayInfo_GetDefenceStatsBaseValue(const gi_PlayInfo* const pThis, const size_t playIndex, const size_t playerIndex)
{
 return pThis->m_defenceStatsBase[playIndex][playerIndex];
}

canonical_original_code:
float gi_PlayInfo_GetDefenceStatsBaseValue(struct gi_PlayInfo *pThis, unsigned long playIndex, unsigned long playerIndex)
{
 return pThis->m_defenceStatsBase[playIndex][playerIndex];
}


decompiled_code:
__int64 __fastcall gi_PlayInfo_GetSpecialTeamsValuesForPlayer(__int64 a1, __int64 a2)
{
return a1 + 16 * (a2 + 77569);
}

original_code:
const gi_SpecialTeamsValues* gi_PlayInfo_GetSpecialTeamsValuesForPlayer(const gi_PlayInfo* const pThis, const size_t playerIndex)
{
 return &pThis->m_specialTeamsValues[playerIndex];
}

canonical_original_code:
struct gi_SpecialTeamsValues *gi_PlayInfo_GetSpecialTeamsValuesForPlayer(struct gi_PlayInfo *pThis, unsigned long playerIndex)
{
 return &pThis->m_specialTeamsValues[playerIndex];
}

variable_types: struct gi_PlayInfo { unsigned long m_numOffencePlays; struct gi_OffencePlay { char m_name[-1]; char m_defence[-1][-1]; struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } m_base[-1]; struct gi_PositionValue m_bc[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numBC; unsigned long m_numWeighting; } m_offencePlays[-1]; float m_offenceStatsBase[-1][-1]; float m_offenceStatsBC[-1][-1]; unsigned long m_numDefencePlays; struct gi_DefencePlay { char m_name[-1]; char m_zone[-1]; struct gi_PositionValue m_base[-1]; struct gi_PositionValue m_tackler[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numTackler; unsigned long m_numWeighting; } m_defencePlays[-1]; float m_defenceStatsBase[-1][-1]; float m_defenceStatsTackler[-1][-1]; struct gi_SpecialTeamsValues m_specialTeamsValues[-1]; } *

return_type: struct gi_SpecialTeamsValues { float m_protector; float m_blocker; float m_runner; float m_gunner; } *


decompiled_code:
__int64 __fastcall gi_GlobalInfo_Init(__int64 a1)
{
gi_PlayInfo_Init();
return gi_Team_Init(a1 + 1242128);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
gi_PlayInfo_Init();
return gi_Team_Init(a1 + 1242128);
}

original_code:
void gi_GlobalInfo_Init(gi_GlobalInfo* const pThis)
{
 gi_PlayInfo_Init(&pThis->m_playInfo);
 gi_Team_Init(&pThis->m_team);
}

canonical_original_code:
void gi_GlobalInfo_Init(struct gi_GlobalInfo *pThis)
{
 gi_PlayInfo_Init(&pThis->m_playInfo);
 gi_Team_Init(&pThis->m_team);
}

variable_types: struct gi_GlobalInfo { struct gi_PlayInfo { unsigned long m_numOffencePlays; struct gi_OffencePlay { char m_name[-1]; char m_defence[-1][-1]; struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } m_base[-1]; struct gi_PositionValue m_bc[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numBC; unsigned long m_numWeighting; } m_offencePlays[-1]; float m_offenceStatsBase[-1][-1]; float m_offenceStatsBC[-1][-1]; unsigned long m_numDefencePlays; struct gi_DefencePlay { char m_name[-1]; char m_zone[-1]; struct gi_PositionValue m_base[-1]; struct gi_PositionValue m_tackler[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numTackler; unsigned long m_numWeighting; } m_defencePlays[-1]; float m_defenceStatsBase[-1][-1]; float m_defenceStatsTackler[-1][-1]; struct gi_SpecialTeamsValues { float m_protector; float m_blocker; float m_runner; float m_gunner; } m_specialTeamsValues[-1]; } m_playInfo; struct gi_Team { struct gi_Player { char m_name[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; unsigned long m_rawLevel; unsigned long m_rawQST[-1]; float m_experience; enum GI_UNIT { GI_UNIT_OFFENCE=0, GI_UNIT_DEFENCE=1, GI_UNIT_SPECIALTEAMS=2, GI_UNIT_UNKNOWN=3, GI_UNIT_NUM=expr } m_unit; unsigned long m_age; float m_level; float m_QST[-1]; enum GI_INJURY { GI_INJURY_A=0, GI_INJURY_B=1, GI_INJURY_C=2, GI_INJURY_D=3, GI_INJURY_E=4, GI_INJURY_F=5, GI_INJURY_G=6, GI_INJURY_H=7, GI_INJURY_UNKNOWN=8, GI_INJURY_NUM=expr } m_injury; } m_squad[-1]; struct gi_Player *m_offence[-1]; struct gi_Player *m_defence[-1]; struct gi_Player *m_specialTeams[-1]; unsigned long m_usedPlayers[-1][-1]; unsigned long m_positionStarts[-1]; unsigned long m_positionCounts[-1]; char m_name[-1]; unsigned long m_numPlayers; unsigned long m_numOffence; unsigned long m_numDefence; unsigned long m_numSpecialTeams; } m_team; } *

return_type: void

user_defined_types: struct gi_GlobalInfo { struct gi_PlayInfo m_playInfo; struct gi_Team m_team; }

user_defined_types: struct gi_Team { struct gi_Player m_squad[-1]; struct gi_Player *m_offence[-1]; struct gi_Player *m_defence[-1]; struct gi_Player *m_specialTeams[-1]; unsigned long m_usedPlayers[-1][-1]; unsigned long m_positionStarts[-1]; unsigned long m_positionCounts[-1]; char m_name[-1]; unsigned long m_numPlayers; unsigned long m_numOffence; unsigned long m_numDefence; unsigned long m_numSpecialTeams; }


decompiled_code:
__int64 __fastcall gi_GlobalInfo_AddTeam(__int64 a1, const void *a2)
{
_BYTE *v2; // r8
__int64 result; // rax

v2 = (_BYTE *)gi_Team_GetName(a1 + 1242128);
result = 0LL;
if ( !*v2 )
{
memcpy((void *)(a1 + 1242128), a2, 0x47C0uLL);
result = 1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, const void *a2)
{
_BYTE *v2; // r8
__int64 result; // rax

v2 = (_BYTE *)gi_Team_GetName(a1 + 1242128);
result = 0LL;
if ( !*v2 )
{
memcpy((void *)(a1 + 1242128), a2, 0x47C0uLL);
result = 1LL;
}
return result;
}

original_code:
GI_RETURN gi_GlobalInfo_AddTeam(gi_GlobalInfo* const pThis, gi_Team* const pTeam)
{
 const char* const teamName = gi_Team_GetName(&(pThis->m_team));
 if (teamName[0] != '\0')
 {
  return GI_RETURN_ERROR;
 }
 pThis->m_team = *pTeam;
 return GI_RETURN_SUCCESS;
}

canonical_original_code:
enum GI_RETURN gi_GlobalInfo_AddTeam(struct gi_GlobalInfo *pThis, struct gi_Team *pTeam)
{
 char *teamName = gi_Team_GetName(&(pThis->m_team));
 if (teamName[0] != '\0')
 {
  return GI_RETURN_ERROR;
 }
 pThis->m_team = *pTeam;
 return GI_RETURN_SUCCESS;
}

variable_types:
pTeam
struct gi_Team *

variable_types:
teamName
char *


decompiled_code:
// attributes: thunk
__int64 gi_GlobalInfo_AddOffencePlay()
{
return gi_PlayInfo_AddOffencePlay();
}

canonical_decompiled_code:
__int64 func2()
{
return gi_PlayInfo_AddOffencePlay();
}

original_code:
GI_RETURN gi_GlobalInfo_AddOffencePlay(gi_GlobalInfo* const pThis, gi_OffencePlay* const pOffencePlay)
{
 return gi_PlayInfo_AddOffencePlay(&pThis->m_playInfo, pOffencePlay);
}

canonical_original_code:
enum GI_RETURN gi_GlobalInfo_AddOffencePlay(struct gi_GlobalInfo *pThis, struct gi_OffencePlay *pOffencePlay)
{
 return gi_PlayInfo_AddOffencePlay(&pThis->m_playInfo, pOffencePlay);
}


decompiled_code:
// attributes: thunk
__int64 gi_GlobalInfo_AddDefencePlay()
{
return gi_PlayInfo_AddDefencePlay();
}

canonical_decompiled_code:
__int64 func3()
{
return gi_PlayInfo_AddDefencePlay();
}

original_code:
GI_RETURN gi_GlobalInfo_AddDefencePlay(gi_GlobalInfo* const pThis, gi_DefencePlay* const pDefencePlay)
{
 return gi_PlayInfo_AddDefencePlay(&pThis->m_playInfo, pDefencePlay);
}

canonical_original_code:
enum GI_RETURN gi_GlobalInfo_AddDefencePlay(struct gi_GlobalInfo *pThis, struct gi_DefencePlay *pDefencePlay)
{
 return gi_PlayInfo_AddDefencePlay(&pThis->m_playInfo, pDefencePlay);
}


decompiled_code:
__int64 __fastcall gi_GlobalInfo_Compute(__int64 a1)
{
gi_Team_ComputeSpecialTeams(a1 + 1242128, a1);
gi_Team_ComputeOffenceBase(a1 + 1242128, a1);
return gi_Team_ComputeDefenceBase(a1 + 1242128, a1);
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1)
{
gi_Team_ComputeSpecialTeams(a1 + 1242128, a1);
gi_Team_ComputeOffenceBase(a1 + 1242128, a1);
return gi_Team_ComputeDefenceBase(a1 + 1242128, a1);
}

original_code:
void gi_GlobalInfo_Compute(gi_GlobalInfo* const pThis)
{
 const gi_Team* const pTeam = &pThis->m_team;
 gi_PlayInfo* const pPlayInfo = &pThis->m_playInfo;
 gi_Team_ComputeSpecialTeams(pTeam, pPlayInfo);
 gi_Team_ComputeOffenceBase(pTeam, pPlayInfo);
 gi_Team_ComputeDefenceBase(pTeam, pPlayInfo);
}

canonical_original_code:
void gi_GlobalInfo_Compute(struct gi_GlobalInfo *pThis)
{
 struct gi_Team *pTeam = &pThis->m_team;
 struct gi_PlayInfo *pPlayInfo = &pThis->m_playInfo;
 gi_Team_ComputeSpecialTeams(pTeam, pPlayInfo);
 gi_Team_ComputeOffenceBase(pTeam, pPlayInfo);
 gi_Team_ComputeDefenceBase(pTeam, pPlayInfo);
}

variable_types: struct gi_Team { struct gi_Player { char m_name[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; unsigned long m_rawLevel; unsigned long m_rawQST[-1]; float m_experience; enum GI_UNIT { GI_UNIT_OFFENCE=0, GI_UNIT_DEFENCE=1, GI_UNIT_SPECIALTEAMS=2, GI_UNIT_UNKNOWN=3, GI_UNIT_NUM=expr } m_unit; unsigned long m_age; float m_level; float m_QST[-1]; enum GI_INJURY { GI_INJURY_A=0, GI_INJURY_B=1, GI_INJURY_C=2, GI_INJURY_D=3, GI_INJURY_E=4, GI_INJURY_F=5, GI_INJURY_G=6, GI_INJURY_H=7, GI_INJURY_UNKNOWN=8, GI_INJURY_NUM=expr } m_injury; } m_squad[-1]; struct gi_Player *m_offence[-1]; struct gi_Player *m_defence[-1]; struct gi_Player *m_specialTeams[-1]; unsigned long m_usedPlayers[-1][-1]; unsigned long m_positionStarts[-1]; unsigned long m_positionCounts[-1]; char m_name[-1]; unsigned long m_numPlayers; unsigned long m_numOffence; unsigned long m_numDefence; unsigned long m_numSpecialTeams; } *


decompiled_code:
__int64 __fastcall gi_GlobalInfo_GetTeam(__int64 a1)
{
return a1 + 1242128;
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1)
{
return a1 + 1242128;
}

original_code:
const gi_Team* gi_GlobalInfo_GetTeam(const gi_GlobalInfo* const pThis)
{
 return &pThis->m_team;
}

canonical_original_code:
struct gi_Team *gi_GlobalInfo_GetTeam(struct gi_GlobalInfo *pThis)
{
 return &pThis->m_team;
}

variable_types: struct gi_GlobalInfo { struct gi_PlayInfo { unsigned long m_numOffencePlays; struct gi_OffencePlay { char m_name[-1]; char m_defence[-1][-1]; struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } m_base[-1]; struct gi_PositionValue m_bc[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numBC; unsigned long m_numWeighting; } m_offencePlays[-1]; float m_offenceStatsBase[-1][-1]; float m_offenceStatsBC[-1][-1]; unsigned long m_numDefencePlays; struct gi_DefencePlay { char m_name[-1]; char m_zone[-1]; struct gi_PositionValue m_base[-1]; struct gi_PositionValue m_tackler[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numTackler; unsigned long m_numWeighting; } m_defencePlays[-1]; float m_defenceStatsBase[-1][-1]; float m_defenceStatsTackler[-1][-1]; struct gi_SpecialTeamsValues { float m_protector; float m_blocker; float m_runner; float m_gunner; } m_specialTeamsValues[-1]; } m_playInfo; struct gi_Team m_team; } *

return_type: struct gi_Team { struct gi_Player { char m_name[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; unsigned long m_rawLevel; unsigned long m_rawQST[-1]; float m_experience; enum GI_UNIT { GI_UNIT_OFFENCE=0, GI_UNIT_DEFENCE=1, GI_UNIT_SPECIALTEAMS=2, GI_UNIT_UNKNOWN=3, GI_UNIT_NUM=expr } m_unit; unsigned long m_age; float m_level; float m_QST[-1]; enum GI_INJURY { GI_INJURY_A=0, GI_INJURY_B=1, GI_INJURY_C=2, GI_INJURY_D=3, GI_INJURY_E=4, GI_INJURY_F=5, GI_INJURY_G=6, GI_INJURY_H=7, GI_INJURY_UNKNOWN=8, GI_INJURY_NUM=expr } m_injury; } m_squad[-1]; struct gi_Player *m_offence[-1]; struct gi_Player *m_defence[-1]; struct gi_Player *m_specialTeams[-1]; unsigned long m_usedPlayers[-1][-1]; unsigned long m_positionStarts[-1]; unsigned long m_positionCounts[-1]; char m_name[-1]; unsigned long m_numPlayers; unsigned long m_numOffence; unsigned long m_numDefence; unsigned long m_numSpecialTeams; } *


decompiled_code:
__int64 __fastcall gi_GlobalInfo_GetPlayInfo(__int64 a1)
{
return a1;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1)
{
return a1;
}

original_code:
const gi_PlayInfo* gi_GlobalInfo_GetPlayInfo(const gi_GlobalInfo* const pThis)
{
 return &pThis->m_playInfo;
}

canonical_original_code:
struct gi_PlayInfo *gi_GlobalInfo_GetPlayInfo(struct gi_GlobalInfo *pThis)
{
 return &pThis->m_playInfo;
}

variable_types: struct gi_GlobalInfo { struct gi_PlayInfo m_playInfo; struct gi_Team { struct gi_Player { char m_name[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; unsigned long m_rawLevel; unsigned long m_rawQST[-1]; float m_experience; enum GI_UNIT { GI_UNIT_OFFENCE=0, GI_UNIT_DEFENCE=1, GI_UNIT_SPECIALTEAMS=2, GI_UNIT_UNKNOWN=3, GI_UNIT_NUM=expr } m_unit; unsigned long m_age; float m_level; float m_QST[-1]; enum GI_INJURY { GI_INJURY_A=0, GI_INJURY_B=1, GI_INJURY_C=2, GI_INJURY_D=3, GI_INJURY_E=4, GI_INJURY_F=5, GI_INJURY_G=6, GI_INJURY_H=7, GI_INJURY_UNKNOWN=8, GI_INJURY_NUM=expr } m_injury; } m_squad[-1]; struct gi_Player *m_offence[-1]; struct gi_Player *m_defence[-1]; struct gi_Player *m_specialTeams[-1]; unsigned long m_usedPlayers[-1][-1]; unsigned long m_positionStarts[-1]; unsigned long m_positionCounts[-1]; char m_name[-1]; unsigned long m_numPlayers; unsigned long m_numOffence; unsigned long m_numDefence; unsigned long m_numSpecialTeams; } m_team; } *

return_type: struct gi_PlayInfo { unsigned long m_numOffencePlays; struct gi_OffencePlay { char m_name[-1]; char m_defence[-1][-1]; struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } m_base[-1]; struct gi_PositionValue m_bc[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numBC; unsigned long m_numWeighting; } m_offencePlays[-1]; float m_offenceStatsBase[-1][-1]; float m_offenceStatsBC[-1][-1]; unsigned long m_numDefencePlays; struct gi_DefencePlay { char m_name[-1]; char m_zone[-1]; struct gi_PositionValue m_base[-1]; struct gi_PositionValue m_tackler[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numTackler; unsigned long m_numWeighting; } m_defencePlays[-1]; float m_defenceStatsBase[-1][-1]; float m_defenceStatsTackler[-1][-1]; struct gi_SpecialTeamsValues { float m_protector; float m_blocker; float m_runner; float m_gunner; } m_specialTeamsValues[-1]; } *


original_code:
void gi_PositionValue_Init(gi_PositionValue* const pThis)
{
 pThis->m_positionName[0] = '\0';
 pThis->m_position = GI_POSITION_UNKNOWN;
 pThis->m_basePosition = GI_POSITION_UNKNOWN;
 pThis->m_value.f = 0.0f;
 pThis->m_valueType = GI_TYPE_UNKNOWN;
}

canonical_original_code:
void gi_PositionValue_Init(struct gi_PositionValue *pThis)
{
 pThis->m_positionName[0] = '\0';
 pThis->m_position = GI_POSITION_UNKNOWN;
 pThis->m_basePosition = GI_POSITION_UNKNOWN;
 pThis->m_value.f = 0.0f;
 pThis->m_valueType = GI_TYPE_UNKNOWN;
}

variable_types: struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } *


decompiled_code:
__int64 __fastcall gi_PositionValue_GetPositionName(__int64 a1)
{
return a1;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1)
{
return a1;
}

original_code:
const char* gi_PositionValue_GetPositionName(const gi_PositionValue* const pThis)
{
 return pThis->m_positionName;
}

canonical_original_code:
char *gi_PositionValue_GetPositionName(struct gi_PositionValue *pThis)
{
 return pThis->m_positionName;
}

return_type: char *


decompiled_code:
__int64 __fastcall gi_PositionValue_GetPosition(__int64 a1)
{
return *(unsigned int *)(a1 + 8);
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1)
{
return *(unsigned int *)(a1 + 8);
}

original_code:
GI_POSITION gi_PositionValue_GetPosition(const gi_PositionValue* const pThis)
{
 return pThis->m_position;
}

canonical_original_code:
enum GI_POSITION gi_PositionValue_GetPosition(struct gi_PositionValue *pThis)
{
 return pThis->m_position;
}

return_type: enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr }


decompiled_code:
__int64 __fastcall gi_PositionValue_GetBasePosition(__int64 a1)
{
return *(unsigned int *)(a1 + 12);
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1)
{
return *(unsigned int *)(a1 + 12);
}

original_code:
GI_POSITION gi_PositionValue_GetBasePosition(const gi_PositionValue* const pThis)
{
 return pThis->m_basePosition;
}

canonical_original_code:
enum GI_POSITION gi_PositionValue_GetBasePosition(struct gi_PositionValue *pThis)
{
 return pThis->m_basePosition;
}


decompiled_code:
float __fastcall gi_PositionValue_GetFloatValue(__int64 a1)
{
return *(float *)(a1 + 16);
}

canonical_decompiled_code:
float __fastcall func6(__int64 a1)
{
return *(float *)(a1 + 16);
}

original_code:
float gi_PositionValue_GetFloatValue(const gi_PositionValue* const pThis)
{
 return pThis->m_value.f;
}

canonical_original_code:
float gi_PositionValue_GetFloatValue(struct gi_PositionValue *pThis)
{
 return pThis->m_value.f;
}

return_type: float


decompiled_code:
__int64 __fastcall gi_PositionValue_GetSizetValue(__int64 a1)
{
return *(_QWORD *)(a1 + 16);
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1)
{
return *(_QWORD *)(a1 + 16);
}

original_code:
size_t gi_PositionValue_GetSizetValue(const gi_PositionValue* const pThis)
{
 return pThis->m_value.i;
}

canonical_original_code:
unsigned long gi_PositionValue_GetSizetValue(struct gi_PositionValue *pThis)
{
 return pThis->m_value.i;
}

return_type: unsigned long


decompiled_code:
__int64 __fastcall gi_PositionValue_GetQST(__int64 a1)
{
return *(unsigned int *)(a1 + 24);
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1)
{
return *(unsigned int *)(a1 + 24);
}

original_code:
GI_QST gi_PositionValue_GetQST(const gi_PositionValue* const pThis)
{
 return pThis->m_qst;
}

canonical_original_code:
enum GI_QST gi_PositionValue_GetQST(struct gi_PositionValue *pThis)
{
 return pThis->m_qst;
}

return_type: enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr }


decompiled_code:
__int64 __fastcall gi_PositionValue_GetValueType(__int64 a1)
{
return *(unsigned int *)(a1 + 28);
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1)
{
return *(unsigned int *)(a1 + 28);
}

original_code:
GI_TYPE gi_PositionValue_GetValueType(const gi_PositionValue* const pThis)
{
 return pThis->m_valueType;
}

canonical_original_code:
enum GI_TYPE gi_PositionValue_GetValueType(struct gi_PositionValue *pThis)
{
 return pThis->m_valueType;
}

return_type: enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 }


decompiled_code:
__int64 __fastcall gi_OffencePlay_Init(__int64 a1)
{
_BYTE *v2; // rbx
_BYTE *v3; // rbp
_BYTE *v4; // rdi
__int64 result; // rax

v2 = (_BYTE *)(a1 + 16);
*(_BYTE *)a1 = 0;
do
{
*v2 = 0;
v2 += 16;
}
while ( v2 != (_BYTE *)(a1 + 528) );
v3 = (_BYTE *)(a1 + 1872);
do
{
gi_PositionValue_Init(v2);
gi_PositionValue_Init(v2 + 1344);
v4 = v2 + 2688;
v2 += 32;
result = gi_PositionValue_Init(v4);
}
while ( v2 != v3 );
*(_QWORD *)(a1 + 4560) = 0LL;
*(_QWORD *)(a1 + 4568) = 0LL;
*(_QWORD *)(a1 + 4576) = 0LL;
return result;
}

original_code:
void gi_OffencePlay_Init(gi_OffencePlay* const pThis)
{
 size_t i;
 pThis->m_name[0] = '\0';
 for (i = 0; i < (32); i++)
 {
  pThis->m_defence[i][0] = '\0';
 }
 for (i = 0; i < GI_POSITION_NUM; i++)
 {
  gi_PositionValue_Init(&pThis->m_base[i]);
  gi_PositionValue_Init(&pThis->m_bc[i]);
  gi_PositionValue_Init(&pThis->m_weighting[i]);
 }
 pThis->m_numBase = 0;
 pThis->m_numBC = 0;
 pThis->m_numWeighting = 0;
}

canonical_original_code:
void gi_OffencePlay_Init(struct gi_OffencePlay *pThis)
{
 unsigned long i;
 pThis->m_name[0] = '\0';
 for (i = 0; i < (32); i++)
 {
  pThis->m_defence[i][0] = '\0';
 }
 for (i = 0; i < GI_POSITION_NUM; i++)
 {
  gi_PositionValue_Init(&pThis->m_base[i]);
  gi_PositionValue_Init(&pThis->m_bc[i]);
  gi_PositionValue_Init(&pThis->m_weighting[i]);
 }
 pThis->m_numBase = 0;
 pThis->m_numBC = 0;
 pThis->m_numWeighting = 0;
}

variable_types: struct gi_OffencePlay { char m_name[-1]; char m_defence[-1][-1]; struct gi_PositionValue { char m_positionName[-1]; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_position; enum GI_POSITION { GI_POSITION_QB=0, GI_POSITION_RB=1, GI_POSITION_WR=2, GI_POSITION_TE=3, GI_POSITION_OC=4, GI_POSITION_OG=5, GI_POSITION_OT=6, GI_POSITION_DE=7, GI_POSITION_DT=8, GI_POSITION_IB=9, GI_POSITION_OB=10, GI_POSITION_CB=11, GI_POSITION_SF=12, GI_POSITION_R=13, GI_POSITION_K=14, GI_POSITION_P=15, GI_POSITION_SE=16, GI_POSITION_FL=17, GI_POSITION_RB1=18, GI_POSITION_RB2=19, GI_POSITION_TE1=20, GI_POSITION_TE2=21, GI_POSITION_LG=22, GI_POSITION_RG=23, GI_POSITION_LT=24, GI_POSITION_RT=25, GI_POSITION_HB=26, GI_POSITION_FB=27, GI_POSITION_FS=28, GI_POSITION_SS=29, GI_POSITION_C=30, GI_POSITION_NT=31, GI_POSITION_LE=32, GI_POSITION_RE=33, GI_POSITION_LILB=34, GI_POSITION_MILB=35, GI_POSITION_RILB=36, GI_POSITION_LOLB=37, GI_POSITION_ROLB=38, GI_POSITION_LCB=39, GI_POSITION_RCB=40, GI_POSITION_UNKNOWN=41, GI_POSITION_NUM=expr } m_basePosition; union PositionValue_Value { float f; unsigned long i; } m_value; enum GI_QST { GI_QST_Q=0, GI_QST_S=1, GI_QST_T=2, GI_QST_NONE=3, GI_QST_UNKNOWN=4, GI_QST_NUM=expr } m_qst; enum GI_TYPE { GI_TYPE_FLOAT=0, GI_TYPE_INT=1, GI_TYPE_UNKNOWN=2 } m_valueType; } m_base[-1]; struct gi_PositionValue m_bc[-1]; struct gi_PositionValue m_weighting[-1]; unsigned long m_numBase; unsigned long m_numBC; unsigned long m_numWeighting; } *

variable_types:
i
unsigned long