#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA678_F31E_F31J_X31J_P31J_SU1E_AU1E_AU2E_AU3E
#ifdef MEDIA772_SU1E
void F7053_FreeGame(register GAME* P3713_ps_, int16_t P5923_)
#endif
#ifdef MEDIA676_F31E_F31J_X31J_P31J_AU1E_AU2E_AU3E
void F7053_FreeGame(REGISTER GAME* P3713_ps_)
#endif
{
        REGISTER int16_t L3954_i_;


        if (P3713_ps_->ActiveGroups) {
                F7024_Free(P3713_ps_->ActiveGroups);
        }
        P3713_ps_->ActiveGroups = NULL;
        if (P3713_ps_->Events) {
                F7024_Free(P3713_ps_->Events);
        }
        P3713_ps_->Events = NULL;
        if (P3713_ps_->TimeLine) {
                F7024_Free(P3713_ps_->TimeLine);
        }
        P3713_ps_->TimeLine = NULL;
        if (P3713_ps_->Dungeon.TextData) {
                F7024_Free(P3713_ps_->Dungeon.TextData);
        }
        P3713_ps_->Dungeon.TextData = NULL;
        if (P3713_ps_->Dungeon.RawMapData) {
                F7024_Free(P3713_ps_->Dungeon.RawMapData);
        }
        P3713_ps_->Dungeon.RawMapData = NULL;
        if (P3713_ps_->Dungeon.Maps) {
                F7024_Free(P3713_ps_->Dungeon.Maps);
        }
        P3713_ps_->Dungeon.Maps = NULL;
        if (P3713_ps_->Dungeon.Header) {
                F7024_Free(P3713_ps_->Dungeon.Header);
        }
        P3713_ps_->Dungeon.Header = NULL;
        if (P3713_ps_->Dungeon.ColumnsCumulativeSquareThingCount) {
                F7024_Free(P3713_ps_->Dungeon.ColumnsCumulativeSquareThingCount);
        }
        P3713_ps_->Dungeon.ColumnsCumulativeSquareThingCount = NULL;
        if (P3713_ps_->Dungeon.MapsFirstColumnIndex) {
                F7024_Free(P3713_ps_->Dungeon.MapsFirstColumnIndex);
        }
        P3713_ps_->Dungeon.MapsFirstColumnIndex = NULL;
        if (P3713_ps_->Dungeon.SquareFirstThings) {
                F7024_Free(P3713_ps_->Dungeon.SquareFirstThings);
        }
        P3713_ps_->Dungeon.SquareFirstThings = NULL;
        for (L3954_i_ = 0; L3954_i_ < 16; L3954_i_++) {
                if (P3713_ps_->Dungeon.ThingData[L3954_i_]) {
                        F7024_Free(P3713_ps_->Dungeon.ThingData[L3954_i_]);
                }
                P3713_ps_->Dungeon.ThingData[L3954_i_] = NULL;
        }
#ifdef MEDIA772_SU1E
        if (P5923_ == 0) {
                G7114_LoadedChampionCount = 0;
        }
#endif
#ifdef MEDIA676_F31E_F31J_X31J_P31J_AU1E_AU2E_AU3E
        if (P3713_ps_->Champions) {
                F7024_Free(P3713_ps_->Champions);
        }
        P3713_ps_->Champions = NULL;
        if (P3713_ps_->Portraits) {
                F7024_Free(P3713_ps_->Portraits);
        }
        P3713_ps_->Portraits = NULL;
#endif
        P3713_ps_->GameLoaded = C0_FALSE;
}
#endif
