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

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

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

result = func4(a1);
if ( result )
result = gi_LoggerChannel_SetFlags(result, a2);
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: channel int

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

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

return_type: void


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 a2)
{
__int64 result; // rax

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

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

result = func4(a1);
if ( result )
result = gi_LoggerChannel_SetOutputFileName(result, a2);
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; // rbx
gcc_va_list va; // [rsp+8h] [rbp-E0h] BYREF

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

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

va_start(va, a1);
v1 = func4(0);
func3();
if ( v1 )
gi_LoggerChannel_InternalOutput(v1, a1, 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; // rbx
gcc_va_list va; // [rsp+8h] [rbp-E0h] BYREF

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

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

va_start(va, a1);
v1 = func4(1u);
func3();
if ( v1 )
gi_LoggerChannel_InternalOutput(v1, a1, 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:
__int64 gi_Logger_Warning(__int64 a1, ...)
{
__int64 result; // rax
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
result = gi_Logger_GetDefaultChannel(2u);
if ( result )
result = gi_LoggerChannel_InternalOutput(result, a1, va);
return result;
}

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

va_start(va, a1);
result = func4(2u);
if ( result )
result = gi_LoggerChannel_InternalOutput(result, a1, 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:
__int64 gi_Logger_Log(__int64 a1, ...)
{
__int64 result; // rax
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
result = gi_Logger_GetDefaultChannel(3u);
if ( result )
result = gi_LoggerChannel_InternalOutput(result, a1, va);
return result;
}

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

va_start(va, a1);
result = func4(3u);
if ( result )
result = gi_LoggerChannel_InternalOutput(result, a1, 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 v6; // rbx
void *v7; // r15

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

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

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

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

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


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

result = malloc(0x400uLL);
s_channelPtrs = (__int64)result;
if ( result )
{
memset(result, 0, 0x400uLL);
s_defaultChannels[0] = 0LL;
s_defaultChannels[1] = 0LL;
s_defaultChannels[2] = 0LL;
s_defaultChannels[3] = 0LL;
s_defaultChannels[0] = (__int64)gi_Logger_CreateChannel(
(__int64)"FATAL_ERROR",
(__int64)"FATAL_ERROR: ",
(__int64)"log.txt",
7LL);
s_defaultChannels[1] = (__int64)gi_Logger_CreateChannel(
(__int64)"ERROR",
(__int64)"ERROR: ",
(__int64)"log.txt",
6LL);
s_defaultChannels[2] = (__int64)gi_Logger_CreateChannel(
(__int64)"WARNING",
(__int64)"WARNING: ",
(__int64)"log.txt",
6LL);
result = gi_Logger_CreateChannel((__int64)"LOG", (__int64)&unk_58A, (__int64)"log.txt", 6LL);
s_defaultChannels[3] = (__int64)result;
}
return result;
}

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

result = malloc(0x400uLL);
s_channelPtrs = (__int64)result;
if ( result )
{
memset(result, 0, 0x400uLL);
s_defaultChannels[0] = 0LL;
s_defaultChannels[1] = 0LL;
s_defaultChannels[2] = 0LL;
s_defaultChannels[3] = 0LL;
s_defaultChannels[0] = (__int64)func15(
(__int64)"FATAL_ERROR",
(__int64)"FATAL_ERROR: ",
(__int64)"log.txt",
7LL);
s_defaultChannels[1] = (__int64)func15(
(__int64)"ERROR",
(__int64)"ERROR: ",
(__int64)"log.txt",
6LL);
s_defaultChannels[2] = (__int64)func15(
(__int64)"WARNING",
(__int64)"WARNING: ",
(__int64)"log.txt",
6LL);
result = func15((__int64)"LOG", (__int64)&unk_58A, (__int64)"log.txt", 6LL);
s_defaultChannels[3] = (__int64)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 v1; // rbx
__int64 result; // rax

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

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
__int64 v1; // rbx
__int64 result; // rax

*(_BYTE *)a1 = 0;
*(_BYTE *)(a1 + 16) = 0;
v1 = a1 + 32;
do
{
gi_PositionValue_Init(v1);
gi_PositionValue_Init(v1 + 1344);
result = gi_PositionValue_Init(v1 + 2688);
v1 += 32LL;
}
while ( v1 != a1 + 1376 );
*(_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)
{
__int64 v4; // rbx
unsigned __int64 v5; // rbp
float v7; // [rsp+8h] [rbp-40h]
float v8; // [rsp+Ch] [rbp-3Ch]

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

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

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

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

return_type: 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;
}

return_type: char *

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: 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;
}


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 v3; // rdx
unsigned int v4; // ecx
__int64 *v5; // rdi

v3 = *a1;
v4 = 0;
if ( (unsigned __int64)*a1 <= 0x7F )
{
v5 = &a1[573 * v3];
v5[1] = *(_QWORD *)a2;
v5[573] = *((_QWORD *)a2 + 572);
qmemcpy(
(void *)((unsigned __int64)(v5 + 2) & 0xFFFFFFFFFFFFFFF8LL),
(const void *)(a2 - ((char *)v5 - ((unsigned __int64)(v5 + 2) & 0xFFFFFFFFFFFFFFF8LL) + 8)),
8LL * (((_DWORD)v5 + 8 - (((_DWORD)v5 + 16) & 0xFFFFFFF8) + 4584) >> 3));
*a1 = v3 + 1;
v4 = 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; } *

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; }

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; }


decompiled_code:
__int64 __fastcall gi_GlobalInfo_AddTeam(__int64 a1, const void *a2)
{
_BYTE *v2; // rdx
__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; // rdx
__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 *

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 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:
__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;
}


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;
}


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 *v1; // rax
__int64 v2; // rbx
__int64 result; // rax

*(_BYTE *)a1 = 0;
v1 = (_BYTE *)(a1 + 16);
do
{
*v1 = 0;
v1 += 16;
}
while ( v1 != (_BYTE *)(a1 + 528) );
v2 = a1 + 528;
do
{
gi_PositionValue_Init(v2);
gi_PositionValue_Init(v2 + 1344);
result = gi_PositionValue_Init(v2 + 2688);
v2 += 32LL;
}
while ( v2 != a1 + 1872 );
*(_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


decompiled_code:
float __fastcall gi_OffencePlay_ComputeBase(__int64 a1, int a2, __int64 a3)
{
__int64 v4; // rbx
unsigned __int64 v5; // rbp
float v7; // [rsp+8h] [rbp-40h]
float v8; // [rsp+Ch] [rbp-3Ch]

if ( !*(_QWORD *)(a1 + 4560) )
return 0.0;
v4 = a1 + 528;
v7 = 0.0;
v5 = 0LL;
do
{
if ( (unsigned int)gi_PositionValue_GetBasePosition(v4) == a2 && !(unsigned int)gi_PositionValue_GetValueType(v4) )
{
v8 = *(float *)(a3 + 4LL * (unsigned int)gi_PositionValue_GetQST(v4));
v7 = (float)(gi_PositionValue_GetFloatValue(v4) * v8) + v7;
}
++v5;
v4 += 32LL;
}
while ( *(_QWORD *)(a1 + 4560) > v5 );
return v7;
}

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

if ( !*(_QWORD *)(a1 + 4560) )
return 0.0;
v4 = a1 + 528;
v7 = 0.0;
v5 = 0LL;
do
{
if ( (unsigned int)gi_PositionValue_GetBasePosition(v4) == a2 && !(unsigned int)gi_PositionValue_GetValueType(v4) )
{
v8 = *(float *)(a3 + 4LL * (unsigned int)gi_PositionValue_GetQST(v4));
v7 = (float)(gi_PositionValue_GetFloatValue(v4) * v8) + v7;
}
++v5;
v4 += 32LL;
}
while ( *(_QWORD *)(a1 + 4560) > v5 );
return v7;
}

original_code:
float gi_OffencePlay_ComputeBase(const gi_OffencePlay* 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_OffencePlay_ComputeBase(struct gi_OffencePlay *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: 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 }

variable_types:
playerQST
float *

variable_types: baseValue float

variable_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 }

variable_types: playerStat float


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

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

original_code:
const char* gi_OffencePlay_GetName(const gi_OffencePlay* const pThis)
{
 return pThis->m_name;
}

canonical_original_code:
char *gi_OffencePlay_GetName(struct gi_OffencePlay *pThis)
{
 return pThis->m_name;
}


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

original_code:
const char* gi_OffencePlay_GetDefence(const gi_OffencePlay* const pThis, const size_t defenceIndex)
{
 return pThis->m_defence[defenceIndex];
}

canonical_original_code:
char *gi_OffencePlay_GetDefence(struct gi_OffencePlay *pThis, unsigned long defenceIndex)
{
 return pThis->m_defence[defenceIndex];
}

variable_types:
defenceIndex
unsigned long


decompiled_code:
void __fastcall BlockAllocator_Destroy(_QWORD *a1)
{
_QWORD *v2; // rbx
void *v3; // rdi

v2 = (_QWORD *)*a1;
if ( *a1 )
{
do
{
v3 = v2;
v2 = (_QWORD *)v2[3];
free(v3);
*a1 = v2;
}
while ( v2 );
}
}

canonical_decompiled_code:
void __fastcall func1(_QWORD *a1)
{
_QWORD *v2; // rbx
void *v3; // rdi

v2 = (_QWORD *)*a1;
if ( *a1 )
{
do
{
v3 = v2;
v2 = (_QWORD *)v2[3];
free(v3);
*a1 = v2;
}
while ( v2 );
}
}

original_code:
void BlockAllocator_Destroy(BlockAllocator* const pThis)
{
 while (pThis->m_head)
 {
  Block* const temp = pThis->m_head->m_next;
  free(pThis->m_head);
  pThis->m_head = temp;
 }
}

canonical_original_code:
void BlockAllocator_Destroy(struct BlockAllocator *pThis)
{
 while (pThis->m_head)
 {
  struct Block *temp = pThis->m_head->m_next;
  free(pThis->m_head);
  pThis->m_head = temp;
 }
}

variable_types: struct BlockAllocator { struct Block { unsigned long m_size; unsigned long m_used; char *m_buffer; struct Block *m_next; } *m_head; unsigned long m_blocksize; } *

user_defined_types: struct BlockAllocator { struct Block *m_head; unsigned long m_blocksize; }


decompiled_code:
void __fastcall BlockAllocator_Free(__int64 *a1)
{
__int64 v1[3]; // [rsp+0h] [rbp-18h] BYREF

v1[1] = a1[1];
v1[0] = *a1;
a1[1] = 0LL;
*a1 = 0LL;
BlockAllocator_Destroy(v1);
}

original_code:
void BlockAllocator_Free(BlockAllocator* const pThis)
{
 BlockAllocator temp;
 temp.m_blocksize = pThis->m_blocksize;
 temp.m_head = pThis->m_head;
 pThis->m_blocksize = 0;
 pThis->m_head = ((void *)0);
 BlockAllocator_Destroy(&temp);
}

canonical_original_code:
void BlockAllocator_Free(struct BlockAllocator *pThis)
{
 struct BlockAllocator temp;
 temp.m_blocksize = pThis->m_blocksize;
 temp.m_head = pThis->m_head;
 pThis->m_blocksize = 0;
 pThis->m_head = ((void *)0);
 BlockAllocator_Destroy(&temp);
}

variable_types: struct BlockAllocator { struct Block { unsigned long m_size; unsigned long m_used; char *m_buffer; struct Block *m_next; } *m_head; unsigned long m_blocksize; }


original_code:
void* BlockAllocator_Malloc(BlockAllocator* const pThis, const size_t size)
{
 void* ptr;
 if ((pThis->m_head && pThis->m_head->m_used + size > pThis->m_head->m_size) || !pThis->m_head)
 {
  size_t alloc_size = ((sizeof(Block) + size) > pThis->m_blocksize) ? (sizeof(Block) + size) : pThis->m_blocksize;
  char* buffer = (char*)malloc(alloc_size);
  Block* b = (Block*)(buffer);
  b->m_size = alloc_size;
  b->m_used = sizeof(Block);
  b->m_buffer = buffer;
  b->m_next = pThis->m_head;
  pThis->m_head = b;
 }
 ptr = pThis->m_head->m_buffer + pThis->m_head->m_used;
 pThis->m_head->m_used += size;
 return ptr;
}

canonical_original_code:
void *BlockAllocator_Malloc(struct BlockAllocator *pThis, unsigned long size)
{
 void *ptr;
 if ((pThis->m_head && pThis->m_head->m_used + size > pThis->m_head->m_size) || !pThis->m_head)
 {
  unsigned long alloc_size = ((sizeof(Block) + size) > pThis->m_blocksize) ? (sizeof(Block) + size) : pThis->m_blocksize;
  char *buffer = (char*)malloc(alloc_size);
  struct Block *b = (Block*)(buffer);
  b->m_size = alloc_size;
  b->m_used = sizeof(Block);
  b->m_buffer = buffer;
  b->m_next = pThis->m_head;
  pThis->m_head = b;
 }
 ptr = pThis->m_head->m_buffer + pThis->m_head->m_used;
 pThis->m_head->m_used += size;
 return ptr;
}

variable_types:
size
unsigned long

variable_types:
ptr
void *

variable_types:
buffer
char *

variable_types: struct Block { unsigned long m_size; unsigned long m_used; char *m_buffer; struct Block *m_next; } *

return_type: void *


decompiled_code:
_BOOL8 __fastcall SizetItem_CompareSmaller(_QWORD *a1, _QWORD *a2)
{
return *a1 < *a2;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(_QWORD *a1, _QWORD *a2)
{
return *a1 < *a2;
}

original_code:
int SizetItem_CompareSmaller(const void* a, const void* b)
{
 const size_t valueA = ((const SizetItem*)a)->m_value;
 const size_t valueB = ((const SizetItem*)b)->m_value;
 return (valueA < valueB);
}

canonical_original_code:
int SizetItem_CompareSmaller(void *a, void *b)
{
 unsigned long valueA = ((const SizetItem*)a)->m_value;
 unsigned long valueB = ((const SizetItem*)b)->m_value;
 return (valueA < valueB);
}

variable_types:
a
void *

variable_types:
b
void *

variable_types:
valueA
unsigned long

variable_types:
valueB
unsigned long

return_type: int


decompiled_code:
_BOOL8 __fastcall SizetItem_CompareBigger(_QWORD *a1, _QWORD *a2)
{
return *a1 > *a2;
}

canonical_decompiled_code:
_BOOL8 __fastcall func1(_QWORD *a1, _QWORD *a2)
{
return *a1 > *a2;
}

original_code:
int SizetItem_CompareBigger(const void* a, const void* b)
{
 const size_t valueA = ((const SizetItem*)a)->m_value;
 const size_t valueB = ((const SizetItem*)b)->m_value;
 return (valueA > valueB);
}

canonical_original_code:
int SizetItem_CompareBigger(void *a, void *b)
{
 unsigned long valueA = ((const SizetItem*)a)->m_value;
 unsigned long valueB = ((const SizetItem*)b)->m_value;
 return (valueA > valueB);
}


decompiled_code:
_BOOL8 __fastcall FloatItem_CompareSmaller(float *a1, float *a2)
{
return *a2 > *a1;
}

canonical_decompiled_code:
_BOOL8 __fastcall func2(float *a1, float *a2)
{
return *a2 > *a1;
}

original_code:
int FloatItem_CompareSmaller(const void* a, const void* b)
{
 const float valueA = ((const FloatItem*)a)->m_value;
 const float valueB = ((const FloatItem*)b)->m_value;
 return (valueA < valueB);
}

canonical_original_code:
int FloatItem_CompareSmaller(void *a, void *b)
{
 float valueA = ((const FloatItem*)a)->m_value;
 float valueB = ((const FloatItem*)b)->m_value;
 return (valueA < valueB);
}

variable_types: valueA float

variable_types: valueB float


decompiled_code:
_BOOL8 __fastcall FloatItem_CompareBigger(float *a1, float *a2)
{
return *a1 > *a2;
}

canonical_decompiled_code:
_BOOL8 __fastcall func3(float *a1, float *a2)
{
return *a1 > *a2;
}

original_code:
int FloatItem_CompareBigger(const void* a, const void* b)
{
 const float valueA = ((const FloatItem*)a)->m_value;
 const float valueB = ((const FloatItem*)b)->m_value;
 return (valueA > valueB);
}

canonical_original_code:
int FloatItem_CompareBigger(void *a, void *b)
{
 float valueA = ((const FloatItem*)a)->m_value;
 float valueB = ((const FloatItem*)b)->m_value;
 return (valueA > valueB);
}


decompiled_code:
float __fastcall gi_SpecialTeamsValues_GetProtector(__int64 a1)
{
return *(float *)a1;
}

canonical_decompiled_code:
float __fastcall func2(__int64 a1)
{
return *(float *)a1;
}

original_code:
float gi_SpecialTeamsValues_GetProtector(const gi_SpecialTeamsValues* const pThis)
{
 return pThis->m_protector;
}

canonical_original_code:
float gi_SpecialTeamsValues_GetProtector(struct gi_SpecialTeamsValues *pThis)
{
 return pThis->m_protector;
}

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


decompiled_code:
float __fastcall gi_SpecialTeamsValues_GetBlocker(__int64 a1)
{
return *(float *)(a1 + 4);
}

canonical_decompiled_code:
float __fastcall func3(__int64 a1)
{
return *(float *)(a1 + 4);
}

original_code:
float gi_SpecialTeamsValues_GetBlocker(const gi_SpecialTeamsValues* const pThis)
{
 return pThis->m_blocker;
}

canonical_original_code:
float gi_SpecialTeamsValues_GetBlocker(struct gi_SpecialTeamsValues *pThis)
{
 return pThis->m_blocker;
}


decompiled_code:
float __fastcall gi_SpecialTeamsValues_GetRunner(__int64 a1)
{
return *(float *)(a1 + 8);
}

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

original_code:
float gi_SpecialTeamsValues_GetRunner(const gi_SpecialTeamsValues* const pThis)
{
 return pThis->m_runner;
}

canonical_original_code:
float gi_SpecialTeamsValues_GetRunner(struct gi_SpecialTeamsValues *pThis)
{
 return pThis->m_runner;
}


decompiled_code:
float __fastcall gi_SpecialTeamsValues_GetGunner(__int64 a1)
{
return *(float *)(a1 + 12);
}

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

original_code:
float gi_SpecialTeamsValues_GetGunner(const gi_SpecialTeamsValues* const pThis)
{
 return pThis->m_gunner;
}

canonical_original_code:
float gi_SpecialTeamsValues_GetGunner(struct gi_SpecialTeamsValues *pThis)
{
 return pThis->m_gunner;
}


matrixFree

original_code:
void matrixFree(NtscMatrix* const ntscMatrix)
{
 unsigned int i;
 const unsigned int numRows = ntscMatrix->m_numRows;
 float** const matrix = ntscMatrix->m_matrix;
 for (i = 0; i < numRows; i++)
 {
  free(matrix[i]);
 }
 free(matrix);
 ntscMatrix->m_matrix = ((void *)0);
 ntscMatrix->m_numRows = 0;
 ntscMatrix->m_numCols = 0;
}

canonical_original_code:
void matrixFree(struct NtscMatrix *ntscMatrix)
{
 unsigned int i;
 unsigned int numRows = ntscMatrix->m_numRows;
 float **matrix = ntscMatrix->m_matrix;
 for (i = 0; i < numRows; i++)
 {
  free(matrix[i]);
 }
 free(matrix);
 ntscMatrix->m_matrix = ((void *)0);
 ntscMatrix->m_numRows = 0;
 ntscMatrix->m_numCols = 0;
}

variable_types: struct NtscMatrix { float **m_matrix; unsigned int m_numRows; unsigned int m_numCols; char *m_name; } *

variable_types:
i
unsigned int

variable_types:
numRows
unsigned int

variable_types:
matrix
float **


matrixMultiply

decompiled_code:
__int64 __fastcall matrixMultiply(__int64 a1, __int64 a2, __int64 *a3)
{
__int64 result; // rax
__int64 v5; // r8
int v6; // ebx
unsigned int v7; // ebp
_QWORD *v8; // rdi
__int64 v9; // r10
__int64 v10; // r9
__int64 v11; // r9
__int64 v12; // r9
__int64 *v13; // r11
__int64 v14; // r12
__int64 v15; // r9
__int64 v16; // rcx

result = a2;
v5 = *(unsigned int *)(a2 + 8);
v6 = *(_DWORD *)(a2 + 12);
v7 = *((_DWORD *)a3 + 3);
v8 = *(_QWORD **)a2;
v9 = *a3;
v10 = *(unsigned int *)(a1 + 8);
if ( (_DWORD)v10 != (_DWORD)v5 )
{
fprintf(
stderr,
"ERROR: matrixMultiply: left:'%s' result:'%s' numRowsLeft != numRowsResult %d != %d\n",
*(const char **)(a2 + 16),
*(const char **)(a1 + 16),
v5,
v10);
exit(-1);
}
v11 = *(unsigned int *)(a1 + 12);
if ( (_DWORD)v11 != v7 )
{
fprintf(
stderr,
"ERROR: matrixMultiply: right:'%s' result:'%s' numColsRight != numColsResult %d != %d\n",
(const char *)a3[2],
*(const char **)(a1 + 16),
v7,
v11);
exit(-1);
}
v12 = *((unsigned int *)a3 + 2);
if ( (_DWORD)v12 != v6 )
{
fprintf(
stderr,
"ERROR: matrixMultiply: left:'%s' right:'%s' numColsLeft != numRowsRight %d != %d\n",
*(const char **)(a2 + 16),
(const char *)a3[2],
v5,
v12);
exit(-1);
}
if ( (_DWORD)v5 )
{
v13 = *(__int64 **)a1;
v14 = *(_QWORD *)a1 + 8LL * (unsigned int)(v5 - 1) + 8;
result = (unsigned int)(v6 - 1);
v15 = 4 * result + 4;
do
{
v16 = 0LL;
if ( v7 )
{
do
{
result = *v13;
*(_DWORD *)(*v13 + v16) = 0;
if ( v6 )
{
result = 0LL;
do
{
*(float *)(*v13 + v16) = (float)(*(float *)(*v8 + result) * *(float *)(*(_QWORD *)(v9 + 2 * result) + v16))
+ *(float *)(*v13 + v16);
result += 4LL;
}
while ( v15 != result );
}
v16 += 4LL;
}
while ( v16 != 4LL * (v7 - 1) + 4 );
}
++v13;
++v8;
}
while ( v13 != (__int64 *)v14 );
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, __int64 a2, __int64 *a3)
{
__int64 result; // rax
__int64 v5; // r8
int v6; // ebx
unsigned int v7; // ebp
_QWORD *v8; // rdi
__int64 v9; // r10
__int64 v10; // r9
__int64 v11; // r9
__int64 v12; // r9
__int64 *v13; // r11
__int64 v14; // r12
__int64 v15; // r9
__int64 v16; // rcx

result = a2;
v5 = *(unsigned int *)(a2 + 8);
v6 = *(_DWORD *)(a2 + 12);
v7 = *((_DWORD *)a3 + 3);
v8 = *(_QWORD **)a2;
v9 = *a3;
v10 = *(unsigned int *)(a1 + 8);
if ( (_DWORD)v10 != (_DWORD)v5 )
{
fprintf(
stderr,
"ERROR: matrixMultiply: left:'%s' result:'%s' numRowsLeft != numRowsResult %d != %d\n",
*(const char **)(a2 + 16),
*(const char **)(a1 + 16),
v5,
v10);
exit(-1);
}
v11 = *(unsigned int *)(a1 + 12);
if ( (_DWORD)v11 != v7 )
{
fprintf(
stderr,
"ERROR: matrixMultiply: right:'%s' result:'%s' numColsRight != numColsResult %d != %d\n",
(const char *)a3[2],
*(const char **)(a1 + 16),
v7,
v11);
exit(-1);
}
v12 = *((unsigned int *)a3 + 2);
if ( (_DWORD)v12 != v6 )
{
fprintf(
stderr,
"ERROR: matrixMultiply: left:'%s' right:'%s' numColsLeft != numRowsRight %d != %d\n",
*(const char **)(a2 + 16),
(const char *)a3[2],
v5,
v12);
exit(-1);
}
if ( (_DWORD)v5 )
{
v13 = *(__int64 **)a1;
v14 = *(_QWORD *)a1 + 8LL * (unsigned int)(v5 - 1) + 8;
result = (unsigned int)(v6 - 1);
v15 = 4 * result + 4;
do
{
v16 = 0LL;
if ( v7 )
{
do
{
result = *v13;
*(_DWORD *)(*v13 + v16) = 0;
if ( v6 )
{
result = 0LL;
do
{
*(float *)(*v13 + v16) = (float)(*(float *)(*v8 + result) * *(float *)(*(_QWORD *)(v9 + 2 * result) + v16))
+ *(float *)(*v13 + v16);
result += 4LL;
}
while ( v15 != result );
}
v16 += 4LL;
}
while ( v16 != 4LL * (v7 - 1) + 4 );
}
++v13;
++v8;
}
while ( v13 != (__int64 *)v14 );
}
return result;
}

original_code:
void matrixMultiply(NtscMatrix* const ntscResult, const NtscMatrix* const ntscLeft, const NtscMatrix* const ntscRight)
{
 unsigned int i;
 const unsigned int numRowsLeft = ntscLeft->m_numRows;
 const unsigned int numColsLeft = ntscLeft->m_numCols;
 const unsigned int numColsRight = ntscRight->m_numCols;
 const float** const left = (const float** const)ntscLeft->m_matrix;
 const float** const right = (const float** const)ntscRight->m_matrix;
 float** const result = ntscResult->m_matrix;
 if (numRowsLeft != ntscResult->m_numRows)
 {
  fprintf(stderr,"ERROR: matrixMultiply: left:'%s' result:'%s' numRowsLeft != numRowsResult %d != %d\n",
      ntscLeft->m_name, ntscResult->m_name, numRowsLeft, ntscResult->m_numRows);
  exit(-1);
 }
 if (numColsRight != ntscResult->m_numCols)
 {
  fprintf(stderr,"ERROR: matrixMultiply: right:'%s' result:'%s' numColsRight != numColsResult %d != %d\n",
      ntscRight->m_name, ntscResult->m_name, numColsRight, ntscResult->m_numCols);
  exit(-1);
 }
 if (numColsLeft != ntscRight->m_numRows)
 {
  fprintf(stderr,"ERROR: matrixMultiply: left:'%s' right:'%s' numColsLeft != numRowsRight %d != %d\n",
      ntscLeft->m_name, ntscRight->m_name, numRowsLeft, ntscRight->m_numRows);
  exit(-1);
 }
 for (i = 0; i < numRowsLeft; i++)
 {
  unsigned int j;
  for (j = 0; j < numColsRight; j++)
  {
   unsigned int k;
   result[i][j] = 0.0f;
   for (k = 0; k < numColsLeft; k++)
   {
    result[i][j] += left[i][k] * right[k][j];
   }
  }
 }
}

canonical_original_code:
void matrixMultiply(struct NtscMatrix *ntscResult, struct NtscMatrix *ntscLeft, struct NtscMatrix *ntscRight)
{
 unsigned int i;
 unsigned int numRowsLeft = ntscLeft->m_numRows;
 unsigned int numColsLeft = ntscLeft->m_numCols;
 unsigned int numColsRight = ntscRight->m_numCols;
 float **left = (const float** const)ntscLeft->m_matrix;
 float **right = (const float** const)ntscRight->m_matrix;
 float **result = ntscResult->m_matrix;
 if (numRowsLeft != ntscResult->m_numRows)
 {
  fprintf(stderr,"ERROR: matrixMultiply: left:'%s' result:'%s' numRowsLeft != numRowsResult %d != %d\n",
      ntscLeft->m_name, ntscResult->m_name, numRowsLeft, ntscResult->m_numRows);
  exit(-1);
 }
 if (numColsRight != ntscResult->m_numCols)
 {
  fprintf(stderr,"ERROR: matrixMultiply: right:'%s' result:'%s' numColsRight != numColsResult %d != %d\n",
      ntscRight->m_name, ntscResult->m_name, numColsRight, ntscResult->m_numCols);
  exit(-1);
 }
 if (numColsLeft != ntscRight->m_numRows)
 {
  fprintf(stderr,"ERROR: matrixMultiply: left:'%s' right:'%s' numColsLeft != numRowsRight %d != %d\n",
      ntscLeft->m_name, ntscRight->m_name, numRowsLeft, ntscRight->m_numRows);
  exit(-1);
 }
 for (i = 0; i < numRowsLeft; i++)
 {
  unsigned int j;
  for (j = 0; j < numColsRight; j++)
  {
   unsigned int k;
   result[i][j] = 0.0f;
   for (k = 0; k < numColsLeft; k++)
   {
    result[i][j] += left[i][k] * right[k][j];
   }
  }
 }
}

variable_types:
ntscLeft
struct NtscMatrix *

variable_types:
ntscRight
struct NtscMatrix *

variable_types:
numRowsLeft
unsigned int

variable_types:
numColsLeft
unsigned int

variable_types:
numColsRight
unsigned int

variable_types:
left
float **

variable_types:
right
float **

variable_types:
result
float **

variable_types:
j
unsigned int

variable_types:
k
unsigned int

user_defined_types: struct NtscMatrix { float **m_matrix; unsigned int m_numRows; unsigned int m_numCols; char *m_name; }


repo: Zuckonit/callmewash

decompiled_code:
_BOOL8 __fastcall file_exist(const char *a1)
{
return access(a1, 0) != -1;
}

canonical_decompiled_code:
_BOOL8 __fastcall func9(const char *a1)
{
return access(a1, 0) != -1;
}

original_code:
int file_exist(const char *p)
{
    return (access(p, 0) == -1) ? 0 : 1;
}

canonical_original_code:
int file_exist(char *p)
{
    return (access(p, 0) == -1) ? 0 : 1;
}

variable_types:
p
char *