
// ========================================================================
// ?DeactivateGuis@idPlayer@@QAAXXZ
// EA  : 0x82E5B170
// RVA : 0x00E5B170
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::DeactivateGuis(idPlayer *this)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v2; // r3

  presentable = this->presentable;
  if ( presentable != nullptr )
  {
    v2 = presentable->GetPlayerInterface_2(this: presentable);
    idPresentablePlayer::DeactivateGuis(this: v2);
  }
  else
  {
    idPresentablePlayer::DeactivateGuis(this: nullptr);
  }
}


// ========================================================================
// ?ReallyHandleGuiEvent@idPlayer@@QAA_NPBUsysEvent_t@@@Z
// EA  : 0x82E5B1C8
// RVA : 0x00E5B1C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

int __fastcall idPlayer::ReallyHandleGuiEvent(idPlayer *this, const sysEvent_t *ev)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v5; // r3
  idPresentable *v6; // r3
  bool v7; // zf
  idPresentablePlayer *v8; // r3
  idSWF *PlayerGui; // r3
  idPresentablePlayer *v11; // r3
  idPresentable *v12; // r3
  idPresentablePlayer *v13; // r3
  idPresentablePlayer::playerGuis_t v14; // r31
  idPresentable *v15; // r3
  idPresentablePlayer *v16; // r3
  idPresentable *v17; // r3
  idPresentablePlayer *v18; // r3
  idSWF *v19; // r3

  if ( gameLocal->GetGamePaused(this: gameLocal) )
  {
    if ( (unsigned __int8)idMainMenu::IsActive(this: gameLocal->mainMenu) == 0 )
    {
      presentable = this->presentable;
      if ( presentable != nullptr )
        v5 = presentable->GetPlayerInterface_2(this: presentable);
      else
        v5 = nullptr;
      v7 = !idPresentablePlayer::GuiIsActive(this: v5, g: GUI_INVENTORY);
      v6 = this->presentable;
      if ( !v7 )
      {
        if ( v6 != nullptr )
        {
          v8 = v6->GetPlayerInterface_2(this: v6);
          PlayerGui = idPresentablePlayer::GetPlayerGui(this: v8, g: GUI_INVENTORY);
        }
        else
        {
          PlayerGui = idPresentablePlayer::GetPlayerGui(this: nullptr, g: GUI_INVENTORY);
        }
        return idSWF::HandleEvent(this: PlayerGui, event: ev);
      }
      if ( v6 != nullptr )
        v11 = v6->GetPlayerInterface_2(this: v6);
      else
        v11 = nullptr;
      if ( idPresentablePlayer::GuiIsActive(this: v11, g: GUI_TUTORIAL) )
      {
        v12 = this->presentable;
        if ( v12 != nullptr )
        {
          v13 = v12->GetPlayerInterface_2(this: v12);
          PlayerGui = idPresentablePlayer::GetPlayerGui(this: v13, g: GUI_TUTORIAL);
        }
        else
        {
          PlayerGui = idPresentablePlayer::GetPlayerGui(this: nullptr, g: GUI_TUTORIAL);
        }
        return idSWF::HandleEvent(this: PlayerGui, event: ev);
      }
    }
    return 0;
  }
  else
  {
    v14 = GUI_TUTORIAL;
    while ( 1 )
    {
      v15 = this->presentable;
      v16 = v15 != nullptr ? v15->GetPlayerInterface_2(this: v15) : nullptr;
      if ( idPresentablePlayer::GuiIsActive(this: v16, g: v14) )
      {
        v17 = this->presentable;
        v18 = v17 != nullptr ? v17->GetPlayerInterface_2(this: v17) : nullptr;
        v19 = idPresentablePlayer::GetPlayerGui(this: v18, g: v14);
        if ( (unsigned __int8)idSWF::HandleEvent(this: v19, event: ev) != 0 )
          break;
      }
      if ( --v14 < GUI_DELIVERY )
        return 0;
    }
    return 1;
  }
}


// ========================================================================
// ?IsPlayerControlInhibited@idPlayer@@QAA_NXZ
// EA  : 0x82E5B3C8
// RVA : 0x00E5B3C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

BOOL __fastcall idPlayer::IsPlayerControlInhibited(idPlayer *this)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v2; // r3

  presentable = this->presentable;
  if ( presentable == nullptr )
    return idPresentablePlayer::IsPlayerControlInhibited(this: nullptr);
  v2 = presentable->GetPlayerInterface_2(this: presentable);
  return idPresentablePlayer::IsPlayerControlInhibited(this: v2);
}


// ========================================================================
// ?InhibitFire@idPlayer@@QAAX_N@Z
// EA  : 0x82E5B420
// RVA : 0x00E5B420
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::InhibitFire(idPlayer *this, bool inhibit)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v4; // r3

  presentable = this->presentable;
  if ( presentable != nullptr )
    v4 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v4 = nullptr;
  idPresentablePlayer::InhibitFire(this: v4, inhibit);
}


// ========================================================================
// ?SetForceInhibitControl@idPlayer@@QAAX_N@Z
// EA  : 0x82E5B478
// RVA : 0x00E5B478
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::SetForceInhibitControl(idPlayer *this, const bool inhibit)
{
  idPresentable *presentable; // r3
  int v4; // r3

  if ( inhibit || gameLocal->challengeState < CHALLENGE_STATE_GAME_OVER )
  {
    presentable = this->presentable;
    if ( presentable != nullptr )
      v4 = (int)presentable->GetPlayerInterface_2(this: presentable);
    else
      v4 = 0;
    *(_BYTE *)(v4 + 47032) = (16 * inhibit) & 0x10 | *(_BYTE *)(v4 + 47032) & 0xEF;
  }
}


// ========================================================================
// ?SetForceInhibitMove@idPlayer@@QAAX_N@Z
// EA  : 0x82E5B500
// RVA : 0x00E5B500
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::SetForceInhibitMove(idPlayer *this, bool inhibit)
{
  idPresentable *presentable; // r3
  int v5; // r3
  int v6; // r11
  idUCmdInhibit::inhibitFlags_t v7; // r31
  bool v8; // zf
  idPresentable *v9; // r3
  idPresentablePlayer *v10; // r3

  presentable = this->presentable;
  if ( presentable != nullptr )
    v5 = (int)presentable->GetPlayerInterface_2(this: presentable);
  else
    v5 = 0;
  v6 = *(_DWORD *)(v5 + 46528);
  v8 = inhibit;
  v7 = v6 | 7;
  if ( !v8 )
    v7 = v6 & 0xFFFFFFF8;
  v9 = this->presentable;
  if ( v9 != nullptr )
    v10 = v9->GetPlayerInterface_2(this: v9);
  else
    v10 = nullptr;
  idPresentablePlayer::SetInhibitFlags(this: v10, flags: v7);
}


// ========================================================================
// ?SetForceInhibitLook@idPlayer@@QAAX_N0@Z
// EA  : 0x82E5B5A8
// RVA : 0x00E5B5A8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::SetForceInhibitLook(idPlayer *this, const bool inhibit, const bool discardDelta)
{
  idPresentable *presentable; // r3
  int v7; // r3
  int v8; // r11
  idUCmdInhibit::inhibitFlags_t v9; // r31
  idPresentable *v10; // r3
  idPresentablePlayer *v11; // r3

  presentable = this->presentable;
  if ( presentable != nullptr )
    v7 = (int)presentable->GetPlayerInterface_2(this: presentable);
  else
    v7 = 0;
  v8 = *(_DWORD *)(v7 + 46528);
  if ( inhibit )
    v9 = (!discardDelta ? 8 : 256) | v8;
  else
    v9 = v8 & 0xFFFFFEF7;
  v10 = this->presentable;
  if ( v10 != nullptr )
  {
    v11 = v10->GetPlayerInterface_2(this: v10);
    idPresentablePlayer::SetInhibitFlags(this: v11, flags: v9);
  }
  else
  {
    idPresentablePlayer::SetInhibitFlags(this: nullptr, flags: v9);
  }
}


// ========================================================================
// ?SetForceInhibitFreeGamePlay@idPlayer@@QAAX_N0@Z
// EA  : 0x82E5B660
// RVA : 0x00E5B660
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::SetForceInhibitFreeGamePlay(idPlayer *this, bool inhibit, bool canRun)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v6; // r3

  presentable = this->presentable;
  if ( presentable != nullptr )
    v6 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v6 = nullptr;
  idPresentablePlayer::SetRestrictedGamePlay(this: v6, restricted: inhibit, canRun);
}


// ========================================================================
// ?SetForceInhibitRaiseWeapon@idPlayer@@QAAX_N@Z
// EA  : 0x82E5B6C8
// RVA : 0x00E5B6C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::SetForceInhibitRaiseWeapon(idPlayer *this, bool inhibit)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v4; // r3

  presentable = this->presentable;
  if ( presentable != nullptr )
    v4 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v4 = nullptr;
  idPresentablePlayer::SetInhibitRaiseWeapon(this: v4, restricted: inhibit);
}


// ========================================================================
// ?SetForceInhibitChangeWeapon@idPlayer@@QAAX_N@Z
// EA  : 0x82E5B720
// RVA : 0x00E5B720
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::SetForceInhibitChangeWeapon(idPlayer *this, const bool inhibit)
{
  idPresentable *presentable; // r3
  int v4; // r3

  presentable = this->presentable;
  if ( presentable != nullptr )
    v4 = (int)presentable->GetPlayerInterface_2(this: presentable);
  else
    v4 = 0;
  *(_BYTE *)(v4 + 47034) = (inhibit << 6) & 0x40 | *(_BYTE *)(v4 + 47034) & 0xBF;
}


// ========================================================================
// ?OfferDynamicJob@idPlayer@@QAAXPBVidDeclJob@@@Z
// EA  : 0x82E5B788
// RVA : 0x00E5B788
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::OfferDynamicJob(idPlayer *this, idStrId *job)
{
  idJobManager::OfferDynamicJob(this: &this->jobManager, jobDecl: job);
}


// ========================================================================
// ?StartRemovalOfDynamicJob@idPlayer@@QAAXPBVidDeclJob@@@Z
// EA  : 0x82E5B790
// RVA : 0x00E5B790
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::StartRemovalOfDynamicJob(idPlayer *this, const idDeclJob *job)
{
  idJobManager::StartRemovalOfDynamicJob(this: &this->jobManager, jobDecl: job);
}


// ========================================================================
// ?HideTutorialGui@idPlayer@@QAAXXZ
// EA  : 0x82E5B798
// RVA : 0x00E5B798
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::HideTutorialGui(idPlayer *this)
{
  idPresentable *presentable; // r3
  int v3; // r3
  idPresentable *v4; // r3
  idPresentablePlayer *v5; // r3

  presentable = this->presentable;
  if ( presentable != nullptr )
    v3 = (int)presentable->GetPlayerInterface_2(this: presentable);
  else
    v3 = 0;
  if ( (*(unsigned __int8 (__fastcall **)(int))(*(_DWORD *)v3 + 300))(a1: v3) != 0 )
  {
    v4 = this->presentable;
    if ( v4 != nullptr )
      v5 = v4->GetPlayerInterface_2(this: v4);
    else
      v5 = nullptr;
    idPresentablePlayer::HideTutorialGui(this: v5);
  }
}


// ========================================================================
// ?ResolveLoot@idPlayer@@QAAXXZ
// EA  : 0x82E5B828
// RVA : 0x00E5B828
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::ResolveLoot(idPlayer *this)
{
  char v2; // r29
  int GatheredEntities; // r3
  int *v4; // r25
  int i; // r23
  idProjectile_Arrow *v6; // r31
  idPresentable *presentable; // r29
  const idDeclInventory *v8; // r21
  idInventoryCollection *v9; // r3
  __int64 v10; // r10
  __int64 v11; // r8
  int v12; // r6
  idPlayer *PlayerSounds; // r3
  int v14[32]; // [sp+50h] [-1B0h] BYREF
  char v15; // [sp+D0h] [-130h] BYREF

  v2 = 0;
  GatheredEntities = idClip::GetGatheredEntities(
                       this: &clientGame->clip,
                       query: &this->lootQuery,
                       entityList: v14,
                       maxCount: 32);
  if ( GatheredEntities > 0 )
  {
    v4 = v14;
    for ( i = GatheredEntities; i != 0; --i )
    {
      v6 = idProjectile_Arrow::CastTo(c: (idProjectile_Arrow *)gameLocal->entities.ptr[*v4]);
      if ( v6 != nullptr )
      {
        presentable = this->presentable;
        if ( presentable == nullptr )
        {
          idEntity::InitPresentableInternal(this);
          presentable = this->presentable;
        }
        v8 = v6->GetInventoryItem(this: v6);
        v9 = this->GetInventory_2(this);
        idInventoryCollection::GiveItem(
          this: v9,
          owner: presentable,
          decl: v8,
          count: 1,
          forceCount: false,
          canIntro: false);
        idEventReceiver::PostEventMS(this: v6, ev: &EV_Remove, time: 0, a4: v12, a5: v11, a6: v10);
        idRageMetrics::ItemsTaken(this: clientGame->rageMetrics, player: (idVehicle *)this, items: 1);
        v2 = 1;
      }
      ++v4;
    }
  }
  if ( !common->IsMultiplayer(this: common) && !this->lootSoundPlayed && v2 != 0 )
  {
    PlayerSounds = idPlayer::GetPlayerSounds(
                     this: (idPlayer *)&v15,
                     result: (const idDeclPlayerProps::playerSounds_t *)this);
    idEntity::StartSoundShader(
      this,
      channel: SND_CHANNEL_ANY,
      shader: (const idSoundShader *)LODWORD(PlayerSounds->renderModelInfo.maxVisibleRange),
      soundShaderFlags: (soundShaderFlags_t)0,
      peerMask: 0xFFu);
  }
  this->lootSoundPlayed = false;
}


// ========================================================================
// ?ClearNewItem@idPlayer@@QAA_NPBVidDeclInventory@@@Z
// EA  : 0x82E5B9A0
// RVA : 0x00E5B9A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

int __fastcall idPlayer::ClearNewItem(idPlayer *this, const idDeclInventory *decl)
{
  int num; // r8
  int v3; // r10
  idPlayer::newInventoryItems_t *list; // r9
  int i; // r11

  num = this->newItemList.num;
  v3 = 0;
  if ( num <= 0 )
    return 0;
  list = this->newItemList.list;
  for ( i = 0; list[i].decl != decl; ++i )
  {
    if ( ++v3 >= num )
      return 0;
  }
  list[v3].seen = true;
  return 1;
}


// ========================================================================
// ?IsInventoryItemNew@idPlayer@@QAA_NPBVidDeclInventory@@@Z
// EA  : 0x82E5BA00
// RVA : 0x00E5BA00
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

BOOL __fastcall idPlayer::IsInventoryItemNew(idPlayer *this, const idDeclInventory *decl)
{
  int num; // r8
  int v3; // r10
  idPlayer::newInventoryItems_t *list; // r9
  int i; // r11

  num = this->newItemList.num;
  v3 = 0;
  if ( num <= 0 )
    return false;
  list = this->newItemList.list;
  for ( i = 0; list[i].decl != decl; ++i )
  {
    if ( ++v3 >= num )
      return false;
  }
  return (_cntlzw(list[v3].seen) & 0x20) != 0;
}


// ========================================================================
// ?RemoveCash@idPlayer@@QAAXH@Z
// EA  : 0x82E5BA58
// RVA : 0x00E5BA58
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::RemoveCash(idPlayer *this, int amount)
{
  const idDeclInventory *cashDecl; // r28
  idPresentable *presentable; // r30
  idInventoryCollection *v6; // r3

  cashDecl = this->cashDecl;
  if ( this->presentable != nullptr )
  {
    presentable = this->presentable;
  }
  else
  {
    idEntity::InitPresentableInternal(this);
    presentable = this->presentable;
  }
  v6 = this->GetInventory_2(this);
  idInventoryCollection::DeleteInventoryItem(this: v6, owner: presentable, decl: cashDecl, count: amount);
}


// ========================================================================
// ?GiveCash@idPlayer@@QAAXH@Z
// EA  : 0x82E5BAC0
// RVA : 0x00E5BAC0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::GiveCash(idPlayer *this, int amount)
{
  const idDeclInventory *cashDecl; // r28
  idPresentable *presentable; // r30
  idInventoryCollection *v6; // r3

  cashDecl = this->cashDecl;
  if ( this->presentable != nullptr )
  {
    presentable = this->presentable;
  }
  else
  {
    idEntity::InitPresentableInternal(this);
    presentable = this->presentable;
  }
  v6 = this->GetInventory_2(this);
  idInventoryCollection::GiveItem(
    this: v6,
    owner: presentable,
    decl: cashDecl,
    count: amount,
    forceCount: false,
    canIntro: false);
}


// ========================================================================
// ?CanSave@idPlayer@@QAA_NXZ
// EA  : 0x82E5BD38
// RVA : 0x00E5BD38
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

int __fastcall idPlayer::CanSave(idPlayer *this)
{
  int result; // r3
  idPresentablePlayer::playerGuis_t v3; // r31
  idPresentable *presentable; // r3
  idPresentablePlayer *v5; // r3
  idLinkList<idActor> *next; // r11
  idAI2 *owner; // r30
  idAI2 *v8; // r3
  idAI2 *v9; // r31
  idLinkList<idActor> *v10; // r11
  idAI2 *v11; // r11
  idInteractionCamera *Control; // r3
  idAnimCamera *v13; // r3
  bool v14; // zf
  idTypesafeNumber<int,enum gameTimeUnique_t> v15; // [sp+50h] [-40h] BYREF

  if ( !this->IsDead(this) )
  {
    v3 = GUI_DELIVERY;
    while ( 1 )
    {
      if ( v3 != GUI_SUBTITLE )
      {
        presentable = this->presentable;
        v5 = presentable != nullptr ? presentable->GetPlayerInterface_2(this: presentable) : nullptr;
        if ( idPresentablePlayer::GuiIsActive(this: v5, g: v3) )
          break;
      }
      if ( ++v3 >= (GUI_TUTORIAL|GUI_JOBOFFER) )
      {
        next = gameLocal->actorEntities.next;
        if ( next != nullptr && next != gameLocal->actorEntities.head )
        {
          owner = (idAI2 *)next->owner;
          if ( owner != nullptr )
          {
            do
            {
              v8 = idAI2::CastTo(c: owner);
              v9 = v8;
              if ( v8 != nullptr && (unsigned __int8)idAI2::IsInPlayerInteractFSM(this: v8) != 0 )
              {
                if ( v9->aiVolatile.faceMgr.voiceOver != nullptr )
                  return 0;
                v15.value = 480;
                if ( (unsigned __int8)idFaceMgr::RecentlyPlayedVoiceOver(this: &v9->aiVolatile.faceMgr, threshold: &v15) != 0 )
                  return 0;
              }
              v10 = owner->actorNode.next;
              if ( v10 == nullptr || v10 == owner->actorNode.head )
                v11 = nullptr;
              else
                v11 = (idAI2 *)v10->owner;
              owner = v11;
            }
            while ( v11 != nullptr );
          }
        }
        if ( idPlayer::GetControl(this) == nullptr )
          return 1;
        Control = (idInteractionCamera *)idPlayer::GetControl(this);
        if ( idInteractionCamera::CastTo(c: Control) != nullptr )
          return 0;
        v13 = (idAnimCamera *)idPlayer::GetControl(this);
        v14 = idAnimCamera::CastTo(c: v13) != nullptr;
        result = 0;
        if ( !v14 )
          return 1;
        return result;
      }
    }
  }
  return 0;
}


// ========================================================================
// ?HandleGuiEvent@idPlayer@@UAA_NPBUsysEvent_t@@@Z
// EA  : 0x82E5BED0
// RVA : 0x00E5BED0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

int __fastcall idPlayer::HandleGuiEvent(idPlayer *this, const sysEvent_t *ev)
{
  idPresentable *presentable; // r3
  int v5; // r3
  idEntity *Control; // r3

  presentable = this->presentable;
  if ( presentable != nullptr )
    v5 = (int)presentable->GetPlayerInterface_2(this: presentable);
  else
    v5 = 0;
  if ( (*(unsigned __int8 (__fastcall **)(int))(*(_DWORD *)v5 + 300))(a1: v5) == 0 )
    return 0;
  if ( idPlayer::GetControl(this) != nullptr )
  {
    Control = idPlayer::GetControl(this);
    if ( Control->HandleGuiEvent(this: Control, a2: ev) )
      return 1;
  }
  return idPlayer::ReallyHandleGuiEvent(this, ev);
}


// ========================================================================
// ?ShowTutorialGui@idPlayer@@QAAXPBVidDeclTutorialEvent@@PAVidEntity@@@Z
// EA  : 0x82E5BF98
// RVA : 0x00E5BF98
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

// local variable allocation has failed, the output may be wrong!
void __fastcall idPlayer::ShowTutorialGui(idPlayer *this, idSWF *decl, idResourceList *activatingEntity)
{
  int v3; // r30 OVERLAPPED
  idPresentable *presentable; // r3
  int v8; // r31 OVERLAPPED
  int v9; // r3
  idThrownCamera *Control; // r3
  idPresentable *v11; // r3
  int v12; // r3
  idDeclGameStateInt *total; // r4
  idPresentable *v14; // r3
  idPresentable *v15; // r3
  int v16; // r3
  idPresentable *v17; // r3
  idPresentablePlayer *v18; // r3
  idDeclGameStateInt *v19; // r4
  int NetworkID; // r3
  idLobbyBase *v21; // r3
  idPresentable *v22; // r11
  idLobbyBase *v23; // r30
  lobbyUserID_t *v24; // r4
  idLobbyBase_vtbl *v25; // r31
  idPresentablePlayer *LobbyUserID; // r3
  _BYTE v27[8]; // [sp+50h] [-70h] BYREF
  char v28; // [sp+58h] [-68h] BYREF
  idBitMsg v29[2]; // [sp+60h] [-60h] BYREF

  if ( decl != nullptr )
  {
    presentable = this->presentable;
    v8 = 0;
    if ( presentable != nullptr )
      v9 = (int)presentable->GetPlayerInterface_2(this: presentable);
    else
      v9 = 0;
    if ( (*(unsigned __int8 (__fastcall **)(int))(*(_DWORD *)v9 + 300))(a1: v9) != 0 )
    {
      if ( !decl->textInstanceAllocator.clearAllocs )
      {
        if ( idPlayer::GetControl(this) != nullptr )
        {
          Control = (idThrownCamera *)idPlayer::GetControl(this);
          if ( idThrownCamera::CastTo(c: Control) != nullptr )
          {
            idLib::Warning(fmt: "Skipping tutorial %s because we are in throw camera", *(const char **)&decl->isActive);
            return;
          }
        }
        v11 = this->presentable;
        v12 = v11 != nullptr ? (int)v11->GetPlayerInterface_2(this: v11) : 0;
        if ( *(int *)(v12 + 19120) > 0 )
        {
          idLib::Warning(fmt: "Skipping tutorial %s because we are in a fade", *(const char **)&decl->isActive);
          return;
        }
      }
      total = (idDeclGameStateInt *)decl->textInstanceAllocator.total;
      if ( total != nullptr )
      {
        if ( idJobManager::GetGameStateIntValue(this: &this->jobManager, gameState: total) > 0 )
          return;
        idJobManager::SetGameStateIntValue(
          this: &this->jobManager,
          gameState: (const idDeclGameStateInt *)decl->textInstanceAllocator.total,
          stateValue: 1);
      }
      if ( decl->textInstanceAllocator.clearAllocs || com_multiplayer.valueInteger != 0 )
      {
        v15 = this->presentable;
        if ( v15 != nullptr )
          v16 = (int)v15->GetPlayerInterface_2(this: v15);
        else
          v16 = 0;
        *(_BYTE *)(v16 + 36256) = 1;
      }
      else
      {
        v14 = this->presentable;
        if ( v14 != nullptr )
          v14->GetPlayerInterface_2(this: v14)->ignoreTutorialPause = false;
        else
          MEMORY[0x8DA0] = 0;
      }
      v17 = this->presentable;
      if ( v17 != nullptr )
        v18 = v17->GetPlayerInterface_2(this: v17);
      else
        v18 = nullptr;
      if ( (unsigned __int8)idPresentablePlayer::ShowTutorialGui(this: v18, decl, activatingEntity) != 0 )
      {
        v19 = (idDeclGameStateInt *)decl->textInstanceAllocator.total;
        if ( v19 != nullptr )
          idJobManager::SetGameStateIntValue(this: &this->jobManager, gameState: v19, stateValue: 1);
      }
    }
    else
    {
      v29[0].curSize = 0;
      v29[0].writeBit = 0;
      v29[0].writeData = v27;
      v29[0].readData = v27;
      v29[0].maxSize = 8;
      v29[0].readCount = 0;
      v29[0].readBit = 0;
      v29[0].allowOverflow = false;
      v29[0].overflowed = false;
      v29[0].tempValue = *(_QWORD *)(&v3 - 1);
      idBitMsg::WriteBits(this: v29, value: this->entityNumber, numBits: 32);
      NetworkID = idResource::GetNetworkID(this: (idResource *)decl, alloc: true);
      idBitMsg::WriteBits(this: v29, value: NetworkID + 1, numBits: 32);
      v21 = session->GetActingGameStateLobbyBase(this: session);
      v22 = this->presentable;
      v23 = v21;
      if ( v22 != nullptr )
        v24 = (lobbyUserID_t *)v22->GetPlayerInterface_2(this: this->presentable);
      else
        v24 = nullptr;
      v25 = v23->__vftable;
      LobbyUserID = idPresentablePlayer::GetLobbyUserID(this: (idPresentablePlayer *)&v28, result: v24);
      v25->SendReliableToLobbyUser(
        this: (idLobbyBase *)LobbyUserID->__vftable,
        a2: *((lobbyUserID_t **)&LobbyUserID->__vftable + 1),
        a3: 36,
        a4: v29);
    }
  }
}


// ========================================================================
// ?TakeLootBox@idPlayer@@QAAXPAVidLootBox@@_N@Z
// EA  : 0x82E5C288
// RVA : 0x00E5C288
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::TakeLootBox(idPlayer *this, idLootBox *loot, bool lootOneItem)
{
  int v6; // r27
  const idDeclInventory *LootItem; // r29
  idPresentable *presentable; // r30
  int v9; // r22
  idInventoryCollection *v10; // r3
  float maxVisibleRange; // r5
  int v12[4]; // [sp+50h] [-130h] BYREF
  _BYTE v13[288]; // [sp+60h] [-120h] BYREF

  if ( loot != nullptr && loot->loot.num > 0 )
  {
    v6 = 0;
    do
    {
      v12[0] = 0;
      LootItem = idLootBox::GetLootItem(this: loot, idx: v6, count: v12, ignoreDropPercent: false);
      if ( LootItem != nullptr )
      {
        presentable = this->presentable;
        if ( presentable == nullptr )
        {
          idEntity::InitPresentableInternal(this);
          presentable = this->presentable;
        }
        v9 = v12[0];
        v10 = this->GetInventory_2(this);
        idInventoryCollection::GiveItem(
          this: v10,
          owner: presentable,
          decl: LootItem,
          count: v9,
          forceCount: true,
          canIntro: false);
        idRageMetrics::ItemsTaken(this: clientGame->rageMetrics, player: (idVehicle *)this, items: 1);
        if ( lootOneItem )
          break;
      }
      ++v6;
    }
    while ( v6 < loot->loot.num );
    maxVisibleRange = idPlayer::GetPlayerSounds(
                        this: (idPlayer *)v13,
                        result: (const idDeclPlayerProps::playerSounds_t *)this)->renderModelInfo.maxVisibleRange;
  }
  else
  {
    maxVisibleRange = idPlayer::GetPlayerSounds(
                        this: (idPlayer *)v13,
                        result: (const idDeclPlayerProps::playerSounds_t *)this)->spawnOrientation.mat[1].z;
  }
  idEntity::StartSoundShader(
    this,
    channel: SND_CHANNEL_ANY,
    shader: (const idSoundShader *)LODWORD(maxVisibleRange),
    soundShaderFlags: (soundShaderFlags_t)0,
    peerMask: 0xFFu);
}


// ========================================================================
// `idPlayer::TakeViewNotes'::`4'::idSWFScriptFunction_TakeViewNoteScreenCap::idSWFScriptFunction_TakeViewNoteScreenCap
// EA  : 0x82E5C438
// RVA : 0x00E5C438
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall _idPlayer::TakeViewNotes_::_4_::idSWFScriptFunction_TakeViewNoteScreenCap::idSWFScriptFunction_TakeViewNoteScreenCap(
        idStr *_viewNoteDirectory,
        idStr *_viewOrientation,
        idStr *a3)
{
  _viewNoteDirectory->data = nullptr;
  _viewNoteDirectory->len = (int)&`idPlayer::TakeViewNotes'::`4'::idSWFScriptFunction_TakeViewNoteScreenCap::`vftable';
  idStr::idStr(this: (idStr *)&_viewNoteDirectory->allocedAndFlag, text: _viewOrientation);
  idStr::idStr(this: (idStr *)((char *)_viewNoteDirectory + 40), text: a3);
  idStr::FreeData(this: _viewOrientation);
  idStr::FreeData(this: a3);
}


// ========================================================================
// __unwind$512350
// EA  : 0x82E5C4A4
// RVA : 0x00E5C4A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_512350()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 128 + 164));
}


// ========================================================================
// __unwind$512351
// EA  : 0x82E5C4CC
// RVA : 0x00E5C4CC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_512351()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 128 + 156));
}


// ========================================================================
// __unwind$512352
// EA  : 0x82E5C4F4
// RVA : 0x00E5C4F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_512352()
{
  int v0; // r12

  idMainMenu::idSWFScriptFunction_setUseVibrate::~idSWFScriptFunction_setUseVibrate(this: *(idSWFScriptFunction_RefCounted **)(v0 - 128 + 148));
}


// ========================================================================
// __unwind$512353
// EA  : 0x82E5C51C
// RVA : 0x00E5C51C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_512353()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(*(_DWORD *)(v0 - 128 + 148) + 8));
}


// ========================================================================
// `idPlayer::OfferWares'::`3'::idSWFScriptFunction_BuyItem::idSWFScriptFunction_BuyItem
// EA  : 0x82E5C810
// RVA : 0x00E5C810
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall _idPlayer::OfferWares_::_3_::idSWFScriptFunction_BuyItem::idSWFScriptFunction_BuyItem(
        idEntity *_buyer,
        idEntity *_seller,
        const idDeclInventory *_itemdecl,
        idDeclInventory *_currency,
        int _useDiscount,
        char a6)
{
  _buyer->listenerList = nullptr;
  _buyer->__vftable = (idEntity_vtbl *)&`idPlayer::OfferWares'::`3'::idSWFScriptFunction_BuyItem::`vftable';
  _buyer->listeningToList = (idList<idEventReceiver *,5> *)0x1FFF;
  _buyer->name.len = 0x1FFF;
  if ( _seller != nullptr )
    _buyer->listeningToList = (idList<idEventReceiver *,5> *)((gameLocal->spawnIds.ptr[_seller->entityNumber] << 13)
                                                            | _seller->entityNumber);
  else
    _buyer->listeningToList = (idList<idEventReceiver *,5> *)0x1FFF;
  if ( _itemdecl != nullptr )
    _buyer->name.len = (gameLocal->spawnIds.ptr[*(_DWORD *)&_itemdecl->engineerableItems.granularity] << 13)
                     | *(_DWORD *)&_itemdecl->engineerableItems.granularity;
  else
    _buyer->name.len = 0x1FFF;
  _buyer->name.data = (char *)_currency;
  _buyer->name.allocedAndFlag = _useDiscount;
  _buyer->name.baseBuffer[0] = a6;
}


// ========================================================================
// ?SetKeysGarage@idPlayer@@QAAXW4garageList_t@@@Z
// EA  : 0x82E5C8C8
// RVA : 0x00E5C8C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::SetKeysGarage(idPlayer *this, int garage)
{
  idInventoryCollection *v4; // r3
  int v5; // r10
  int v6; // r11
  idVehicleState *v7; // r8
  idList<idVehicleState *,5> v8[4]; // [sp+50h] [-40h] BYREF

  memset(v8, 0, 14);
  v8[0].listStatic = 0;
  v8[0].memTag = 5;
  idList<idThread *,58>::Clear(this: v8);
  v4 = this->GetInventory_2(this);
  idInventoryCollection::GetVehicleKeys(this: v4, vehicleList: (idList<idVehicleKey *,5> *)v8);
  v5 = 0;
  if ( v8[0].num > 0 )
  {
    v6 = 0;
    do
    {
      ++v5;
      v7 = v8[0].list[v6++];
      v7[1].debugName.allocedAndFlag = garage;
    }
    while ( v5 < v8[0].num );
  }
  if ( (v8[0].listStatic == 0 || v8[0].listStatic == 2) && v8[0].list != nullptr )
    idMem::Free(this: &mem, ptr: v8[0].list, align: ALIGN_16);
}


// ========================================================================
// __unwind$516168
// EA  : 0x82E5C990
// RVA : 0x00E5C990
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_516168()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 144 + 80));
}


// ========================================================================
// `idPlayer::OfferJob'::`2'::idSWFScriptFunction_AcceptJob::Call
// EA  : 0x82E5CB38
// RVA : 0x00E5CB38
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferJob_::_2_::idSWFScriptFunction_AcceptJob::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int num; // r11

  num = thisObject->variables.num;
  result->type = SWF_VAR_UNDEF;
  *(_DWORD *)(num + 12572) = 1;
  return result;
}


// ========================================================================
// `idPlayer::OfferJob'::`3'::idSWFScriptFunction_ReallyAcceptJob::Call
// EA  : 0x82E5CB50
// RVA : 0x00E5CB50
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferJob_::_3_::idSWFScriptFunction_ReallyAcceptJob::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idStrId *v4; // r4

  v4 = *(idStrId **)&thisObject->variables.granularity;
  if ( v4 != nullptr )
  {
    if ( v4[25].index == 4 )
    {
      idJobManager::AcceptJob(
        this: (idJobManager *)(thisObject->variables.num + 12412),
        jobDecl: v4,
        completeTree: false,
        force: false);
    }
    else if ( v4[135].index != 0 )
    {
      idPlayer::SetForceInhibitControl(this: (idPlayer *)thisObject->variables.num, inhibit: true);
      idJobManager::AcceptJob(
        this: (idJobManager *)(thisObject->variables.num + 12412),
        jobDecl: *(idStrId **)&thisObject->variables.granularity,
        completeTree: false,
        force: false);
    }
  }
  else
  {
    idLib::Warning(fmt: "idSWFScriptFunction_ReallyAcceptJob called with NULL job decl", 0, parms);
  }
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::OfferJob'::`4'::idSWFScriptFunction_DeclineJob::Call
// EA  : 0x82E5CC00
// RVA : 0x00E5CC00
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferJob_::_4_::idSWFScriptFunction_DeclineJob::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int num; // r11

  num = thisObject->variables.num;
  result->type = SWF_VAR_UNDEF;
  *(_DWORD *)(num + 12572) = 0;
  return result;
}


// ========================================================================
// `idPlayer::OfferJob'::`5'::idSWFScriptFunction_EndInteractionView::Call
// EA  : 0x82E5CC18
// RVA : 0x00E5CC18
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferJob_::_5_::idSWFScriptFunction_EndInteractionView::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idAI2 *size; // r3
  _DWORD *num; // r11
  int v7; // r3
  int v8; // r3

  size = (idAI2 *)thisObject->variables.size;
  if ( size != nullptr )
    idAI2::EndInteractionView(this: size, player: (idPlayer *)thisObject->variables.num);
  num = (_DWORD *)thisObject->variables.num;
  num[3184] = 0;
  num[3052] = 0x1FFF;
  v7 = num[122];
  if ( v7 != 0 )
    v8 = (*(int (__fastcall **)(int))(*(_DWORD *)v7 + 104))(a1: v7);
  else
    v8 = 0;
  idPlayerHud::SetHudState(this: (idPlayerHud *)(v8 + 35096), state: HUDSTATE_ALL);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::ShowJobBoard'::`3'::idSWFScriptFunction_JobBoardDeactivateCallback::Call
// EA  : 0x82E5CCA0
// RVA : 0x00E5CCA0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowJobBoard_::_3_::idSWFScriptFunction_JobBoardDeactivateCallback::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  _DWORD *num; // r8
  int v5; // r3
  int v6; // r3

  *(_DWORD *)(thisObject->variables.num + 12572) = 0;
  num = (_DWORD *)thisObject->variables.num;
  num[3184] = 0;
  num[3052] = 0x1FFF;
  v5 = num[122];
  if ( v5 != 0 )
    v6 = (*(int (__fastcall **)(int))(*(_DWORD *)v5 + 104))(a1: v5);
  else
    v6 = 0;
  idPlayerHud::SetHudState(this: (idPlayerHud *)(v6 + 35096), state: HUDSTATE_ALL);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::OfferWares'::`5'::idSWFScriptFunction_PlayerInventory_FreeRepair::Call
// EA  : 0x82E5CD28
// RVA : 0x00E5CD28
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_5_::idSWFScriptFunction_PlayerInventory_FreeRepair::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  int v6; // r29
  int v8; // r28
  idInventoryCollection *v9; // r30
  int v10; // r31
  idVehicleKey *InventoryItem; // r3
  idVehicleKey *v12; // r3

  v6 = 0;
  if ( *(_DWORD *)(a4 + 4) != 1 )
  {
    idLib::Warning(fmt: "free repair requested on vehicle for upgrade but parameters where not met");
    result->type = SWF_VAR_UNDEF;
    return result;
  }
  v8 = idSWFScriptVar::ToInteger(this: *(idSWFScriptVar **)a4);
  v9 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
  v10 = 0;
  if ( (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v9) > 0 )
  {
    while ( 1 )
    {
      InventoryItem = (idVehicleKey *)idInventoryCollection::GetInventoryItem(this: v9, index: v10);
      if ( InventoryItem != nullptr )
      {
        v12 = idVehicleKey::CastTo(c: InventoryItem);
        if ( v12 == nullptr || v12->equippedUpgrades.num == 0 )
          goto LABEL_9;
        if ( v8 - 1 == v6 )
          break;
        ++v6;
      }
LABEL_9:
      if ( ++v10 >= (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v9) )
      {
        result->type = SWF_VAR_UNDEF;
        return result;
      }
    }
    idVehicleKey::DoTotalRepair(this: v12);
  }
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::OfferWares'::`8'::idSWFScriptFunction_SwitchCamera::Call
// EA  : 0x82E5CE20
// RVA : 0x00E5CE20
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_8_::idSWFScriptFunction_SwitchCamera::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  char v6; // r30
  idInteractionCamera *Control; // r3
  idInteractionCamera *v8; // r3

  if ( *(_DWORD *)(a4 + 4) != 1 )
    goto LABEL_8;
  v6 = idSWFScriptVar::ToBool(this: *(idSWFScriptVar **)a4);
  Control = (idInteractionCamera *)idPlayer::GetControl(this: (idPlayer *)thisObject->variables.num);
  v8 = idInteractionCamera::CastTo(c: Control);
  if ( v8 == nullptr )
  {
    idLib::Warning(fmt: "no camera found in idSWFScriptFunction_SwitchCamera");
LABEL_8:
    result->type = SWF_VAR_UNDEF;
    return result;
  }
  if ( v6 != 0 )
    idInteractionCamera::SwitchToSell(this: v8);
  else
    idInteractionCamera::SwitchToBuy(this: v8);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::OfferWares'::`9'::idSWFScriptFunction_PlayerVendorDeactivateCallback::Call
// EA  : 0x82E5CEC0
// RVA : 0x00E5CEC0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_9_::idSWFScriptFunction_PlayerVendorDeactivateCallback::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  _DWORD *num; // r9
  int v6; // r3
  int v7; // r3

  *(_DWORD *)(thisObject->variables.num + 12216) = 0;
  *(_DWORD *)(thisObject->variables.num + 12572) = 0;
  idAI2::EndInteractionView(this: (idAI2 *)thisObject->variables.size, player: (idPlayer *)thisObject->variables.num);
  num = (_DWORD *)thisObject->variables.num;
  num[3184] = 0;
  num[3052] = 0x1FFF;
  v6 = num[122];
  if ( v6 != 0 )
    v7 = (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 104))(a1: v6);
  else
    v7 = 0;
  idPlayerHud::SetHudState(this: (idPlayerHud *)(v7 + 35096), state: HUDSTATE_ALL);
  idJobManager::AskForGameSave(this: (idJobManager *)(thisObject->variables.num + 12412));
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// ?LaunchDebugJobGui@idPlayer@@QAAXXZ
// EA  : 0x82E5CF60
// RVA : 0x00E5CF60
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::LaunchDebugJobGui(idPlayer *this)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v3; // r3
  idSWF *PlayerGui; // r3
  idSWF *v5; // r25
  idSWFScriptObject *v6; // r30
  idSWFScriptFunction *v7; // r3
  idSWFScriptFunction *v8; // r4
  idSWFScriptFunction *v9; // r3
  idSWFScriptFunction *v10; // r4
  idSWFScriptFunction *v11; // r3
  idSWFScriptFunction *v12; // r4
  idPresentable *v14; // r3
  int v15; // r3
  idPlayerHud::hudState_t v16; // r4
  idPresentable *v17; // r3
  idSWFScriptVar v18; // [sp+50h] [-60h] BYREF
  idSWFScriptVar v19; // [sp+58h] [-58h] BYREF
  idSWFScriptVar v20; // [sp+60h] [-50h] BYREF
  idSWFScriptVar v21[9]; // [sp+68h] [-48h] BYREF

  presentable = this->presentable;
  if ( presentable != nullptr )
    v3 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v3 = nullptr;
  PlayerGui = idPresentablePlayer::GetPlayerGui(this: v3, g: GUI_JOB_DEBUG);
  v5 = PlayerGui;
  if ( PlayerGui->isActive )
  {
    idSWF::Activate(this: PlayerGui, b: false);
    v17 = this->presentable;
    if ( v17 != nullptr )
      v15 = (int)v17->GetPlayerInterface_2(this: v17);
    else
      v15 = 0;
    v16 = HUDSTATE_ALL;
  }
  else
  {
    v6 = idSWFScriptObject::Alloc();
    idSWFScriptObject::MakeArray(this: v6);
    v7 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                  this: &mem,
                                  location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                  size: 0x10u,
                                  tag: TAG_SWF,
                                  zeroBuffer: false,
                                  align: ALIGN_16,
                                  heap: HEAP_DEFAULTHEAP);
    if ( v7 != nullptr )
    {
      v7[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v7[3].__vftable = (idSWFScriptFunction_vtbl *)v6;
      v8 = v7;
      v7[1].__vftable = nullptr;
      v7->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::LaunchDebugJobGui'::`7'::idSWFScriptFunction_PlayerJobsDebug_Refresh::`vftable';
    }
    else
    {
      v8 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v18, nf: v8);
    idSWFScriptObject::Set(this: v6, name: "refresh", value: &v18);
    idSWFScriptVar::Free(this: &v18);
    v9 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                  this: &mem,
                                  location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                  size: 0xCu,
                                  tag: TAG_SWF,
                                  zeroBuffer: false,
                                  align: ALIGN_16,
                                  heap: HEAP_DEFAULTHEAP);
    if ( v9 != nullptr )
    {
      v9[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v9[1].__vftable = nullptr;
      v10 = v9;
      v9->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::LaunchDebugJobGui'::`3'::idSWFScriptFunction_DoClear::`vftable';
    }
    else
    {
      v10 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v19, nf: v10);
    idSWFScriptObject::Set(this: v6, name: "clearjobs", value: &v19);
    idSWFScriptVar::Free(this: &v19);
    v11 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0xCu,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v11 != nullptr )
    {
      v11[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v11[1].__vftable = nullptr;
      v12 = v11;
      v11->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::LaunchDebugJobGui'::`4'::idSWFScriptFunction_ShutDownResponse::`vftable';
    }
    else
    {
      v12 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v20, nf: v12);
    idSWFScriptObject::Set(this: v6, name: "shutdownresponse", value: &v20);
    idSWFScriptVar::Free(this: &v20);
    idSWFScriptVar::idSWFScriptVar(this: v21, o: v6);
    idSWFScriptObject::Set(this: v5->globals, name: "jobs", value: v21);
    idSWFScriptVar::Free(this: v21);
    if ( v6->refCount-- == 1 )
    {
      idSWFScriptObject::~idSWFScriptObject(this: v6);
      idMem::Free(this: &mem, ptr: v6, align: ALIGN_16);
    }
    idSWF::Activate(this: v5, b: true);
    v14 = this->presentable;
    if ( v14 != nullptr )
      v15 = (int)v14->GetPlayerInterface_2(this: v14);
    else
      v15 = 0;
    v16 = HUDSTATE_NONE;
  }
  idPlayerHud::SetHudState(this: (idPlayerHud *)(v15 + 35096), state: v16);
}


// ========================================================================
// __unwind$517110
// EA  : 0x82E5D1EC
// RVA : 0x00E5D1EC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517110()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 176 + 80));
}


// ========================================================================
// __unwind$517112
// EA  : 0x82E5D214
// RVA : 0x00E5D214
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517112()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 176 + 88));
}


// ========================================================================
// __unwind$517114
// EA  : 0x82E5D23C
// RVA : 0x00E5D23C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517114()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 176 + 96));
}


// ========================================================================
// __unwind$517115
// EA  : 0x82E5D264
// RVA : 0x00E5D264
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517115()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 176 + 104));
}


// ========================================================================
// `idPlayer::LaunchDebugJobGui'::`2'::idSWFScriptFunction_IncreaseJob::Call
// EA  : 0x82E5D290
// RVA : 0x00E5D290
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::LaunchDebugJobGui_::_2_::idSWFScriptFunction_IncreaseJob::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int v5; // r3
  int v6; // r3
  idJob *JobByDecl; // r3
  int status; // r11
  int v9; // r3
  int v10; // r3

  v5 = *(_DWORD *)(thisObject->variables.num + 488);
  if ( v5 != 0 )
    v6 = (*(int (__fastcall **)(int))(*(_DWORD *)v5 + 104))(a1: v5);
  else
    v6 = 0;
  idPlayerHud::SetIgnoreJobUpdates(this: (idPlayerHud *)(v6 + 35096), ignore: true);
  *(_BYTE *)(thisObject->variables.num + 12540) = 1;
  JobByDecl = idJobManager::FindJobByDecl(
                this: (idJobManager *)(thisObject->variables.num + 12412),
                jobDecl: (const idDeclJob *)thisObject->variables.size);
  if ( JobByDecl != nullptr && (status = JobByDecl->status) >= 2 )
  {
    if ( status >= 3 )
    {
      if ( status >= 5 )
      {
        idLib::Warning(fmt: "Job already Complete");
      }
      else
      {
        idLib::Printf(fmt: "---\nJobGUI: Completing %s\n---\n", *(const char **)(thisObject->variables.size + 8));
        idJobManager::CompleteJob(
          this: (idJobManager *)(thisObject->variables.num + 12412),
          jobDecl: (idStrId *)thisObject->variables.size,
          completeTree: true,
          giveJob: true,
          force: false);
      }
    }
    else
    {
      idLib::Printf(
        fmt: "---\nJobGUI: Setting Ready to turn in %s\n---\n",
        *(const char **)(thisObject->variables.size + 8));
      idJobManager::SetJobReadyToTurnIn(
        this: (idJobManager *)(thisObject->variables.num + 12412),
        jobDecl: (idStrId *)thisObject->variables.size,
        completeTree: true,
        giveJobIfNeeded: true,
        hideIfGiven: false,
        force: false);
    }
  }
  else
  {
    idLib::Printf(fmt: "---\nJobGUI: Accepting %s\n---\n", *(const char **)(thisObject->variables.size + 8));
    idJobManager::AcceptJob(
      this: (idJobManager *)(thisObject->variables.num + 12412),
      jobDecl: (idStrId *)thisObject->variables.size,
      completeTree: true,
      force: false);
  }
  *(_BYTE *)(thisObject->variables.num + 12540) = 0;
  v9 = *(_DWORD *)(thisObject->variables.num + 488);
  if ( v9 != 0 )
    v10 = (*(int (__fastcall **)(int))(*(_DWORD *)v9 + 104))(a1: v9);
  else
    v10 = 0;
  idPlayerHud::SetIgnoreJobUpdates(this: (idPlayerHud *)(v10 + 35096), ignore: false);
  idAI2::RestartPlayerInteractions();
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::LaunchDebugJobGui'::`3'::idSWFScriptFunction_DoClear::Call
// EA  : 0x82E5D428
// RVA : 0x00E5D428
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::LaunchDebugJobGui_::_3_::idSWFScriptFunction_DoClear::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int v5; // r3
  int v6; // r3
  int v7; // r3
  int v8; // r3
  idFileList *v9; // r26
  int v10; // r25
  int v11; // r27
  idStr *v12; // r28
  size_t len; // r30
  int v14; // r4
  idStr v16; // [sp+60h] [-D0h] BYREF
  idStr v17; // [sp+80h] [-B0h] BYREF
  idStr v18[4]; // [sp+A0h] [-90h] BYREF

  v5 = *(_DWORD *)(thisObject->variables.num + 488);
  if ( v5 != 0 )
    v6 = (*(int (__fastcall **)(int))(*(_DWORD *)v5 + 104))(a1: v5);
  else
    v6 = 0;
  idPlayerHud::SetIgnoreJobUpdates(this: (idPlayerHud *)(v6 + 35096), ignore: true);
  *(_BYTE *)(thisObject->variables.num + 12540) = 1;
  idJobManager::ClearAllJobStatus(this: (idJobManager *)(thisObject->variables.num + 12412));
  idJobManager::ClearPlayerInteractionMemories(this: (idJobManager *)(thisObject->variables.num + 12412));
  idJobManager::ClearGameStateInts(this: (idJobManager *)(thisObject->variables.num + 12412));
  idJobManager::ClearJobNotes(this: (idJobManager *)(thisObject->variables.num + 12412));
  *(_BYTE *)(thisObject->variables.num + 12540) = 0;
  idJobTimerManager::Clear(this: (idJobTimerManager *)(thisObject->variables.num + 12552));
  v7 = *(_DWORD *)(thisObject->variables.num + 488);
  if ( v7 != 0 )
    v8 = (*(int (__fastcall **)(int))(*(_DWORD *)v7 + 104))(a1: v7);
  else
    v8 = 0;
  idPlayerHud::SetIgnoreJobUpdates(this: (idPlayerHud *)(v8 + 35096), ignore: false);
  idLib::Printf(fmt: "---\nJobGUI: Clearing Jobs\n---\n");
  idLib::Warning(fmt: "Currently Clearing the jobs wipes the save directory!  FYI.");
  v9 = fileSystem->ListFiles(this: fileSystem, a2: "savegame", a3: &byte_8200D768, a4: 0, a5: 0);
  v10 = 0;
  if ( v9->list.num > 0 )
  {
    v11 = 0;
    do
    {
      idStr::idStr(this: &v17, text: v9->list.list[v11].data);
      v16.allocedAndFlag = 20;
      v16.len = 0;
      v16.data = v16.baseBuffer;
      v16.baseBuffer[0] = 0;
      v12 = operator+(result: v18, a: "savegame\\", b: &v17);
      len = v12->len;
      v14 = v12->len + 1;
      if ( v16.allocedAndFlag >= 0 )
      {
        if ( v14 > (v16.allocedAndFlag & 0x7FFFFFFF) )
          idStr::ReAllocate(this: &v16, amount: v14, keepold: false);
      }
      else if ( v14 > (v16.allocedAndFlag & 0x7FFFFFFF)
             && AssertFailed(
                  file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                  line: 463,
                  expression: "amount <= GetAlloced()",
                  inlineBreak: true) )
      {
        __trap();
      }
      memcpy(Dst: v16.data, Src: v12->data, Size: len);
      v16.data[len] = 0;
      v16.len = len;
      idStr::FreeData(this: v18);
      fileSystem->RemoveFile(this: fileSystem, a2: v16.data, a3: FSPATH_BASE);
      idStr::FreeData(this: &v16);
      idStr::FreeData(this: &v17);
      ++v10;
      ++v11;
    }
    while ( v10 < v9->list.num );
  }
  idAI2::RestartPlayerInteractions();
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// __unwind$517489
// EA  : 0x82E5D6A0
// RVA : 0x00E5D6A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517489()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 304 + 128));
}


// ========================================================================
// __unwind$517490
// EA  : 0x82E5D6C8
// RVA : 0x00E5D6C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517490()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 304 + 96));
}


// ========================================================================
// __unwind$517491
// EA  : 0x82E5D6F0
// RVA : 0x00E5D6F0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517491()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 304 + 160));
}


// ========================================================================
// `idPlayer::LaunchDebugJobGui'::`4'::idSWFScriptFunction_ShutDownResponse::Call
// EA  : 0x82E5D718
// RVA : 0x00E5D718
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::LaunchDebugJobGui_::_4_::idSWFScriptFunction_ShutDownResponse::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int v5; // r3
  int v6; // r3

  v5 = *(_DWORD *)(thisObject->variables.num + 488);
  if ( v5 != 0 )
    v6 = (*(int (__fastcall **)(int))(*(_DWORD *)v5 + 104))(a1: v5);
  else
    v6 = 0;
  idPlayerHud::SetHudState(this: (idPlayerHud *)(v6 + 35096), state: HUDSTATE_ALL);
  idPlayer::UpdateActiveJob(this: (idPlayer *)thisObject->variables.num);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::LaunchDebugJobGui'::`5'::idSWFScriptFunction_RespawnForJob::Call
// EA  : 0x82E5D7A0
// RVA : 0x00E5D7A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::LaunchDebugJobGui_::_5_::idSWFScriptFunction_RespawnForJob::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idLib::Warning(fmt: "idSWFScriptFunction_RespawnForJob no longer does anything.  REMOVE", thisObject, parms);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::LaunchDebugJobGui'::`7'::idSWFScriptFunction_PlayerJobsDebug_Refresh::InsertJob
// EA  : 0x82E5D7E0
// RVA : 0x00E5D7E0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

int __fastcall _idPlayer::LaunchDebugJobGui_::_7_::idSWFScriptFunction_PlayerJobsDebug_Refresh::InsertJob(
        const idDeclJob *jobDecl,
        idDeclJob *jobList,
        idList<idVec1,116> *a3,
        int a4,
        int a5,
        int a6,
        int a7,
        int a8,
        int a9,
        int a10,
        int a11,
        int a12,
        int a13,
        idVec1 a14)
{
  int num; // r10
  int result; // r3
  int v19; // r11
  int v20; // r30
  int i; // r28
  const idDeclJob::jobPreCondition_t *JobPrecondition; // r3
  const idDeclJob::jobPreCondition_t *v23; // r31
  char *data; // r4
  int inserted; // r3

  num = a3->num;
  LODWORD(a14.x) = (idVec1)jobList;
  result = 0;
  if ( num <= 0 )
    goto LABEL_7;
  v19 = 0;
  while ( (idDeclJob *)LODWORD(a3->list[v19].x) != jobList )
  {
    ++result;
    ++v19;
    if ( result >= num )
      goto LABEL_7;
  }
  if ( result < 0 )
  {
LABEL_7:
    v20 = 0;
    for ( i = 0; i < (int)idMapPatch::GetMaterial(hSSMDev: jobList); ++i )
    {
      JobPrecondition = idDeclJob::GetJobPrecondition(this: jobList, idx: i);
      v23 = JobPrecondition;
      if ( JobPrecondition->precondition == JOBPRECONDITION_JOB
        && idStr::Icmp(s1: JobPrecondition->jobDecl.data, s2: jobList->name.str) != 0 )
      {
        data = v23->jobDecl.data;
        if ( data != nullptr )
          data = (char *)idDeclInfo::FindWithInheritance(this: &idDeclJob::resourceList, name: data, makeDefault: true);
        inserted = _idPlayer::LaunchDebugJobGui_::_7_::idSWFScriptFunction_PlayerJobsDebug_Refresh::InsertJob(
                     jobDecl,
                     jobList: (idList<idDeclJob const *,5> *)data);
        if ( inserted >= v20 )
          v20 = inserted + 1;
      }
    }
    return idList<idVec1,116>::Insert(this: a3, obj: &a14, index: v20);
  }
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`17'::idSWFScriptFunction_ClearNewItem::Call
// EA  : 0x82E5D8F0
// RVA : 0x00E5D8F0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_17_::idSWFScriptFunction_ClearNewItem::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  _DWORD *v4; // r5

  idPlayer::ClearNewItem(
    this: (idPlayer *)thisObject->variables.num,
    decl: (const idDeclInventory *)thisObject->variables.size);
  *v4 = 4;
  return (idSWFScriptVar *)v4;
}


// ========================================================================
// `idPlayer::ShowInventory'::`27'::idSWFScriptFuntion_PlayerWeapons_EquipWeapon::Call
// EA  : 0x82E5D938
// RVA : 0x00E5D938
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_27_::idSWFScriptFuntion_PlayerWeapons_EquipWeapon::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        __int64 parms,
        __int64 a4,
        __int64 a5)
{
  idSWFScriptVar *v5; // r27
  idSWFScriptVar **v6; // r30
  int v8; // r28
  int v9; // r3
  const idDeclJob *data; // r4
  idJobManager *v11; // r30
  idGuiListBox *JobByDecl; // r29
  idGuiListBox *InventoryItemForQuickSlot; // r3
  idStr v14[2]; // [sp+60h] [-50h] BYREF

  v5 = result;
  v6 = (idSWFScriptVar **)parms;
  LODWORD(a5) = *(_DWORD *)(parms + 4);
  if ( (_DWORD)a5 == 2 )
  {
    idSWFScriptVar::ToString(this: (idSWFScriptVar *)v14, result: *(idStr **)parms, a3: parms, a4, a5);
    v8 = idSWFScriptVar::ToInteger(this: *v6 + 1);
    v9 = (*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
    data = (const idDeclJob *)v14[0].data;
    v11 = (idJobManager *)v9;
    if ( v14[0].data != nullptr )
      data = (const idDeclJob *)idDeclInfo::FindWithInheritance(
                                  this: &idDeclInventory::resourceList,
                                  name: v14[0].data,
                                  makeDefault: true);
    JobByDecl = (idGuiListBox *)idJobManager::FindJobByDecl(this: v11, jobDecl: data);
    if ( JobByDecl != nullptr )
    {
      InventoryItemForQuickSlot = (idGuiListBox *)idInventoryCollection::GetInventoryItemForQuickSlot(
                                                    this: (idInventoryCollection *)v11,
                                                    slotGroup: QUICKSLOTGROUP_WEAPON,
                                                    slot: v8,
                                                    numSlots: 4);
      if ( InventoryItemForQuickSlot != nullptr )
        idGuiListBox::DidActionRow(this: InventoryItemForQuickSlot, actionRow: -1);
      idGuiListBox::DidActionRow(this: JobByDecl, actionRow: v8);
    }
    v5->type = SWF_VAR_UNDEF;
    idStr::FreeData(this: v14);
    return v5;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
  }
  return result;
}


// ========================================================================
// __unwind$517929
// EA  : 0x82E5DA38
// RVA : 0x00E5DA38
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517929()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 176;
  if ( (*(_DWORD *)(v0 - 176 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 196));
  }
}


// ========================================================================
// __unwind$517932
// EA  : 0x82E5DA7C
// RVA : 0x00E5DA7C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517932()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 176 + 96));
}


// ========================================================================
// `idPlayer::ShowInventory'::`28'::idSWFScriptFuntion_PlayerWeapons_UnequipWeapon::Call
// EA  : 0x82E5DAB0
// RVA : 0x00E5DAB0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_28_::idSWFScriptFuntion_PlayerWeapons_UnequipWeapon::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        __int64 parms,
        __int64 a4,
        __int64 a5)
{
  idSWFScriptVar *v5; // r29
  int v7; // r3
  const idDeclJob *data; // r4
  idJobManager *v9; // r30
  idGuiListBox *JobByDecl; // r3
  idStr v11[2]; // [sp+60h] [-40h] BYREF

  v5 = result;
  LODWORD(a5) = *(_DWORD *)(parms + 4);
  if ( (_DWORD)a5 == 1 )
  {
    idSWFScriptVar::ToString(this: (idSWFScriptVar *)v11, result: *(idStr **)parms, a3: parms, a4, a5);
    v7 = (*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
    data = (const idDeclJob *)v11[0].data;
    v9 = (idJobManager *)v7;
    if ( v11[0].data != nullptr )
      data = (const idDeclJob *)idDeclInfo::FindWithInheritance(
                                  this: &idDeclInventory::resourceList,
                                  name: v11[0].data,
                                  makeDefault: true);
    JobByDecl = (idGuiListBox *)idJobManager::FindJobByDecl(this: v9, jobDecl: data);
    if ( JobByDecl != nullptr )
      idGuiListBox::DidActionRow(this: JobByDecl, actionRow: -1);
    v5->type = SWF_VAR_UNDEF;
    idStr::FreeData(this: v11);
    return v5;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
  }
  return result;
}


// ========================================================================
// __unwind$517994
// EA  : 0x82E5DB6C
// RVA : 0x00E5DB6C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517994()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 160;
  if ( (*(_DWORD *)(v0 - 160 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 180));
  }
}


// ========================================================================
// __unwind$517997
// EA  : 0x82E5DBB0
// RVA : 0x00E5DBB0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_517997()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 160 + 96));
}


// ========================================================================
// `idPlayer::ShowInventory'::`29'::idSWFScriptFunction_SetActiveJob::Call
// EA  : 0x82E5DBD8
// RVA : 0x00E5DBD8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_29_::idSWFScriptFunction_SetActiveJob::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idJobManager::SetActiveJob(
    this: (idJobManager *)(thisObject->variables.num + 12412),
    decl: (const idDeclJob *)thisObject->variables.size,
    checkImportance: false);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`30'::idSWFScriptFunction_ClearActiveJob::Call
// EA  : 0x82E5DC20
// RVA : 0x00E5DC20
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_30_::idSWFScriptFunction_ClearActiveJob::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idPhysics_Parametric::Activate(this: (idPhysics_Parametric *)(thisObject->variables.num + 12412));
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`39'::idSWFScriptFunction_PlayerInventory_Deactivate::Call
// EA  : 0x82E5DC60
// RVA : 0x00E5DC60
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_39_::idSWFScriptFunction_PlayerInventory_Deactivate::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int num; // r11
  int v6; // r3
  int v7; // r3
  int v8; // r3
  int v9; // r3

  num = thisObject->variables.num;
  if ( num != 0 )
  {
    v6 = *(_DWORD *)(num + 488);
    if ( v6 != 0 )
      v7 = (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 104))(a1: v6);
    else
      v7 = 0;
    idView::ForceBlurValues(this: (idView *)(v7 + 16224), blurBegin: 0.5, blurEnd: 0.0, blurTime: 100.0);
    v8 = *(_DWORD *)(thisObject->variables.num + 488);
    if ( v8 != 0 )
      v9 = (*(int (__fastcall **)(int))(*(_DWORD *)v8 + 104))(a1: v8);
    else
      v9 = 0;
    idPlayerHud::SetHudState(this: (idPlayerHud *)(v9 + 35096), state: HUDSTATE_ALL);
  }
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`40'::idSWFScriptFunction_PlayerInventory_EquipDeactivate::Call
// EA  : 0x82E5DD38
// RVA : 0x00E5DD38
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_40_::idSWFScriptFunction_PlayerInventory_EquipDeactivate::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        idSWFScriptVar **a4)
{
  int num; // r11
  int v8; // r3
  int v9; // r3
  int v10; // r3
  idPlayerHud *PlayerHud; // r3
  __int64 v12; // r10
  __int64 v13; // r6
  __int64 v14; // r8
  int v16; // r27
  char *data; // r29
  idJobManager *v18; // r3
  idWeapon *InventoryItemByDeclName; // r29
  int v20; // r3
  int v21; // r3
  idHands *v22; // r28
  idWeapon *v23; // r3
  idWeapon *v24; // r29
  int v25; // r11
  const idDeclInventory *decl; // r30
  int v27; // r3
  int v28; // r3
  idStr v29[3]; // [sp+60h] [-60h] BYREF

  num = thisObject->variables.num;
  if ( num != 0 && (v8 = *(_DWORD *)(num + 488)) != 0 && (*(int (__fastcall **)(int))(*(_DWORD *)v8 + 104))(a1: v8) != 0 )
  {
    v9 = *(_DWORD *)(thisObject->variables.num + 488);
    if ( v9 != 0 )
      v10 = (*(int (__fastcall **)(int))(*(_DWORD *)v9 + 104))(a1: v9);
    else
      v10 = 0;
    idView::ForceBlurValues(this: (idView *)(v10 + 16224), blurBegin: 0.5, blurEnd: 0.0, blurTime: 100.0);
    PlayerHud = (idPlayerHud *)idPlayer::GetPlayerHud(this: (idPlayer *)thisObject->variables.num);
    idPlayerHud::SetHudState(this: PlayerHud, state: HUDSTATE_ALL);
    idPlayer::InhibitFire(this: (idPlayer *)thisObject->variables.num, inhibit: true);
    idSWF::Activate(this: (idSWF *)thisObject->variables.size, b: false);
    LODWORD(v14) = a4[1];
    if ( (_DWORD)v14 != 2 )
    {
      idLib::Warning(fmt: "tried to use and deactivate inventory without passing decl to use function");
      result->type = SWF_VAR_UNDEF;
      return result;
    }
    idSWFScriptVar::ToString(this: (idSWFScriptVar *)v29, result: (idStr *)*a4, a3: v13, a4: v14, a5: v12);
    v16 = idSWFScriptVar::ToInteger(this: *a4 + 1);
    data = v29[0].data;
    v18 = (idJobManager *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
    InventoryItemByDeclName = (idWeapon *)idInventoryCollection::FindInventoryItemByDeclName(this: v18, jobName: data);
    v20 = *(_DWORD *)(thisObject->variables.num + 488);
    if ( v20 != 0 )
      v21 = (*(int (__fastcall **)(int))(*(_DWORD *)v20 + 104))(a1: v20);
    else
      v21 = 0;
    v22 = (idHands *)(v21 + 37616);
    if ( InventoryItemByDeclName != nullptr )
    {
      v23 = idWeapon::CastTo(c: InventoryItemByDeclName);
      v24 = v23;
      if ( v23 != nullptr && v22 != nullptr )
      {
        v25 = thisObject->variables.num;
        decl = v23->decl;
        v27 = *(_DWORD *)(v25 + 488);
        if ( v27 != 0 )
          v28 = (*(int (__fastcall **)(int))(*(_DWORD *)v27 + 104))(a1: v27);
        else
          v28 = 0;
        if ( v24 == (idWeapon *)(*(int (__fastcall **)(int))(*(_DWORD *)v28 + 340))(a1: v28) )
        {
          if ( decl != nullptr
            && !idHands::BringDownPending(this: v22)
            && !idHands::BringUpPending(this: v22)
            && !v22->isWeaponBringUp
            && v16 < (int)decl[1].nextOnHashChain )
          {
            idHands::SelectAmmo(
              this: v22,
              slot: EQUIP_RIGHT_HAND,
              ammoDecl: *(const idDeclAmmo **)&decl[1].name.str[28 * v16]);
          }
        }
        else
        {
          idHands::SelectWeapon(this: v22, slot: EQUIP_RIGHT_HAND, weapon: v24, useIntroBringUp: false);
          if ( decl != nullptr && v16 < (int)decl[1].nextOnHashChain )
            idHands::ForceAmmo(this: v22, ammoDecl: *(const idDeclAmmo **)&decl[1].name.str[28 * v16]);
        }
      }
    }
    result->type = SWF_VAR_UNDEF;
    idStr::FreeData(this: v29);
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
  }
  return result;
}


// ========================================================================
// __unwind$518164
// EA  : 0x82E5DFD8
// RVA : 0x00E5DFD8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518164()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 192 + 96));
}


// ========================================================================
// __unwind$518161
// EA  : 0x82E5E000
// RVA : 0x00E5E000
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518161()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 192;
  if ( (*(_DWORD *)(v0 - 192 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 212));
  }
}


// ========================================================================
// `idPlayer::ShowInventory'::`42'::idSWFScriptFunction_PlayerInventory_SetInventoryScreen::Call
// EA  : 0x82E5E048
// RVA : 0x00E5E048
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_42_::idSWFScriptFunction_PlayerInventory_SetInventoryScreen::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        idSWFScriptVar **a4)
{
  idSWFScriptVar::swfScriptVarType type; // r11
  char v8; // r11
  bool v9; // zf

  if ( (int)a4[1] > 0 )
  {
    type = (*a4)->type;
    if ( type == SWF_VAR_FLOAT || type == SWF_VAR_INTEGER || (v9 = type != SWF_VAR_BOOL, v8 = 0, !v9) )
      v8 = 1;
    if ( v8 != 0 )
      *(_DWORD *)(thisObject->variables.num + 12732) = idSWFScriptVar::ToInteger(this: *a4);
  }
  if ( (int)a4[1] > 1 && (unsigned __int8)idSWFScriptVar::ToBool(this: *a4 + 1) != 0 )
    idPlayer::UpdateActiveJob(this: (idPlayer *)thisObject->variables.num);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`44'::idSWFScriptFunciton_TriggerEntity::Call
// EA  : 0x82E5E0F8
// RVA : 0x00E5E0F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_44_::idSWFScriptFunciton_TriggerEntity::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        __int64 parms,
        __int64 a4,
        __int64 a5)
{
  int v5; // r29
  _DWORD *v8; // r28
  int i; // r26
  idSWFScriptVar *v10; // r3
  idEntity *v11; // r30
  idStr v13[3]; // [sp+60h] [-70h] BYREF

  v5 = 0;
  v8 = (_DWORD *)parms;
  for ( i = 0; i < v8[1]; v5 += 8 )
  {
    v10 = idSWFScriptVar::ToString(this: (idSWFScriptVar *)v13, result: (idStr *)(*v8 + v5), a3: parms, a4, a5);
    v11 = gameLocal->FindEntity(this: gameLocal, a2: v10->value.i);
    idStr::FreeData(this: v13);
    if ( v11 != nullptr )
      idEntity::Activate(this: v11, activator: (idEntity *)thisObject->variables.num);
    ++i;
  }
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// __unwind$518373
// EA  : 0x82E5E1A4
// RVA : 0x00E5E1A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518373()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 208 + 96));
}


// ========================================================================
// `idPlayer::TakeViewNotes'::`2'::idSWFScriptFunction_WriteScreenCap::Call
// EA  : 0x82E5E1D8
// RVA : 0x00E5E1D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::TakeViewNotes_::_2_::idSWFScriptFunction_WriteScreenCap::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        __int64 parms,
        __int64 a4,
        __int64 a5)
{
  int v6; // r29
  idSWFScriptVar *v7; // r28
  size_t type; // r30
  __int64 v9; // r10
  __int64 v10; // r8
  __int64 v11; // r6
  idSWFScriptVar *v12; // r28
  size_t v13; // r29
  idStr *v14; // r25
  size_t len; // r28
  __int64 v16; // r6
  __int64 v17; // r10
  __int64 v18; // r8
  va *v19; // r3
  __int64 v20; // r10
  __int64 v21; // r8
  __int64 v22; // r6
  va *v23; // r3
  int v25; // [sp+8h] [-1108h]
  int v26; // [sp+8h] [-1108h]
  int v27; // [sp+Ch] [-1104h]
  int v28; // [sp+Ch] [-1104h]
  int v29; // [sp+10h] [-1100h]
  int v30; // [sp+10h] [-1100h]
  int v31; // [sp+14h] [-10FCh]
  int v32; // [sp+14h] [-10FCh]
  int v33; // [sp+18h] [-10F8h]
  int v34; // [sp+18h] [-10F8h]
  int v35; // [sp+1Ch] [-10F4h]
  int v36; // [sp+1Ch] [-10F4h]
  idStr v37; // [sp+60h] [-10B0h] BYREF
  idStr v38; // [sp+80h] [-1090h] BYREF
  idStr v39; // [sp+A0h] [-1070h] BYREF
  va v40; // [sp+C0h] [-1050h] BYREF

  v6 = parms;
  v7 = idSWFScriptVar::ToString(this: (idSWFScriptVar *)&v39, result: *(idStr **)parms, a3: parms, a4, a5);
  type = v7->type;
  idStr::EnsureAlloced(this: &viewNoteTitle, amount: v7->type + 1, keepold: false, geometricGrowth: false);
  memcpy(Dst: viewNoteTitle.data, Src: v7->value.object, Size: type);
  viewNoteTitle.data[type] = 0;
  viewNoteTitle.len = type;
  idStr::FreeData(this: &v39);
  v12 = idSWFScriptVar::ToString(
          this: (idSWFScriptVar *)&v37,
          result: (idStr *)(*(_DWORD *)v6 + 8),
          a3: v11,
          a4: v10,
          a5: v9);
  v13 = v12->type;
  idStr::EnsureAlloced(this: &viewNoteDescription, amount: v12->type + 1, keepold: false, geometricGrowth: false);
  memcpy(Dst: viewNoteDescription.data, Src: v12->value.object, Size: v13);
  viewNoteDescription.data[v13] = 0;
  viewNoteDescription.len = v13;
  idStr::FreeData(this: &v37);
  v14 = idHansoftReport::CombineLines(result: &v38, src: &viewNoteDescription);
  len = v14->len;
  idStr::EnsureAlloced(this: &viewNoteDescriptionLine, amount: v14->len + 1, keepold: false, geometricGrowth: false);
  memcpy(Dst: viewNoteDescriptionLine.data, Src: v14->data, Size: len);
  viewNoteDescriptionLine.data[len] = 0;
  viewNoteDescriptionLine.len = len;
  idStr::FreeData(this: &v38);
  cvarSystem->SetCVarBool(this: cvarSystem, a2: "con_noPrint", a3: false, a4: 0);
  cvarSystem->SetCVarBool(this: cvarSystem, a2: "con_drawWarnings", a3: false, a4: 0);
  console->ClearNotifyLines(this: console);
  HIDWORD(v16) = viewNoteTitle.data;
  v19 = va::va(
          this: &v40,
          fmt: "%s\n",
          a3: v16,
          a4: v18,
          a5: v17,
          a6: v25,
          a7: v27,
          a8: v29,
          a9: v31,
          a10: v33,
          a11: v35);
  idLib::Printf(fmt: v19->buffer);
  if ( common->IsMultiplayer(this: common) )
    HIDWORD(v22) = viewNoteDescriptionLine.data;
  else
    HIDWORD(v22) = viewNoteDescription.data;
  v23 = va::va(
          this: &v40,
          fmt: "%s\n",
          a3: v22,
          a4: v21,
          a5: v20,
          a6: v26,
          a7: v28,
          a8: v30,
          a9: v32,
          a10: v34,
          a11: v36);
  idLib::Printf(fmt: v23->buffer);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// __unwind$518429
// EA  : 0x82E5E3D0
// RVA : 0x00E5E3D0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518429()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4368 + 160));
}


// ========================================================================
// __unwind$518430
// EA  : 0x82E5E3F8
// RVA : 0x00E5E3F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518430()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4368 + 96));
}


// ========================================================================
// __unwind$518431
// EA  : 0x82E5E420
// RVA : 0x00E5E420
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518431()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4368 + 128));
}


// ========================================================================
// `idPlayer::TakeViewNotes'::`4'::idSWFScriptFunction_TakeViewNoteScreenCap::Call
// EA  : 0x82E5E450
// RVA : 0x00E5E450
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::TakeViewNotes_::_4_::idSWFScriptFunction_TakeViewNoteScreenCap::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  char v3; // r27
  const idStr *v6; // r3
  const idStr *v7; // r3
  __int64 v8; // r10
  __int64 v9; // r6
  __int64 v10; // r8
  va *v11; // r3
  int len; // r29
  const char *v13; // r4
  int v14; // r29
  __int64 v15; // r10
  __int64 v16; // r8
  __int64 v17; // r6
  va *v18; // r3
  idStr *Severity; // r28
  size_t v20; // r29
  char *data; // r4
  int v22; // r7
  int v23; // r6
  int v24; // r5
  char *v25; // r4
  int v27; // [sp+8h] [-1558h]
  int v28; // [sp+8h] [-1558h]
  int v29; // [sp+Ch] [-1554h]
  int v30; // [sp+Ch] [-1554h]
  int v31; // [sp+10h] [-1550h]
  int v32; // [sp+10h] [-1550h]
  int v33; // [sp+14h] [-154Ch]
  int v34; // [sp+14h] [-154Ch]
  int v35; // [sp+18h] [-1548h]
  int v36; // [sp+18h] [-1548h]
  int v37; // [sp+1Ch] [-1544h]
  int v38; // [sp+1Ch] [-1544h]
  idStr v39; // [sp+60h] [-1500h] BYREF
  idStr v40; // [sp+80h] [-14E0h] BYREF
  idStr v41; // [sp+A0h] [-14C0h] BYREF
  idStr v42; // [sp+C0h] [-14A0h] BYREF
  idStr v43; // [sp+E0h] [-1480h] BYREF
  idStr v44; // [sp+100h] [-1460h] BYREF
  char v45[1024]; // [sp+120h] [-1440h] BYREF
  va v46; // [sp+520h] [-1040h] BYREF

  v3 = 0;
  v6 = operator+(result: &v44, a: (const idStr *)&thisObject->variables.num, b: &viewNoteTitle);
  v7 = operator+(result: &v43, a: v6, b: &timeStampString);
  operator+(result: &v39, a: v7, b: ".jpg");
  idStr::FreeData(this: &v43);
  idStr::FreeData(this: &v44);
  HIDWORD(v8) = &unk_82360000;
  HIDWORD(v9) = v39.data;
  v11 = va::va(
          this: &v46,
          fmt: "screenshot \"%s\"\n",
          a3: v9,
          a4: v10,
          a5: v8,
          a6: v27,
          a7: v29,
          a8: v31,
          a9: v33,
          a10: v35,
          a11: v37);
  cmdSystem->ExecuteCommandText(this: cmdSystem, a2: v11->buffer);
  if ( g_viewNoteDevTrack.valueInteger == 1 )
  {
    fileSystem->RelativePathToOSPath_2(this: fileSystem, a2: v39.data, a3: v45, a4: 1024, a5: FSPATH_SAVE);
    len = viewNoteTitle.len;
    idStr::EnsureAlloced(this: &reportData.title, amount: viewNoteTitle.len + 1, keepold: false, geometricGrowth: false);
    memcpy(Dst: reportData.title.data, Src: viewNoteTitle.data, Size: len);
    reportData.title.data[len] = 0;
    reportData.title.len = len;
    if ( g_viewNoteType.valueInteger != 0 )
      v13 = "Bug";
    else
      v13 = "Task";
    idStr::operator=(this: &reportData.style, text: v13);
    v14 = viewNoteStepsToReproduce.len;
    idStr::EnsureAlloced(
      this: &reportData.steps,
      amount: viewNoteStepsToReproduce.len + 1,
      keepold: false,
      geometricGrowth: false);
    memcpy(Dst: reportData.steps.data, Src: viewNoteStepsToReproduce.data, Size: v14);
    LODWORD(v15) = &pb_ss_UpdateAfterPhysics.name;
    HIDWORD(v15) = &unk_82360000;
    LODWORD(v16) = &viewNoteDescription;
    reportData.steps.data[v14] = 0;
    reportData.steps.len = v14;
    LODWORD(v17) = thisObject->variablesHash[6];
    HIDWORD(v17) = viewNoteDescription.data;
    v18 = va::va(
            this: &v46,
            fmt: "%s\r\nsetviewpos %s",
            a3: v17,
            a4: v16,
            a5: v15,
            a6: v28,
            a7: v30,
            a8: v32,
            a9: v34,
            a10: v36,
            a11: v38);
    idStr::operator=(this: &reportData.details, text: v18);
    Severity = idReportData::GetSeverity(result: &v40, index: g_viewNotePriority.valueInteger);
    v20 = Severity->len;
    idStr::EnsureAlloced(this: &reportData.severity, amount: Severity->len + 1, keepold: false, geometricGrowth: false);
    memcpy(Dst: reportData.severity.data, Src: Severity->data, Size: v20);
    reportData.severity.data[v20] = 0;
    reportData.severity.len = v20;
    idStr::FreeData(this: &v40);
    if ( common->IsMultiplayer(this: common) )
    {
      v3 = 1;
      data = idReportData::GetDevGroup(result: &v41, index: g_viewNoteComponent.valueInteger)->data;
    }
    else
    {
      data = "Viewnote";
    }
    idStr::operator=(this: &reportData.component, text: data);
    if ( (v3 & 1) != 0 )
    {
      v3 &= ~1u;
      idStr::FreeData(this: &v41);
    }
    if ( common->IsMultiplayer(this: common) )
    {
      v25 = &byte_8200D768;
    }
    else
    {
      v3 |= 2u;
      v25 = idReportData::GetReproduced(result: &v42, index: g_viewNoteRepeat.valueInteger, a3: v24, a4: v23, a5: v22)->data;
    }
    idStr::operator=(this: &reportData.reproduced, text: v25);
    if ( (v3 & 2) != 0 )
      idStr::FreeData(this: &v42);
    idStr::operator=(this: &reportData.attachFilename, text: v45);
    idReportData::Format(this: &reportData);
  }
  result->type = SWF_VAR_UNDEF;
  idStr::FreeData(this: &v39);
  return result;
}


// ========================================================================
// __unwind$518547
// EA  : 0x82E5E778
// RVA : 0x00E5E778
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518547()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5472 + 256));
}


// ========================================================================
// __unwind$518548
// EA  : 0x82E5E7A0
// RVA : 0x00E5E7A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518548()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5472 + 224));
}


// ========================================================================
// __unwind$518549
// EA  : 0x82E5E7C8
// RVA : 0x00E5E7C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518549()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5472 + 96));
}


// ========================================================================
// __unwind$518550
// EA  : 0x82E5E7F0
// RVA : 0x00E5E7F0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518550()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5472 + 128));
}


// ========================================================================
// __unwind$518552
// EA  : 0x82E5E818
// RVA : 0x00E5E818
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518552()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 5472;
  if ( (*(_DWORD *)(v0 - 5472 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v1 + 160));
  }
}


// ========================================================================
// __unwind$518555
// EA  : 0x82E5E85C
// RVA : 0x00E5E85C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518555()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 5472;
  if ( (*(_DWORD *)(v0 - 5472 + 80) & 2) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~2u;
    idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v1 + 192));
  }
}


// ========================================================================
// __unwind$518558
// EA  : 0x82E5E8A0
// RVA : 0x00E5E8A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518558()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 5472;
  if ( (*(_DWORD *)(v0 - 5472 + 80) & 4) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~4u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 5492));
  }
}


// ========================================================================
// `idPlayer::TakeViewNotes'::`5'::idSWFScriptFunction_CloseTakeViewNotes::Call
// EA  : 0x82E5E8E8
// RVA : 0x00E5E8E8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::TakeViewNotes_::_5_::idSWFScriptFunction_CloseTakeViewNotes::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idCVar::SetBool(this: &g_showHud, newValue: true, force: true);
  idCVar::SetBool(this: &g_stopTime, newValue: false, force: true);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`4'::idSWFScriptFunction_PlayerGarage_EquipItem::Call
// EA  : 0x82E5E950
// RVA : 0x00E5E950
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_4_::idSWFScriptFunction_PlayerGarage_EquipItem::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  idSWFScriptVar *v4; // r27
  int v7; // r28
  __int64 v8; // r10
  __int64 v9; // r8
  __int64 v10; // r6
  idInventoryCollection *v11; // r3
  idJobManager *v12; // r30
  idGuiListBox *InventoryItemForQuickSlot; // r3
  idGuiListBox *InventoryItemByDeclName; // r3
  idStr v15[2]; // [sp+60h] [-50h] BYREF

  v4 = result;
  if ( *(_DWORD *)(a4 + 4) == 2 )
  {
    v7 = idSWFScriptVar::ToInteger(this: *(idSWFScriptVar **)a4);
    idSWFScriptVar::ToString(this: (idSWFScriptVar *)v15, result: (idStr *)(*(_DWORD *)a4 + 8), a3: v10, a4: v9, a5: v8);
    v11 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.size + 468))(a1: thisObject->variables.size);
    v12 = (idJobManager *)v11;
    if ( v11 != nullptr )
    {
      InventoryItemForQuickSlot = (idGuiListBox *)idInventoryCollection::GetInventoryItemForQuickSlot(
                                                    this: v11,
                                                    slotGroup: QUICKSLOTGROUP_VEHICLE,
                                                    slot: v7,
                                                    numSlots: 4);
      if ( InventoryItemForQuickSlot != nullptr )
        idGuiListBox::DidActionRow(this: InventoryItemForQuickSlot, actionRow: -1);
      InventoryItemByDeclName = (idGuiListBox *)idInventoryCollection::FindInventoryItemByDeclName(
                                                  this: v12,
                                                  jobName: v15[0].data);
      if ( InventoryItemByDeclName != nullptr )
        idGuiListBox::DidActionRow(this: InventoryItemByDeclName, actionRow: v7);
    }
    v4->type = SWF_VAR_UNDEF;
    idStr::FreeData(this: v15);
    return v4;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
  }
  return result;
}


// ========================================================================
// __unwind$518740
// EA  : 0x82E5EA2C
// RVA : 0x00E5EA2C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518740()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 176;
  if ( (*(_DWORD *)(v0 - 176 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 196));
  }
}


// ========================================================================
// __unwind$518743
// EA  : 0x82E5EA70
// RVA : 0x00E5EA70
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518743()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 176 + 96));
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`7'::idSWFScriptFunction_PlayerGarage_ExitGarageToTown::Call
// EA  : 0x82E5EA98
// RVA : 0x00E5EA98
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_7_::idSWFScriptFunction_PlayerGarage_ExitGarageToTown::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4,
        __int64 a5,
        __int64 a6)
{
  int v8; // r3
  int v9; // r3
  int v10; // r3
  int v11; // r3
  int num; // r10
  int v13; // r3
  int v14; // r3
  idPlayerStart *ExitLocation; // r30
  int v16; // r3
  double y; // fp12
  double v18; // fp11
  int v19; // r3
  const idAngles *v20; // r4
  idPlayer *v21; // r3
  idEntity *v22; // r30
  idEntity *ExitTarget; // r3
  float v25[4]; // [sp+50h] [-70h] BYREF
  idAngles v26; // [sp+60h] [-60h] BYREF
  idMat3 v27[2]; // [sp+70h] [-50h] BYREF

  idEventReceiver::PostEventMS(
    this: *(idEventReceiver **)&thisObject->variables.granularity,
    ev: &EV_Deactivate,
    time: 0,
    a4,
    a5,
    a6);
  v8 = *(_DWORD *)(thisObject->variables.num + 488);
  if ( v8 != 0 )
    v9 = (*(int (__fastcall **)(int))(*(_DWORD *)v8 + 104))(a1: v8);
  else
    v9 = 0;
  idPlayerHud::SetHudState(this: (idPlayerHud *)(v9 + 35096), state: HUDSTATE_ALL);
  v10 = *(_DWORD *)(thisObject->variables.num + 488);
  if ( v10 != 0 )
    v11 = (*(int (__fastcall **)(int))(*(_DWORD *)v10 + 104))(a1: v10);
  else
    v11 = 0;
  num = thisObject->variables.num;
  *(idColor *)(v11 + 19068) = idColor::colorBlack;
  v27[0].mat[1].y = 0.0;
  v27[0].mat[1].z = 0.0;
  v27[0].mat[2].x = 0.0;
  v27[0].mat[2].y = 0.0;
  v13 = *(_DWORD *)(num + 488);
  if ( v13 != 0 )
    v14 = (*(int (__fastcall **)(int))(*(_DWORD *)v13 + 104))(a1: v13);
  else
    v14 = 0;
  idView::Fade(this: (idView *)(v14 + 16224), color: (const idVec4 *)&v27[0].mat[1].y, time: 2000);
  if ( idTownGarageCamera::GetExitLocation(this: *(idTownGarageCamera **)&thisObject->variables.granularity) != nullptr )
  {
    ExitLocation = idTownGarageCamera::GetExitLocation(this: *(idTownGarageCamera **)&thisObject->variables.granularity);
    idMat3::ToAngles(this: v27, result: (idAngles *)&ExitLocation->spawnOrientation);
    v16 = thisObject->variables.num;
    y = ExitLocation->spawnPosition.y;
    v18 = (float)(ExitLocation->spawnPosition.z + (float)5.0);
    v25[0] = ExitLocation->spawnPosition.x;
    v25[1] = y;
    v25[2] = v18;
    (*(void (__fastcall **)(int, float *, idMat3 *))(*(_DWORD *)v16 + 404))(a1: v16, a2: v25, a3: v27);
  }
  else
  {
    v19 = *(_DWORD *)(thisObject->variables.num + 488);
    if ( v19 != 0 )
      v20 = (const idAngles *)(*(int (__fastcall **)(int))(*(_DWORD *)v19 + 104))(a1: v19);
    else
      v20 = nullptr;
    idPresentablePlayer::GetViewAngles(this: (idPresentablePlayer *)&v26, result: v20, includeWeaponKick: true);
    v21 = (idPlayer *)thisObject->variables.num;
    v26.yaw = 90.0;
    idPlayer::SetViewAngles(this: v21, angles: &v26, force: true);
  }
  if ( idTownGarageCamera::GetExitTarget(this: *(idTownGarageCamera **)&thisObject->variables.granularity) != nullptr )
  {
    v22 = (idEntity *)thisObject->variables.num;
    ExitTarget = idTownGarageCamera::GetExitTarget(this: *(idTownGarageCamera **)&thisObject->variables.granularity);
    idEntity::Activate(this: ExitTarget, activator: v22);
  }
  *(_BYTE *)(thisObject->variables.num + 12293) = 0;
  idKeyInput::ClearStates();
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`8'::idSWFScriptFunction_PlayerGarage_ExitGarageToWasteland::Call
// EA  : 0x82E5ECA8
// RVA : 0x00E5ECA8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_8_::idSWFScriptFunction_PlayerGarage_ExitGarageToWasteland::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4,
        __int64 a5,
        __int64 a6)
{
  int v8; // r3
  int v9; // r3
  __int64 v10; // r10
  int v11; // r8
  void (__fastcall **v12)(idPhysics_StaticMulti *__hidden, int); // r7
  idTownGarageCamera *WastelandExitLocation; // r28
  idTownGarageCamera *WastelandExitMap; // r3
  __int64 v15; // r8
  va *v16; // r3
  idVehicleKey *CurrentKey; // r3
  int v19; // [sp+8h] [-1108h]
  int v20; // [sp+Ch] [-1104h]
  int v21; // [sp+10h] [-1100h]
  int v22; // [sp+14h] [-10FCh]
  int v23; // [sp+18h] [-10F8h]
  int v24; // [sp+1Ch] [-10F4h]
  idStr v25; // [sp+60h] [-10B0h] BYREF
  idStr v26; // [sp+80h] [-1090h] BYREF
  idTownGarageCamera v27[3]; // [sp+A0h] [-1070h] BYREF

  idEventReceiver::PostEventMS(
    this: *(idEventReceiver **)&thisObject->variables.granularity,
    ev: &EV_Deactivate,
    time: 0,
    a4,
    a5,
    a6);
  v8 = *(_DWORD *)(thisObject->variables.num + 488);
  if ( v8 != 0 )
    v9 = (*(int (__fastcall **)(int))(*(_DWORD *)v8 + 104))(a1: v8);
  else
    v9 = 0;
  idView::Fade(this: (idView *)(v9 + 16224), color: (const idVec4 *)&idColor::colorBlack, time: 0);
  LODWORD(v10) = v25.baseBuffer;
  v25.len = 0;
  v25.allocedAndFlag = 20;
  v25.data = v25.baseBuffer;
  v25.baseBuffer[0] = 0;
  HIDWORD(v10) = v26.baseBuffer;
  v26.allocedAndFlag = 20;
  v26.data = v26.baseBuffer;
  v26.len = 0;
  v26.baseBuffer[0] = 0;
  idGameLayerManager::GetLayerStrings(
    this: (idGameLayerManager *)(thisObject->variables.num + 12576),
    activeLayerString: &v25,
    deactiveLayerString: &v26,
    propagateTheNextMapLayers: 1,
    a5: v12,
    layerState: v11,
    a7: v10);
  WastelandExitLocation = idTownGarageCamera::GetWastelandExitLocation(
                            this: (idTownGarageCamera *)&v27[0].name.baseBuffer[8],
                            result: *(idStr **)&thisObject->variables.granularity);
  WastelandExitMap = idTownGarageCamera::GetWastelandExitMap(
                       this: v27,
                       result: *(idStr **)&thisObject->variables.granularity);
  HIDWORD(v15) = WastelandExitLocation->listenerList;
  LODWORD(v15) = &byte_8200D768;
  v16 = va::va(
          this: (va *)&v27[0].spawnOrientation.mat[0].z,
          fmt: "nextmap %d \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n",
          a3: (unsigned int)WastelandExitMap->listenerList,
          a4: v15,
          a5: __SPAIR64__((unsigned int)v25.data, (unsigned int)v26.data),
          a6: v19,
          a7: v20,
          a8: v21,
          a9: v22,
          a10: v23,
          a11: v24);
  cmdSystem->AppendCommandText(this: cmdSystem, a2: v16->buffer);
  idStr::FreeData(this: (idStr *)v27);
  idStr::FreeData(this: (idStr *)&v27[0].name.baseBuffer[8]);
  CurrentKey = idTownGarageCamera::GetCurrentKey(this: *(idTownGarageCamera **)&thisObject->variables.granularity);
  if ( CurrentKey != nullptr )
    CurrentKey->enterVehicle = true;
  else
    idLib::Warning(fmt: "no key set in exit garage to wasteland");
  *(_BYTE *)(thisObject->variables.num + 12293) = 0;
  result->type = SWF_VAR_UNDEF;
  idStr::FreeData(this: &v26);
  idStr::FreeData(this: &v25);
  return result;
}


// ========================================================================
// __unwind$518978
// EA  : 0x82E5EE30
// RVA : 0x00E5EE30
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518978()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4368 + 96));
}


// ========================================================================
// __unwind$518979
// EA  : 0x82E5EE58
// RVA : 0x00E5EE58
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518979()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4368 + 128));
}


// ========================================================================
// __unwind$518980
// EA  : 0x82E5EE80
// RVA : 0x00E5EE80
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518980()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4368 + 192));
}


// ========================================================================
// __unwind$518981
// EA  : 0x82E5EEA8
// RVA : 0x00E5EEA8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518981()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4368 + 160));
}


// ========================================================================
// __unwind$518982
// EA  : 0x82E5EED0
// RVA : 0x00E5EED0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_518982()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 4368;
  if ( (*(_DWORD *)(v0 - 4368 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 4388));
  }
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`26'::idSWFScriptFunction_PlayerGarage_ZoomToTrophy::Call
// EA  : 0x82E5EF18
// RVA : 0x00E5EF18
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_26_::idSWFScriptFunction_PlayerGarage_ZoomToTrophy::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idTownGarageCamera::GoToTrophy(this: (idTownGarageCamera *)thisObject->variables.num);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`27'::idSWFScriptFunction_PlayerGarage_ZoomFromTrohpy::Call
// EA  : 0x82E5EF58
// RVA : 0x00E5EF58
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_27_::idSWFScriptFunction_PlayerGarage_ZoomFromTrohpy::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idTownGarageCamera::GoToCar(this: (idTownGarageCamera *)thisObject->variables.num);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`28'::idSWFScriptFunction_PlayerGarage_ToggleCarTrophyView::Call
// EA  : 0x82E5EF98
// RVA : 0x00E5EF98
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_28_::idSWFScriptFunction_PlayerGarage_ToggleCarTrophyView::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idTownGarageCamera::ToggleCarTrophyView(this: (idTownGarageCamera *)thisObject->variables.num);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`29'::idSWFScriptFunction_PlayerGarage_ToggleGarageBlur::Call
// EA  : 0x82E5EFD8
// RVA : 0x00E5EFD8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_29_::idSWFScriptFunction_PlayerGarage_ToggleGarageBlur::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  int v7; // r3
  int v8; // r3
  double v9; // fp2
  double v10; // fp1
  int v11; // r3

  if ( thisObject->variables.num != 0 )
  {
    if ( *(int *)(a4 + 4) > 0 && (unsigned __int8)idSWFScriptVar::ToBool(this: *(idSWFScriptVar **)a4) != 0 )
    {
      v7 = *(_DWORD *)(thisObject->variables.num + 488);
      if ( v7 != 0 )
        v8 = (*(int (__fastcall **)(int))(*(_DWORD *)v7 + 104))(a1: v7);
      else
        v8 = 0;
      v9 = 2.5;
      v10 = 0.0;
LABEL_14:
      idView::ForceBlurValues(this: (idView *)(v8 + 16224), blurBegin: v10, blurEnd: v9, blurTime: 250.0);
      goto LABEL_15;
    }
    if ( *(int *)(a4 + 4) > 0 && (unsigned __int8)idSWFScriptVar::ToBool(this: *(idSWFScriptVar **)a4) == 0 )
    {
      v11 = *(_DWORD *)(thisObject->variables.num + 488);
      if ( v11 != 0 )
        v8 = (*(int (__fastcall **)(int))(*(_DWORD *)v11 + 104))(a1: v11);
      else
        v8 = 0;
      v9 = 0.0;
      v10 = 2.5;
      goto LABEL_14;
    }
  }
LABEL_15:
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// ?OfferJob@idPlayer@@QAAXPBVidDeclJob@@PAVidAI2@@_N@Z
// EA  : 0x82E5F400
// RVA : 0x00E5F400
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::OfferJob(idPlayer *this, idStrId *job, idAI2 *offeringEntity, bool skipActivate)
{
  BOOL v8; // r21
  idPresentable *presentable; // r3
  idPresentablePlayer *v10; // r3
  idSWF *PlayerGui; // r30
  idPresentable *v12; // r3
  idPresentablePlayer *v13; // r3
  idSWFScriptFunction *v14; // r3
  idSWFScriptFunction *v15; // r4
  idSWFScriptFunction *v16; // r3
  idSWFScriptFunction *v17; // r4
  idSWFScriptFunction *v18; // r3
  idSWFScriptFunction *v19; // r4
  idSWFScriptFunction *v20; // r3
  idSWFScriptFunction *v21; // r4
  idDeclJob *JobName; // r3
  idSWFScriptVar::swfScriptVarValue_t v23; // r23
  idDeclJob::jobGiverFaction_t index; // r23
  bool v25; // r20
  idSWFScriptFunction *v26; // r3
  idSWFScriptFunction *v27; // r4
  idSWFScriptFunction *v28; // r3
  idSWFScriptFunction *v29; // r4
  idSWFScriptFunction *v30; // r3
  idSWFScriptFunction *v31; // r4
  int entityNumber; // [sp+50h] [-D0h] BYREF
  idSWFScriptVar v33; // [sp+58h] [-C8h] BYREF
  idSWFScriptVar v34; // [sp+60h] [-C0h] BYREF
  idSWFScriptVar v35; // [sp+68h] [-B8h] BYREF
  idSWFScriptVar v36; // [sp+70h] [-B0h] BYREF
  idSWFScriptVar v37; // [sp+78h] [-A8h] BYREF
  idSWFScriptVar v38; // [sp+80h] [-A0h] BYREF
  idSWFScriptVar v39; // [sp+88h] [-98h] BYREF
  idSWFScriptVar v40; // [sp+90h] [-90h] BYREF
  idSWFScriptVar v41; // [sp+98h] [-88h] BYREF
  idSWFScriptVar v42; // [sp+A0h] [-80h] BYREF
  idSWFScriptVar v43; // [sp+A8h] [-78h] BYREF
  idSWFScriptVar v44[14]; // [sp+B0h] [-70h] BYREF

  if ( idDeclJob::ShowsGUI(this: (idDeclJob *)job) )
  {
    if ( offeringEntity != nullptr )
    {
      idAI2::SetupInteractionView(this: offeringEntity, player: this);
      entityNumber = offeringEntity->entityNumber;
      this->guiInteractionEntity.spawnId.value = (gameLocal->spawnIds.ptr[entityNumber] << 13) | entityNumber;
    }
    else
    {
      this->guiInteractionEntity.spawnId.value = 0x1FFF;
    }
    v8 = skipActivate;
    if ( !skipActivate )
      this->lastOfferChoice = OFFERCHOICE_UNKNOWN;
    presentable = this->presentable;
    if ( presentable != nullptr )
      v10 = presentable->GetPlayerInterface_2(this: presentable);
    else
      v10 = nullptr;
    PlayerGui = idPresentablePlayer::GetPlayerGui(this: v10, g: GUI_JOBOFFER);
    if ( v8 )
    {
      v12 = this->presentable;
      if ( v12 != nullptr )
        v13 = v12->GetPlayerInterface_2(this: v12);
      else
        v13 = nullptr;
      PlayerGui = idPresentablePlayer::GetPlayerGui(this: v13, g: GUI_JOBBOARD);
    }
    v14 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x14u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v14 != nullptr )
    {
      v14[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v14[4].__vftable = (idSWFScriptFunction_vtbl *)job;
      v15 = v14;
      v14[3].__vftable = (idSWFScriptFunction_vtbl *)offeringEntity;
      v14[1].__vftable = nullptr;
      v14->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferJob'::`2'::idSWFScriptFunction_AcceptJob::`vftable';
    }
    else
    {
      v15 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v38, nf: v15);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "acceptJob", value: &v38);
    idSWFScriptVar::Free(this: &v38);
    v16 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x14u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v16 != nullptr )
    {
      v16[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v16[4].__vftable = (idSWFScriptFunction_vtbl *)job;
      v17 = v16;
      v16[3].__vftable = (idSWFScriptFunction_vtbl *)offeringEntity;
      v16[1].__vftable = nullptr;
      v16->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferJob'::`3'::idSWFScriptFunction_ReallyAcceptJob::`vftable';
    }
    else
    {
      v17 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v39, nf: v17);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "reallyAcceptJob", value: &v39);
    idSWFScriptVar::Free(this: &v39);
    v18 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x14u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v18 != nullptr )
    {
      v18[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v18[4].__vftable = (idSWFScriptFunction_vtbl *)job;
      v19 = v18;
      v18[3].__vftable = (idSWFScriptFunction_vtbl *)offeringEntity;
      v18[1].__vftable = nullptr;
      v18->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferJob'::`4'::idSWFScriptFunction_DeclineJob::`vftable';
    }
    else
    {
      v19 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v40, nf: v19);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "declineJob", value: &v40);
    idSWFScriptVar::Free(this: &v40);
    v20 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x10u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v20 != nullptr )
    {
      v20[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v20[3].__vftable = (idSWFScriptFunction_vtbl *)offeringEntity;
      v21 = v20;
      v20[1].__vftable = nullptr;
      v20->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferJob'::`5'::idSWFScriptFunction_EndInteractionView::`vftable';
    }
    else
    {
      v21 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v41, nf: v21);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "endInteractionView", value: &v41);
    idSWFScriptVar::Free(this: &v41);
    JobName = idDeclJob::GetJobName(this: (idDeclJob *)&entityNumber, result: job);
    v33.type = SWF_VAR_UNDEF;
    *(idDeclJob_vtbl **)&v23.f = JobName->__vftable;
    idSWFScriptVar::Free(this: &v33);
    v33.value = v23;
    v33.type = SWF_VAR_STRINGID;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "jobName", value: &v33);
    idSWFScriptVar::Free(this: &v33);
    v34.type = SWF_VAR_UNDEF;
    index = job[232].index;
    idSWFScriptVar::Free(this: &v34);
    v34.value.i = index;
    v34.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "jobFaction", value: &v34);
    idSWFScriptVar::Free(this: &v34);
    v35.type = SWF_VAR_UNDEF;
    v25 = BYTE1(job[26].index);
    idSWFScriptVar::Free(this: &v35);
    v35.value.b = v25;
    v35.type = SWF_VAR_BOOL;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "acceptNeedsVerification", value: &v35);
    idSWFScriptVar::Free(this: &v35);
    v26 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x10u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v26 != nullptr )
    {
      v26[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v26[3].__vftable = (idSWFScriptFunction_vtbl *)job;
      v27 = v26;
      v26[1].__vftable = nullptr;
      v26->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferJob'::`6'::idSWFScriptFunction_GetJobDesc::`vftable';
    }
    else
    {
      v27 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v42, nf: v27);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "jobDescription", value: &v42);
    idSWFScriptVar::Free(this: &v42);
    v36.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v36);
    v36.type = SWF_VAR_BOOL;
    v36.value.b = true;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "canCloseGuiDefined", value: &v36);
    idSWFScriptVar::Free(this: &v36);
    v28 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0xCu,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v28 != nullptr )
    {
      v28[2].__vftable = (idSWFScriptFunction_vtbl *)offeringEntity;
      v28[1].__vftable = nullptr;
      v29 = v28;
      v28->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferJob'::`7'::idSWFScriptFunction_AIAllowsCanCloseGUI::`vftable';
    }
    else
    {
      v29 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v43, nf: v29);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "CanCloseGui", value: &v43);
    idSWFScriptVar::Free(this: &v43);
    v30 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 8u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v30 != nullptr )
    {
      v30[1].__vftable = nullptr;
      v31 = v30;
      v30->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferJob'::`8'::idSWFScriptFunction_deactivateBlankCallback::`vftable';
    }
    else
    {
      v31 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: v44, nf: v31);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "deactivateCallBack", value: v44);
    idSWFScriptVar::Free(this: v44);
    if ( !v8 )
    {
      v37.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v37);
      v37.type = SWF_VAR_BOOL;
      v37.value.b = false;
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "isBounty", value: &v37);
      idSWFScriptVar::Free(this: &v37);
      idSWF::Activate(this: PlayerGui, b: true);
    }
  }
  else
  {
    this->lastOfferChoice = OFFERCHOICE_ACCEPTED;
    idJobManager::AcceptJob(this: &this->jobManager, jobDecl: job, completeTree: false, force: false);
  }
}


// ========================================================================
// __unwind$519689
// EA  : 0x82E5F980
// RVA : 0x00E5F980
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519689()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 128));
}


// ========================================================================
// __unwind$519691
// EA  : 0x82E5F9A8
// RVA : 0x00E5F9A8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519691()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 136));
}


// ========================================================================
// __unwind$519693_0
// EA  : 0x82E5F9D0
// RVA : 0x00E5F9D0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519693_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 144));
}


// ========================================================================
// __unwind$519695
// EA  : 0x82E5F9F8
// RVA : 0x00E5F9F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519695()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 152));
}


// ========================================================================
// __unwind$519696
// EA  : 0x82E5FA20
// RVA : 0x00E5FA20
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519696()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 88));
}


// ========================================================================
// __unwind$519697
// EA  : 0x82E5FA48
// RVA : 0x00E5FA48
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519697()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 96));
}


// ========================================================================
// __unwind$519698
// EA  : 0x82E5FA70
// RVA : 0x00E5FA70
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519698()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 104));
}


// ========================================================================
// __unwind$519700
// EA  : 0x82E5FA98
// RVA : 0x00E5FA98
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519700()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 160));
}


// ========================================================================
// __unwind$519701
// EA  : 0x82E5FAC0
// RVA : 0x00E5FAC0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519701()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 112));
}


// ========================================================================
// __unwind$519703
// EA  : 0x82E5FAE8
// RVA : 0x00E5FAE8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519703()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 168));
}


// ========================================================================
// __unwind$519705
// EA  : 0x82E5FB10
// RVA : 0x00E5FB10
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519705()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 176));
}


// ========================================================================
// __unwind$519706
// EA  : 0x82E5FB38
// RVA : 0x00E5FB38
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_519706()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 288 + 120));
}


// ========================================================================
// `idPlayer::OfferJob'::`6'::idSWFScriptFunction_GetJobDesc::Call
// EA  : 0x82E5FB68
// RVA : 0x00E5FB68
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferJob_::_6_::idSWFScriptFunction_GetJobDesc::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  char *LocalizedString; // r3
  char *v6; // r3
  char *v7; // r3
  idStrId v9; // [sp+50h] [-50h] BYREF
  idStrId v10; // [sp+54h] [-4Ch] BYREF
  idStrId v11; // [sp+58h] [-48h] BYREF
  int v12; // [sp+5Ch] [-44h]
  idStr v13[2]; // [sp+60h] [-40h] BYREF

  v12 = 0;
  v13[0].allocedAndFlag = 20;
  v13[0].data = v13[0].baseBuffer;
  v13[0].len = 0;
  v13[0].baseBuffer[0] = 0;
  idDeclJob::GetJobSummary(this: (idDeclJob *)&v11, result: (idStrId *)thisObject->variables.size);
  idDeclJob::GetJobRequirements(this: (idDeclJob *)&v9, result: (idStrId *)thisObject->variables.size);
  idDeclJob::GetJobReward(this: (idDeclJob *)&v10, result: (idStrId *)thisObject->variables.size);
  LocalizedString = (char *)idStrId::GetLocalizedString(this: &v11);
  idStr::Append(this: v13, text: LocalizedString);
  if ( v9.index >= 0 )
  {
    idStr::Append(this: v13, text: "\n");
    idStr::Append(this: v13, text: "\n");
    v6 = (char *)idStrId::GetLocalizedString(this: &v9);
    idStr::Append(this: v13, text: v6);
  }
  if ( v10.index >= 0 )
  {
    idStr::Append(this: v13, text: "\n");
    idStr::Append(this: v13, text: "\n");
    v7 = (char *)idStrId::GetLocalizedString(this: &v10);
    idStr::Append(this: v13, text: v7);
  }
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->type = SWF_VAR_STRING;
  result->value.i = (int)idSWFScriptString::Alloc(s: v13);
  v12 = 1;
  idStr::FreeData(this: v13);
  return result;
}


// ========================================================================
// __unwind$520169
// EA  : 0x82E5FC90
// RVA : 0x00E5FC90
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520169()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 160 + 96));
}


// ========================================================================
// __unwind$520170
// EA  : 0x82E5FCB8
// RVA : 0x00E5FCB8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520170()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 160;
  if ( (*(_DWORD *)(v0 - 160 + 92) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 92) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 180));
  }
}


// ========================================================================
// `idPlayer::OfferJob'::`7'::idSWFScriptFunction_AIAllowsCanCloseGUI::Call
// EA  : 0x82E5FD00
// RVA : 0x00E5FD00
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferJob_::_7_::idSWFScriptFunction_AIAllowsCanCloseGUI::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int num; // r11
  int valueInteger; // r29
  int v7; // r28
  int v9; // r30
  int v10; // r3

  num = thisObject->variables.num;
  if ( num == 0 || ai_fastJobInteraction.valueInteger != 0 )
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = true;
    result->type = SWF_VAR_BOOL;
    return result;
  }
  else if ( job_interuptVO.valueInteger != 0
         && (valueInteger = job_interuptVOTime.valueInteger,
             (v7 = *(_DWORD *)(num + 59172)) + valueInteger <= gameLocal->GetGameMs(
                                                                 this: gameLocal,
                                                                 a2: GAMETIME_SCALED)) )
  {
    idSWFScriptVar::idSWFScriptVar(this: result, b: true);
    return result;
  }
  else
  {
    v9 = *(_DWORD *)(thisObject->variables.num + 59168);
    v10 = gameLocal->GetGameMs(this: gameLocal, a2: GAMETIME_SCALED);
    idSWFScriptVar::idSWFScriptVar(this: result, b: v10 >= v9);
    return result;
  }
}


// ========================================================================
// ?ShowJobBoard@idPlayer@@QAAXABV?$idList@PBVidDeclJob@@$04@@@Z
// EA  : 0x82E5FE20
// RVA : 0x00E5FE20
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::ShowJobBoard(idPlayer *this, const idList<idDeclJob const *,5> *jobDecls)
{
  idSWFScriptObject *v4; // r17
  int v5; // r18
  int v6; // r15
  int v7; // r25
  const idDeclJob *v8; // r29
  idJob *JobByDecl; // r3
  idSWFScriptObject *v10; // r30
  idDeclJob *JobName; // r3
  idSWFScriptVar::swfScriptVarValue_t v12; // r14
  idDeclJob *JobSummary; // r3
  idSWFScriptVar::swfScriptVarValue_t v14; // r14
  int count; // r14
  idSWFScriptVar *v16; // r3
  idSWFScriptFunction *v17; // r3
  idSWFScriptFunction *v18; // r4
  idPresentable *presentable; // r3
  idPresentablePlayer *v21; // r3
  idSWF *PlayerGui; // r3
  idSWF *v23; // r29
  _DWORD *v24; // r3
  idSWFScriptVar::swfScriptVarValue_t v25; // r30
  int v27; // [sp+5Ch] [-F4h] BYREF
  int v28; // [sp+60h] [-F0h] BYREF
  idSWFScriptVar v29; // [sp+68h] [-E8h] BYREF
  idSWFScriptVar v30; // [sp+70h] [-E0h] BYREF
  idSWFScriptVar v31; // [sp+78h] [-D8h] BYREF
  idSWFScriptVar v32; // [sp+80h] [-D0h] BYREF
  idSWFScriptVar v33; // [sp+88h] [-C8h] BYREF
  idSWFScriptVar v34; // [sp+90h] [-C0h] BYREF
  idSWFScriptVar v35; // [sp+98h] [-B8h] BYREF
  idSWFScriptVar v36; // [sp+A0h] [-B0h] BYREF
  idSWFScriptVar v37[21]; // [sp+A8h] [-A8h] BYREF

  v4 = idSWFScriptObject::Alloc();
  idSWFScriptObject::MakeArray(this: v4);
  v5 = 0;
  v6 = 0;
  if ( jobDecls->num > 0 )
  {
    v7 = 0;
    do
    {
      if ( jobDecls->list[v7] != nullptr )
      {
        v8 = jobDecls->list[v7];
        JobByDecl = idJobManager::FindJobByDecl(this: &this->jobManager, jobDecl: v8);
        if ( (JobByDecl == nullptr || JobByDecl->status <= (unsigned int)JOBSTATUS_FAILED)
          && (unsigned __int8)idJobManager::IsJobAvailable(this: &this->jobManager, jobDecl: v8) != 0 )
        {
          v10 = idSWFScriptObject::Alloc();
          JobName = idDeclJob::GetJobName(this: (idDeclJob *)&v27, result: (idStrId *)v8);
          v32.type = SWF_VAR_UNDEF;
          *(idDeclJob_vtbl **)&v12.f = JobName->__vftable;
          idSWFScriptVar::Free(this: &v32);
          v32.value = v12;
          v32.type = SWF_VAR_STRINGID;
          idSWFScriptObject::Set(this: v10, name: "name", value: &v32);
          idSWFScriptVar::Free(this: &v32);
          JobSummary = idDeclJob::GetJobSummary(this: (idDeclJob *)&v28, result: (idStrId *)v8);
          v33.type = SWF_VAR_UNDEF;
          *(idDeclJob_vtbl **)&v14.f = JobSummary->__vftable;
          idSWFScriptVar::Free(this: &v33);
          v33.value = v14;
          v33.type = SWF_VAR_STRINGID;
          idSWFScriptObject::Set(this: v10, name: "description", value: &v33);
          idSWFScriptVar::Free(this: &v33);
          if ( idDeclJob::GetNumJobRewards(this: v8) > 0 && idDeclJob::GetJobReward(this: v8, idx: 0) != nullptr )
          {
            count = idDeclJob::GetJobReward(this: v8, idx: 0)->count;
            v34.type = SWF_VAR_UNDEF;
            idSWFScriptVar::Free(this: &v34);
            v34.value.i = count;
            v34.type = SWF_VAR_INTEGER;
            idSWFScriptObject::Set(this: v10, name: "reward", value: &v34);
            v16 = &v34;
          }
          else
          {
            v35.type = SWF_VAR_UNDEF;
            idSWFScriptVar::Free(this: &v35);
            v35.type = SWF_VAR_INTEGER;
            v35.value.i = 0;
            idSWFScriptObject::Set(this: v10, name: "reward", value: &v35);
            v16 = &v35;
          }
          idSWFScriptVar::Free(this: v16);
          v17 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                         this: &mem,
                                         location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                         size: 0x10u,
                                         tag: TAG_SWF,
                                         zeroBuffer: false,
                                         align: ALIGN_16,
                                         heap: HEAP_DEFAULTHEAP);
          if ( v17 != nullptr )
          {
            v17[2].__vftable = (idSWFScriptFunction_vtbl *)v8;
            v18 = v17;
            v17[3].__vftable = (idSWFScriptFunction_vtbl *)this;
            v17[1].__vftable = nullptr;
            v17->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowJobBoard'::`2'::idSWFScriptFunction_JobBoardSelectJob::`vftable';
          }
          else
          {
            v18 = nullptr;
          }
          idSWFScriptVar::idSWFScriptVar(this: v37, nf: v18);
          idSWFScriptObject::Set(this: v10, name: "DoSelect", value: v37);
          idSWFScriptVar::Free(this: v37);
          v29.type = SWF_VAR_UNDEF;
          idSWFScriptVar::Free(this: &v29);
          if ( v10 != nullptr )
          {
            v29.value.i = (int)v10;
            v29.type = SWF_VAR_OBJECT;
            ++v10->refCount;
          }
          else
          {
            v29.type = SWF_VAR_NULL;
          }
          idSWFScriptObject::Set(this: v4, index: v5++, value: &v29);
          idSWFScriptVar::Free(this: &v29);
          if ( v10->refCount-- == 1 )
          {
            idSWFScriptObject::~idSWFScriptObject(this: v10);
            idMem::Free(this: &mem, ptr: v10, align: ALIGN_16);
          }
        }
      }
      ++v6;
      ++v7;
    }
    while ( v6 < jobDecls->num );
  }
  presentable = this->presentable;
  this->lastOfferChoice = OFFERCHOICE_UNKNOWN;
  if ( presentable != nullptr )
    v21 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v21 = nullptr;
  PlayerGui = idPresentablePlayer::GetPlayerGui(this: v21, g: GUI_JOBBOARD);
  v36.type = SWF_VAR_UNDEF;
  v23 = PlayerGui;
  idSWFScriptVar::Free(this: &v36);
  v36.type = SWF_VAR_BOOL;
  v36.value.b = true;
  idSWFScriptObject::Set(this: v23->globals, name: "isBounty", value: &v36);
  idSWFScriptVar::Free(this: &v36);
  v30.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v30);
  if ( v4 != nullptr )
  {
    v30.value.i = (int)v4;
    v30.type = SWF_VAR_OBJECT;
    ++v4->refCount;
  }
  else
  {
    v30.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: v23->globals, name: "jobs", value: &v30);
  idSWFScriptVar::Free(this: &v30);
  v24 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v24 != nullptr )
  {
    v24[2] = this;
    v24[1] = 0;
    v25.i = (int)v24;
    *v24 = &`idPlayer::ShowJobBoard'::`3'::idSWFScriptFunction_JobBoardDeactivateCallback::`vftable';
  }
  else
  {
    v25.i = 0;
  }
  v31.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v31);
  if ( v25.i != 0 )
  {
    v31.value = v25;
    v31.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v25.i + 8))(a1: v25.i);
  }
  else
  {
    v31.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: v23->globals, name: "deactivateCallBack", value: &v31);
  idSWFScriptVar::Free(this: &v31);
  idSWF::Activate(this: v23, b: true);
  if ( v4->refCount-- == 1 )
  {
    idSWFScriptObject::~idSWFScriptObject(this: v4);
    idMem::Free(this: &mem, ptr: v4, align: ALIGN_16);
  }
}


// ========================================================================
// __unwind$520317
// EA  : 0x82E602B4
// RVA : 0x00E602B4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520317()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 128));
}


// ========================================================================
// __unwind$520318
// EA  : 0x82E602DC
// RVA : 0x00E602DC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520318()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 136));
}


// ========================================================================
// __unwind$520319
// EA  : 0x82E60304
// RVA : 0x00E60304
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520319()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 144));
}


// ========================================================================
// __unwind$520320
// EA  : 0x82E6032C
// RVA : 0x00E6032C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520320()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 152));
}


// ========================================================================
// __unwind$520322
// EA  : 0x82E60354
// RVA : 0x00E60354
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520322()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 168));
}


// ========================================================================
// __unwind$520323
// EA  : 0x82E6037C
// RVA : 0x00E6037C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520323()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 104));
}


// ========================================================================
// __unwind$520324
// EA  : 0x82E603A4
// RVA : 0x00E603A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520324()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 160));
}


// ========================================================================
// __unwind$520325
// EA  : 0x82E603CC
// RVA : 0x00E603CC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520325()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 112));
}


// ========================================================================
// __unwind$520327
// EA  : 0x82E603F4
// RVA : 0x00E603F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520327()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 120));
}


// ========================================================================
// `idPlayer::ShowJobBoard'::`2'::idSWFScriptFunction_JobBoardSelectJob::Call
// EA  : 0x82E60420
// RVA : 0x00E60420
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowJobBoard_::_2_::idSWFScriptFunction_JobBoardSelectJob::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idPlayer::OfferJob(
    this: (idPlayer *)thisObject->variables.size,
    job: (idStrId *)thisObject->variables.num,
    offeringEntity: nullptr,
    skipActivate: true);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// ?OfferWares@idPlayer@@QAAXPBVaiPlayerInteraction_t@@PAVidAI2@@_N@Z
// EA  : 0x82E60478
// RVA : 0x00E60478
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::OfferWares(
        idPlayer *this,
        idSWFScriptFunction_vtbl *interaction,
        idAI2 *offeringAI,
        bool skipInteraction)
{
  BOOL v4; // r30
  idSWFScriptObject *v8; // r18
  idSWFScriptFunction *v9; // r3
  idSWFScriptFunction *v10; // r4
  idSWFScriptObject *v11; // r26
  idSWFScriptFunction *v12; // r3
  idSWFScriptFunction *v13; // r4
  idPresentable *presentable; // r3
  idPresentablePlayer *v15; // r3
  idSWF *PlayerGui; // r30
  bool isDynamicMerchant; // r16
  idSWFScriptFunction *v18; // r3
  idSWFScriptFunction *v19; // r4
  idSWFScriptFunction *v20; // r3
  idSWFScriptFunction *v21; // r4
  idSWFScriptFunction *v22; // r3
  idSWFScriptFunction *v23; // r4
  idSWFScriptFunction *v24; // r3
  idSWFScriptFunction *v25; // r4
  int vendorKeyIndex; // r23
  idSWFScriptFunction *v27; // r3
  idSWFScriptFunction *v28; // r4
  idSWFScriptFunction *v29; // r3
  idSWFScriptFunction *v30; // r4
  int index; // r24
  int v32; // r24
  idSWFScriptVar *v33; // r3
  idSWFScriptFunction *v34; // r3
  idSWFScriptFunction *v35; // r4
  idSWFScriptFunction *v36; // r3
  idSWFScriptFunction *v37; // r4
  int v38; // r28
  idSWFScriptFunction *v39; // r3
  idSWFScriptFunction *v40; // r4
  idSWFScriptVar v43; // [sp+58h] [-158h] BYREF
  idSWFScriptVar v44; // [sp+60h] [-150h] BYREF
  idSWFScriptVar v45; // [sp+68h] [-148h] BYREF
  idSWFScriptVar v46; // [sp+70h] [-140h] BYREF
  idSWFScriptVar v47; // [sp+78h] [-138h] BYREF
  idSWFScriptVar v48; // [sp+80h] [-130h] BYREF
  idSWFScriptVar v49; // [sp+88h] [-128h] BYREF
  idSWFScriptVar v50; // [sp+90h] [-120h] BYREF
  idSWFScriptVar v51; // [sp+98h] [-118h] BYREF
  idSWFScriptVar v52; // [sp+A0h] [-110h] BYREF
  idSWFScriptVar v53; // [sp+A8h] [-108h] BYREF
  idSWFScriptVar v54; // [sp+B0h] [-100h] BYREF
  idSWFScriptVar v55; // [sp+B8h] [-F8h] BYREF
  idSWFScriptVar v56; // [sp+C0h] [-F0h] BYREF
  idSWFScriptVar v57; // [sp+C8h] [-E8h] BYREF
  idSWFScriptVar v58; // [sp+D0h] [-E0h] BYREF
  idSWFScriptVar v59; // [sp+D8h] [-D8h] BYREF
  idSWFScriptVar v60; // [sp+E0h] [-D0h] BYREF
  idSWFScriptVar v61; // [sp+E8h] [-C8h] BYREF
  idSWFScriptVar v62; // [sp+F0h] [-C0h] BYREF
  idSWFScriptVar v63; // [sp+F8h] [-B8h] BYREF
  idSWFScriptVar v64; // [sp+100h] [-B0h] BYREF
  idSWFScriptVar v65; // [sp+108h] [-A8h] BYREF
  idSWFScriptVar v66; // [sp+110h] [-A0h] BYREF
  idSWFScriptVar v67; // [sp+118h] [-98h] BYREF
  idSWFScriptVar v68[18]; // [sp+120h] [-90h] BYREF

  v4 = skipInteraction;
  if ( !skipInteraction )
    idAI2::SetupInteractionView(this: offeringAI, player: this);
  if ( offeringAI != nullptr )
    this->guiInteractionEntity.spawnId.value = (gameLocal->spawnIds.ptr[offeringAI->entityNumber] << 13)
                                             | offeringAI->entityNumber;
  else
    this->guiInteractionEntity.spawnId.value = 0x1FFF;
  if ( !v4 )
    this->lastOfferChoice = OFFERCHOICE_UNKNOWN;
  v8 = idSWFScriptObject::Alloc();
  idSWFScriptObject::MakeArray(this: v8);
  v9 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                this: &mem,
                                location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                size: 0x14u,
                                tag: TAG_SWF,
                                zeroBuffer: false,
                                align: ALIGN_16,
                                heap: HEAP_DEFAULTHEAP);
  if ( v9 != nullptr )
  {
    v9[1].__vftable = nullptr;
    v9->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`4'::idSWFScriptFunction_MerchantInventory_Refresh::`vftable';
    v9[3].__vftable = (idSWFScriptFunction_vtbl *)0x1FFF;
    v9[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    if ( offeringAI != nullptr )
    {
      v10 = v9;
      v9[3].__vftable = (idSWFScriptFunction_vtbl *)((gameLocal->spawnIds.ptr[offeringAI->entityNumber] << 13)
                                                   | offeringAI->entityNumber);
    }
    else
    {
      v9[3].__vftable = (idSWFScriptFunction_vtbl *)0x1FFF;
      v10 = v9;
    }
    v9[4].__vftable = (idSWFScriptFunction_vtbl *)v8;
  }
  else
  {
    v10 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v65, nf: v10);
  idSWFScriptObject::Set(this: v8, name: "refresh", value: &v65);
  idSWFScriptVar::Free(this: &v65);
  v11 = idSWFScriptObject::Alloc();
  idSWFScriptObject::MakeArray(this: v11);
  v12 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0xCu,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v12 != nullptr )
  {
    v12[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    v12[1].__vftable = nullptr;
    v13 = v12;
    v12->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`7'::idSWFScriptFunction_PlayerCash_get::`vftable';
  }
  else
  {
    v13 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v54, nf: v13);
  idSWFScriptObject::Set(this: v11, name: "cash", value: &v54);
  idSWFScriptVar::Free(this: &v54);
  presentable = this->presentable;
  if ( presentable != nullptr )
    v15 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v15 = nullptr;
  PlayerGui = idPresentablePlayer::GetPlayerGui(this: v15, g: GUI_MERCHANT);
  isDynamicMerchant = offeringAI->aiEditable.interactions.specialDynamicMerchantInventory.isDynamicMerchant;
  v48.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v48);
  v48.value.b = isDynamicMerchant;
  v48.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "useSingleItem", value: &v48);
  idSWFScriptVar::Free(this: &v48);
  if ( offeringAI->aiEditable.interactions.vehicleMerchant )
  {
    v18 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x14u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v18 != nullptr )
    {
      v18[1].__vftable = nullptr;
      v19 = v18;
      v18->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`6'::idSWFScriptFunction_PlayerInventory_Refresh::`vftable';
      v18[3].__vftable = (idSWFScriptFunction_vtbl *)0x1FFF;
      v18[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v18[3].__vftable = (idSWFScriptFunction_vtbl *)((gameLocal->spawnIds.ptr[offeringAI->entityNumber] << 13)
                                                    | offeringAI->entityNumber);
      v18[4].__vftable = (idSWFScriptFunction_vtbl *)v11;
    }
    else
    {
      v19 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v57, nf: v19);
    idSWFScriptObject::Set(this: v11, name: "refresh", value: &v57);
    idSWFScriptVar::Free(this: &v57);
    v20 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x10u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v20 != nullptr )
    {
      v20[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v20[3].__vftable = (idSWFScriptFunction_vtbl *)offeringAI;
      v21 = v20;
      v20[1].__vftable = nullptr;
      v20->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`9'::idSWFScriptFunction_PlayerVendorDeactivateCallback::`vftable';
    }
    else
    {
      v21 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v63, nf: v21);
    idSWFScriptObject::Set(this: v11, name: "deactivateCallBack", value: &v63);
    idSWFScriptVar::Free(this: &v63);
    v22 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0xCu,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v22 != nullptr )
    {
      v22[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v22[1].__vftable = nullptr;
      v23 = v22;
      v22->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`10'::idSWFScriptFunction_PlayerVendor_GetVehicleHeading::`vftable';
    }
    else
    {
      v23 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v59, nf: v23);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "getVehicleHeading", value: &v59);
    idSWFScriptVar::Free(this: &v59);
    v24 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0xCu,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v24 != nullptr )
    {
      v24[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v24[1].__vftable = nullptr;
      v25 = v24;
      v24->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`11'::idSWFScriptFunction_PlayerVendor_GetNumVehicles::`vftable';
    }
    else
    {
      v25 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v67, nf: v25);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "getNumVehicles", value: &v67);
    idSWFScriptVar::Free(this: &v67);
    idSWFScriptVar::idSWFScriptVar(this: &v61, o: v8);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "merchantInventory", value: &v61);
    idSWFScriptVar::Free(this: &v61);
    idSWFScriptVar::idSWFScriptVar(this: &v55, o: v11);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "playerInventory", value: &v55);
    idSWFScriptVar::Free(this: &v55);
    v52.type = SWF_VAR_UNDEF;
    vendorKeyIndex = this->vendorKeyIndex;
    idSWFScriptVar::Free(this: &v52);
    v52.value.i = vendorKeyIndex;
    v52.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "vendorKeyIndex", value: &v52);
    idSWFScriptVar::Free(this: &v52);
    v27 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x14u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v27 != nullptr )
    {
      v27[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v27[3].__vftable = interaction;
      v28 = v27;
      v27[4].__vftable = (idSWFScriptFunction_vtbl *)offeringAI;
      v27[1].__vftable = nullptr;
      v27->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`12'::idSWFScriptFunction_PlayerVendor_ToTuner::`vftable';
    }
    else
    {
      v28 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v56, nf: v28);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "moveToTuner", value: &v56);
    idSWFScriptVar::Free(this: &v56);
    v29 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0xCu,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v29 != nullptr )
    {
      v29[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v29[1].__vftable = nullptr;
      v30 = v29;
      v29->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`5'::idSWFScriptFunction_PlayerInventory_FreeRepair::`vftable';
    }
    else
    {
      v30 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v58, nf: v30);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "freeRepair", value: &v58);
    idSWFScriptVar::Free(this: &v58);
    index = this->cashVehicleDecl->displayName.index;
    v46.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v46);
    v46.value.i = index;
    v46.type = SWF_VAR_STRINGID;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "cashName", value: &v46);
    idSWFScriptVar::Free(this: &v46);
    v32 = this->cashDecl->displayName.index;
    v50.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v50);
    v50.value.i = v32;
    v50.type = SWF_VAR_STRINGID;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "realCashName", value: &v50);
    idSWFScriptVar::Free(this: &v50);
    v43.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v43);
    v43.type = SWF_VAR_INTEGER;
    v43.value.i = 1;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "isVehicle", value: &v43);
    idSWFScriptVar::Free(this: &v43);
    v44.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v44);
    v44.type = SWF_VAR_INTEGER;
    v44.value.i = 0;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "canSell", value: &v44);
    idSWFScriptVar::Free(this: &v44);
    v45.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v45);
    v45.type = SWF_VAR_BOOL;
    v45.value.b = false;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "useMUP", value: &v45);
    v33 = &v45;
  }
  else
  {
    v34 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x14u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v34 != nullptr )
    {
      v34[1].__vftable = nullptr;
      v35 = v34;
      v34->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`6'::idSWFScriptFunction_PlayerInventory_Refresh::`vftable';
      v34[3].__vftable = (idSWFScriptFunction_vtbl *)0x1FFF;
      v34[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v34[3].__vftable = (idSWFScriptFunction_vtbl *)((gameLocal->spawnIds.ptr[offeringAI->entityNumber] << 13)
                                                    | offeringAI->entityNumber);
      v34[4].__vftable = (idSWFScriptFunction_vtbl *)v11;
    }
    else
    {
      v35 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v60, nf: v35);
    idSWFScriptObject::Set(this: v11, name: "refresh", value: &v60);
    idSWFScriptVar::Free(this: &v60);
    v36 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x10u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v36 != nullptr )
    {
      v36[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v36[3].__vftable = (idSWFScriptFunction_vtbl *)offeringAI;
      v37 = v36;
      v36[1].__vftable = nullptr;
      v36->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`9'::idSWFScriptFunction_PlayerVendorDeactivateCallback::`vftable';
    }
    else
    {
      v37 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v62, nf: v37);
    idSWFScriptObject::Set(this: v11, name: "deactivateCallBack", value: &v62);
    idSWFScriptVar::Free(this: &v62);
    idSWFScriptVar::idSWFScriptVar(this: &v64, o: v8);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "merchantInventory", value: &v64);
    idSWFScriptVar::Free(this: &v64);
    idSWFScriptVar::idSWFScriptVar(this: &v66, o: v11);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "playerInventory", value: &v66);
    idSWFScriptVar::Free(this: &v66);
    v38 = this->cashDecl->displayName.index;
    v47.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v47);
    v47.value.i = v38;
    v47.type = SWF_VAR_STRINGID;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "cashName", value: &v47);
    idSWFScriptVar::Free(this: &v47);
    v49.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v49);
    v49.value.i = 0;
    v49.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "isVehicle", value: &v49);
    idSWFScriptVar::Free(this: &v49);
    v51.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v51);
    v51.type = SWF_VAR_INTEGER;
    v51.value.i = 1;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "canSell", value: &v51);
    idSWFScriptVar::Free(this: &v51);
    v53.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v53);
    v53.type = SWF_VAR_BOOL;
    v53.value.b = false;
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "useMUP", value: &v53);
    v33 = &v53;
  }
  idSWFScriptVar::Free(this: v33);
  idSWF::Activate(this: PlayerGui, b: true);
  v39 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0xCu,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v39 != nullptr )
  {
    v39[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    v39[1].__vftable = nullptr;
    v40 = v39;
    v39->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::OfferWares'::`8'::idSWFScriptFunction_SwitchCamera::`vftable';
  }
  else
  {
    v40 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: v68, nf: v40);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "switchCamera", value: v68);
  idSWFScriptVar::Free(this: v68);
  if ( v11->refCount-- == 1 )
  {
    idSWFScriptObject::~idSWFScriptObject(this: v11);
    idMem::Free(this: &mem, ptr: v11, align: ALIGN_16);
  }
  if ( v8->refCount-- == 1 )
  {
    idSWFScriptObject::~idSWFScriptObject(this: v8);
    idMem::Free(this: &mem, ptr: v8, align: ALIGN_16);
  }
}


// ========================================================================
// __unwind$520785
// EA  : 0x82E60DEC
// RVA : 0x00E60DEC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520785()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 264));
}


// ========================================================================
// __unwind$520787
// EA  : 0x82E60E14
// RVA : 0x00E60E14
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520787()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 176));
}


// ========================================================================
// __unwind$520788
// EA  : 0x82E60E3C
// RVA : 0x00E60E3C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520788()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 128));
}


// ========================================================================
// __unwind$520790
// EA  : 0x82E60E64
// RVA : 0x00E60E64
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520790()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 200));
}


// ========================================================================
// __unwind$520792
// EA  : 0x82E60E8C
// RVA : 0x00E60E8C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520792()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 248));
}


// ========================================================================
// __unwind$520794
// EA  : 0x82E60EB4
// RVA : 0x00E60EB4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520794()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 216));
}


// ========================================================================
// __unwind$520796
// EA  : 0x82E60EDC
// RVA : 0x00E60EDC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520796()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 280));
}


// ========================================================================
// __unwind$520797
// EA  : 0x82E60F04
// RVA : 0x00E60F04
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520797()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 232));
}


// ========================================================================
// __unwind$520798
// EA  : 0x82E60F2C
// RVA : 0x00E60F2C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520798()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 184));
}


// ========================================================================
// __unwind$520799
// EA  : 0x82E60F54
// RVA : 0x00E60F54
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520799()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 160));
}


// ========================================================================
// __unwind$520801
// EA  : 0x82E60F7C
// RVA : 0x00E60F7C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520801()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 192));
}


// ========================================================================
// __unwind$520803
// EA  : 0x82E60FA4
// RVA : 0x00E60FA4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520803()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 208));
}


// ========================================================================
// __unwind$520804
// EA  : 0x82E60FCC
// RVA : 0x00E60FCC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520804()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 112));
}


// ========================================================================
// __unwind$520805
// EA  : 0x82E60FF4
// RVA : 0x00E60FF4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520805()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 144));
}


// ========================================================================
// __unwind$520806
// EA  : 0x82E6101C
// RVA : 0x00E6101C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520806()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 88));
}


// ========================================================================
// __unwind$520807
// EA  : 0x82E61044
// RVA : 0x00E61044
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520807()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 96));
}


// ========================================================================
// __unwind$520808
// EA  : 0x82E6106C
// RVA : 0x00E6106C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520808()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 104));
}


// ========================================================================
// __unwind$520810
// EA  : 0x82E61094
// RVA : 0x00E61094
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520810()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 224));
}


// ========================================================================
// __unwind$520812
// EA  : 0x82E610BC
// RVA : 0x00E610BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520812()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 240));
}


// ========================================================================
// __unwind$520813
// EA  : 0x82E610E4
// RVA : 0x00E610E4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520813()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 256));
}


// ========================================================================
// __unwind$520814
// EA  : 0x82E6110C
// RVA : 0x00E6110C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520814()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 272));
}


// ========================================================================
// __unwind$520815
// EA  : 0x82E61134
// RVA : 0x00E61134
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520815()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 120));
}


// ========================================================================
// __unwind$520816
// EA  : 0x82E6115C
// RVA : 0x00E6115C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520816()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 136));
}


// ========================================================================
// __unwind$520817
// EA  : 0x82E61184
// RVA : 0x00E61184
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520817()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 152));
}


// ========================================================================
// __unwind$520818
// EA  : 0x82E611AC
// RVA : 0x00E611AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520818()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 168));
}


// ========================================================================
// __unwind$520820
// EA  : 0x82E611D4
// RVA : 0x00E611D4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_520820()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 432 + 288));
}


// ========================================================================
// `idPlayer::OfferWares'::`2'::idSWFScriptFunction_CanSellItem::Call
// EA  : 0x82E61200
// RVA : 0x00E61200
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_2_::idSWFScriptFunction_CanSellItem::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idJobManager *v6; // r3
  bool v7; // r4

  if ( thisObject->variables.num != 0
    && (v6 = (idJobManager *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num)) != nullptr )
  {
    v7 = idJobManager::FindJobByDecl(this: v6, jobDecl: (const idDeclJob *)thisObject->variables.size) != nullptr;
    idSWFScriptVar::idSWFScriptVar(this: result, b: v7);
    return result;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
    return result;
  }
}


// ========================================================================
// `idPlayer::OfferWares'::`3'::idSWFScriptFunction_BuyItem::Call
// EA  : 0x82E61298
// RVA : 0x00E61298
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_3_::idSWFScriptFunction_BuyItem::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int v4; // r10
  idEntityPtr<idEntity> *p_size; // r20
  idEntityPtr<idEntity> *p_num; // r24
  idEntity *v8; // r3
  idEntity *v9; // r3
  idJobManager *v10; // r21
  idEntity *v11; // r3
  idEntity *v12; // r3
  idJobManager *v13; // r23
  idInventoryItem *JobByDecl; // r29
  idEntity *v15; // r3
  idPlayer *v16; // r3
  idPlayer *v17; // r25
  bool v18; // r26
  int Price; // r30
  int v20; // r31
  idAI2 *v21; // r3
  __int64 v22; // r11
  idAI2 *v23; // r3
  int v24; // r30
  const idDeclInventory *decl; // r11
  idEntity *v26; // r3
  idPresentable *v27; // r4
  idEntity *v28; // r31
  idAmmoItem *v29; // r28
  idEntity *v30; // r3
  idPresentable *v31; // r11
  idEntity *v32; // r31
  idAmmoItem *v33; // r3
  idInventoryItem *v34; // r31
  const char *str; // r4
  const idDeclJob *v36; // r4
  idWeapon *v37; // r3
  idWeapon *v38; // r3
  idWeapon *v39; // r30
  const idDeclInventory *v40; // r29
  int v41; // r28
  const idDeclInventory *v42; // r29
  int v43; // r29
  int v44; // r30
  int v45; // r3
  idAI2 *v46; // r3
  idAI2 *v47; // r3
  idPlayer *v49; // r3
  idPlayer *v50; // r3
  int v51; // r10
  idPlayer *v52; // r28
  int v53; // r11
  bool v54; // r26
  int v55; // r30
  __int64 v56; // r8
  double v57; // fp30
  __int64 v58; // r11
  __int64 v59; // r7
  double v60; // fp31
  __int64 v61; // r11
  idJob *v62; // r3
  idEntity *v63; // r3
  idPresentable *presentable; // r4
  idEntity *v65; // r31
  idInventoryItem *v66; // r3
  idEntity *v67; // r3
  idPresentable *v68; // r4
  idEntity *v69; // r31

  v4 = thisObject->variables.size & 0x1FFF;
  p_size = (idEntityPtr<idEntity> *)&thisObject->variables.size;
  if ( gameLocal->spawnIds.ptr[v4] == thisObject->variables.size >> 13 )
  {
    p_num = (idEntityPtr<idEntity> *)&thisObject->variables.num;
    if ( gameLocal->spawnIds.ptr[thisObject->variables.num & 0x1FFF] == thisObject->variables.num >> 13 )
    {
      if ( gameLocal->spawnIds.ptr[v4] == thisObject->variables.size >> 13
        && (v8 = gameLocal->entities.ptr[v4]) != nullptr )
      {
        v9 = idEntity::CastTo(c: v8);
      }
      else
      {
        v9 = nullptr;
      }
      v10 = (idJobManager *)v9->GetInventory_2(this: v9);
      if ( gameLocal->spawnIds.ptr[p_num->spawnId.value & 0x1FFF] == p_num->spawnId.value >> 13
        && (v11 = gameLocal->entities.ptr[p_num->spawnId.value & 0x1FFF]) != nullptr )
      {
        v12 = idEntity::CastTo(c: v11);
      }
      else
      {
        v12 = nullptr;
      }
      v13 = (idJobManager *)v12->GetInventory_2(this: v12);
      JobByDecl = (idInventoryItem *)idJobManager::FindJobByDecl(
                                       this: v10,
                                       jobDecl: *(const idDeclJob **)&thisObject->variables.granularity);
      if ( JobByDecl != nullptr )
      {
        v15 = idEntityPtr<idEntity const>::operator->(this: p_num);
        if ( (unsigned __int8)idPlayer::IsTypeOf(c: v15) == 0 )
        {
          v49 = (idPlayer *)idEntityPtr<idEntity const>::operator->(this: p_size);
          v50 = idPlayer::CastTo(c: v49);
          v51 = *(_DWORD *)&thisObject->variables.granularity;
          v52 = v50;
          v53 = *(_DWORD *)(v51 + 344);
          v54 = (_cntlzw(thisObject->variablesHash[0] - (unsigned int)v50->cashVehicleDecl) & 0x20) != 0;
          if ( v53 < 1 )
            v53 = *(_DWORD *)(v51 + 340);
          v55 = JobByDecl->decl->count * v53;
          LODWORD(v56) = idInventoryItem::GetSellPrice(this: JobByDecl);
          v57 = (float)v56;
          LODWORD(v59) = idInventoryCollection::FindTotalInventoryItemCount(
                           this: (idInventoryCollection *)v10,
                           decl: JobByDecl->decl);
          HIDWORD(v59) = JobByDecl->decl;
          v60 = (float)v59;
          if ( *(_BYTE *)(HIDWORD(v59) + 360) != 0 )
          {
            LODWORD(v61) = idInventoryItem::GetSellPrice(this: JobByDecl);
            v55 = (int)v60;
            v57 = (float)((float)v61 * (float)v60);
          }
          else
          {
            LODWORD(v58) = v55;
            if ( (float)v58 > v60 )
            {
              v55 = (int)v60;
              v57 = (float)((float)((float)v59 / (float)v58) * (float)v57);
            }
            v62 = idJobManager::FindJobByDecl(
                    this: v13,
                    jobDecl: *(const idDeclJob **)&thisObject->variables.granularity);
            if ( v62 == nullptr || *(&v62->displayAlreadyCompleted + 2) )
            {
              v63 = idEntityPtr<idEntity const>::operator->(this: p_num);
              presentable = v63->presentable;
              v65 = v63;
              if ( presentable == nullptr )
              {
                idEntity::InitPresentableInternal(this: v63);
                presentable = v65->presentable;
              }
              v66 = idInventoryCollection::GiveItem(
                      this: (idInventoryCollection *)v13,
                      owner: presentable,
                      decl: *(const idDeclInventory **)&thisObject->variables.granularity,
                      count: v55,
                      forceCount: false,
                      canIntro: false);
              if ( v66 != nullptr )
              {
                v66->buyBackItem = true;
                v66->forSale = true;
              }
              else
              {
                idLib::Warning(
                  fmt: "player sold an item the merchant didn't get %s",
                  *(const char **)(*(_DWORD *)&thisObject->variables.granularity + 8));
              }
            }
          }
          if ( v54 )
            idPlayer::GiveVehicleCash(this: v52, amount: (int)v57);
          else
            idPlayer::GiveCash(this: v52, amount: (int)v57);
          v67 = idEntityPtr<idEntity const>::operator->(this: p_size);
          v68 = v67->presentable;
          v69 = v67;
          if ( v68 == nullptr )
          {
            idEntity::InitPresentableInternal(this: v67);
            v68 = v69->presentable;
          }
          idInventoryCollection::DeleteInventoryItem(
            this: (idInventoryCollection *)v10,
            owner: v68,
            decl: *(const idDeclInventory **)&thisObject->variables.granularity,
            count: v55);
          idJobManager::NotifyInventorySold(
            this: &v52->jobManager,
            itemdecl: *(const idDeclJob **)&thisObject->variables.granularity);
LABEL_63:
          idSWFScriptVar::idSWFScriptVar(this: result, b: true);
          return result;
        }
        v16 = (idPlayer *)idEntityPtr<idEntity const>::operator->(this: p_num);
        v17 = idPlayer::CastTo(c: v16);
        v18 = (_cntlzw(thisObject->variablesHash[0] - (unsigned int)v17->cashVehicleDecl) & 0x20) != 0;
        Price = idInventoryItem::GetPrice(this: JobByDecl);
        v20 = 0;
        v21 = (idAI2 *)idEntityPtr<idEntity const>::operator->(this: p_size);
        v23 = idAI2::CastTo(c: v21);
        if ( v23 != nullptr
          && v23->aiEditable.interactions.specialDynamicMerchantInventory.isDynamicMerchant
          && HIBYTE(thisObject->variablesHash[1]) != 0 )
        {
          LODWORD(v22) = Price;
          v20 = (int)(float)(v23->aiEditable.interactions.specialDynamicMerchantInventory.discount * (float)v22);
        }
        v24 = Price - v20;
        if ( idInventoryCollection::FindTotalInventoryItemCount(
               this: (idInventoryCollection *)v13,
               decl: (const idDeclInventory *)thisObject->variablesHash[0]) >= v24 )
        {
          v17->lastOfferChoice = OFFERCHOICE_PURCHASE;
          decl = JobByDecl->decl;
          if ( decl->itemUse == INVENTORY_USE_SELLABLE )
            idLib::Warning(fmt: "somehow player was able to buy a trash inventory item %s", decl->name.str);
          v26 = idEntityPtr<idEntity const>::operator->(this: p_num);
          v27 = v26->presentable;
          v28 = v26;
          if ( v27 == nullptr )
          {
            idEntity::InitPresentableInternal(this: v26);
            v27 = v28->presentable;
          }
          v29 = (idAmmoItem *)idInventoryCollection::GiveItem(
                                this: (idInventoryCollection *)v13,
                                owner: v27,
                                decl: *(const idDeclInventory **)&thisObject->variables.granularity,
                                count: *(_DWORD *)(*(_DWORD *)&thisObject->variables.granularity + 340),
                                forceCount: false,
                                canIntro: true);
          if ( v29 != nullptr )
          {
            if ( v18 )
              idPlayer::RemoveVehicleCash(this: v17, amount: v24);
            else
              idPlayer::RemoveCash(this: v17, amount: v24);
            if ( *(_BYTE *)(*(_DWORD *)&thisObject->variables.granularity + 275) != 0 || JobByDecl->buyBackItem )
            {
              v30 = idEntityPtr<idEntity const>::operator->(this: p_size);
              v31 = v30->presentable;
              v32 = v30;
              if ( v31 == nullptr )
              {
                idEntity::InitPresentableInternal(this: v30);
                v31 = v32->presentable;
              }
              idInventoryCollection::DeleteInventoryItem(
                this: (idInventoryCollection *)v10,
                owner: v31,
                decl: *(const idDeclInventory **)&thisObject->variables.granularity,
                count: *(_DWORD *)(*(_DWORD *)&thisObject->variables.granularity + 340)
              * *(_DWORD *)(*(_DWORD *)&thisObject->variables.granularity + 336));
            }
            v33 = idAmmoItem::CastTo(c: v29);
            v34 = &v33->idInventoryItem;
            if ( v33 != nullptr )
            {
              str = v33->decl[1].name.str;
              if ( str != nullptr )
                v36 = (const idDeclJob *)idDeclInfo::FindWithInheritance(
                                           this: &idDeclWeapon::resourceList,
                                           name: str,
                                           makeDefault: false);
              else
                v36 = nullptr;
              v37 = (idWeapon *)idJobManager::FindJobByDecl(this: v13, jobDecl: v36);
              v38 = idWeapon::CastTo(c: v37);
              v39 = v38;
              if ( v38 != nullptr
                && v38->ammoClip->decl == *(const idDeclInventory **)&thisObject->variables.granularity )
              {
                v40 = v34->decl;
                v41 = v34->GetCount(this: v34);
                if ( v41 + idWeapon::AmmoInClip(this: v39, secondaryAmmo: false) > v40->maxCount )
                {
                  v42 = v34->decl;
                  v43 = v42->maxCount - v34->GetCount(this: v34);
                  v44 = v43 - idWeapon::AmmoInClip(this: v39, secondaryAmmo: false);
                  v45 = v34->GetCount(this: v34);
                  idInventoryItem::SetCount(this: v34, amount: v45 + v44);
                }
              }
            }
            v46 = (idAI2 *)idEntityPtr<idEntity const>::operator->(this: p_size);
            v47 = idAI2::CastTo(c: v46);
            if ( v47 != nullptr && !v47->aiEditable.interactions.specialDynamicMerchantInventory.isDynamicMerchant )
            {
              idAI2::AddDynamicGoods(this: v47, player: v17);
              idSWFScriptVar::idSWFScriptVar(this: result, b: true);
              return result;
            }
            goto LABEL_63;
          }
          idLib::Warning(
            fmt: "player bought an item he didn't get %s",
            *(const char **)(*(_DWORD *)&thisObject->variables.granularity + 8));
        }
      }
      idSWFScriptVar::idSWFScriptVar(this: result, b: false);
      return result;
    }
  }
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value.b = false;
  result->type = SWF_VAR_BOOL;
  return result;
}


// ========================================================================
// `idPlayer::OfferWares'::`4'::idSWFScriptFunction_MerchantInventory_Refresh::AddItem
// EA  : 0x82E61908
// RVA : 0x00E61908
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

int __fastcall _idPlayer::OfferWares_::_4_::idSWFScriptFunction_MerchantInventory_Refresh::AddItem(
        const idInventoryItem *item,
        idStrId *itemObj,
        idSWFScriptObject *useDiscount,
        char a4)
{
  const idDeclJob *index; // r30
  idJobManager *v9; // r3
  idJob *JobByDecl; // r3
  _DWORD *v11; // r21
  int v13; // r11
  int v14; // r9
  idSWFScriptVar::swfScriptVarValue_t v15; // r25
  idList<idEventReceiver *,5> *listeningToList; // r11
  int size; // r26
  const idDeclJob *decl; // r30
  idInventoryItem_vtbl *v19; // r28
  const idDeclInventory *v20; // r9
  idDeclInventory *v21; // r30
  idAI2 *v22; // r3
  idAI2 *v23; // r5
  idSWFScriptFunction *v24; // r3
  idSWFScriptFunction *v25; // r4
  idSWFScriptVar::swfScriptVarValue_t *DisplayName; // r3
  idSWFScriptVar::swfScriptVarValue_t v27; // r30
  const char *v28; // r4
  int v29; // r11
  int Price; // r3
  const idDeclInventory *v31; // r9
  int v32; // r27
  idList<idEventReceiver *,5> *listenerList; // r30
  idAI2 *v34; // r3
  idAI2 *v35; // r3
  idAI2 *v36; // r3
  __int64 v37; // r11
  int v38; // r30
  int v39; // r3
  signed int v40; // r7
  int v41; // r30
  bool v42; // r24
  idInventoryItem_vtbl *v43; // r11
  void (__fastcall *Init)(idInventoryItem *, const idDeclInventory *); // r9
  void (__fastcall *v45)(idInventoryItem *, const idDeclInventory *); // r27
  idSWFScriptObject *v46; // r28
  idInventoryItem_vtbl *v47; // r11
  int v48; // r30
  int v49; // r25
  idDeclInventory **v50; // r10
  char *IconName; // r3
  idSWFScriptVar *v52; // r3
  bool v54; // r30
  idAmmoItem *v55; // r23
  bool v56; // r27
  idInventoryItem_vtbl *v57; // r11
  idSWFScriptVar::swfScriptVarValue_t v58; // r30
  idSWFScriptVar *v59; // r3
  void (__fastcall *SerializeNonPrediction)(idInventoryItem *, idSerializer *, idInventoryCollection *); // r10
  void (__fastcall *Serialize)(idInventoryItem *, idSerializer *, idInventoryCollection *); // r9
  idSWFScriptVar::swfScriptVarValue_t v62; // r30
  idInventoryCollection *v63; // r28
  idSWFScriptVar::swfScriptVarValue_t v64; // r25
  int v65; // r30
  idWeapon *InventoryItem; // r3
  idInventoryItem_vtbl **v67; // r3
  idInventoryItem_vtbl *v68; // r11
  bool (__fastcall *RespondsTo)(struct idInventoryItem *, const idEventDef *); // r10
  const idDeclInventory *v70; // r9
  idSWFScriptVar::swfScriptVarValue_t v71; // r30
  int maxCount; // r11
  idSWFScriptVar *v73; // r3
  int v74; // r30
  int v75; // r3
  signed int v76; // r9
  int v77; // r30
  void (__fastcall *v78)(idInventoryItem *, idSerializer *, idInventoryCollection *); // r4
  const idDecl *v79; // r3
  const idDecl *v80; // r28
  int trackedMemory; // r11
  idSWFScriptVar::swfScriptVarValue_t v82; // r30
  idSWFScriptVar *v83; // r3
  bool (__fastcall *Use)(idInventoryItem *, idActor *); // r10
  bool (__fastcall *v85)(idInventoryItem *, idActor *); // r30
  int v86; // r11
  idSWFScriptVar::swfScriptVarValue_t v87; // r30
  bool v88; // r22
  idInventoryItem_vtbl *v89; // r28
  idSWFScriptObject *v90; // r25
  int v91; // r24
  int v92; // r23
  int v93; // r27
  const char *v94; // r4
  const idDeclJob *v95; // r30
  idJobManager *v96; // r3
  idJob *v97; // r3
  void (__fastcall *v98)(idInventoryItem *, const idDeclInventory *); // r10
  char *v99; // r3
  int v100; // r30
  int v101; // r30
  int v102; // r30
  int v103; // r30
  bool v104; // r28
  idWeaponUpgrade *v105; // r3
  idWeaponUpgrade *v106; // r30
  int (__fastcall *GetCount)(idInventoryItem *); // r10
  const char *LocalizedString; // r3
  int VehicleCash; // r3
  idSWFScriptVar *v110; // r3
  idList<idEventReceiver *,5> *v111; // r3
  const idDeclInventory *num; // r30
  idInventoryCollection *v113; // r3
  int TotalInventoryItemCount; // r3
  bool v115; // [sp+50h] [-210h]
  idInventoryItem v116; // [sp+58h] [-208h] BYREF
  idSWFScriptVar v117; // [sp+80h] [-1E0h] BYREF
  idSWFScriptVar v118; // [sp+88h] [-1D8h] BYREF
  idSWFScriptVar v119; // [sp+90h] [-1D0h] BYREF
  idSWFScriptVar v120; // [sp+98h] [-1C8h] BYREF
  idSWFScriptVar v121; // [sp+A0h] [-1C0h] BYREF
  idSWFScriptVar v122; // [sp+A8h] [-1B8h] BYREF
  idSWFScriptVar v123; // [sp+B0h] [-1B0h] BYREF
  idSWFScriptVar v124; // [sp+B8h] [-1A8h] BYREF
  idSWFScriptVar v125; // [sp+C0h] [-1A0h] BYREF
  idSWFScriptVar v126; // [sp+C8h] [-198h] BYREF
  idSWFScriptVar v127; // [sp+D0h] [-190h] BYREF
  idSWFScriptVar v128; // [sp+D8h] [-188h] BYREF
  idSWFScriptVar v129; // [sp+E0h] [-180h] BYREF
  __int64 v130; // [sp+E8h] [-178h] BYREF
  idSWFScriptVar v131; // [sp+F0h] [-170h] BYREF
  idSWFScriptVar v132; // [sp+F8h] [-168h] BYREF
  idSWFScriptVar v133; // [sp+100h] [-160h] BYREF
  idSWFScriptVar v134; // [sp+108h] [-158h] BYREF
  idSWFScriptVar v135; // [sp+110h] [-150h] BYREF
  idSWFScriptVar v136; // [sp+118h] [-148h] BYREF
  idSWFScriptVar v137; // [sp+120h] [-140h] BYREF
  idSWFScriptVar v138; // [sp+128h] [-138h] BYREF
  idSWFScriptVar v139; // [sp+130h] [-130h] BYREF
  idSWFScriptVar v140; // [sp+138h] [-128h] BYREF
  idSWFScriptVar v141; // [sp+140h] [-120h] BYREF
  idSWFScriptVar v142; // [sp+148h] [-118h] BYREF
  idSWFScriptVar v143; // [sp+150h] [-110h] BYREF
  idSWFScriptVar v144; // [sp+158h] [-108h] BYREF
  idSWFScriptVar v145; // [sp+160h] [-100h] BYREF
  idSWFScriptVar v146; // [sp+168h] [-F8h] BYREF
  idSWFScriptVar v147; // [sp+170h] [-F0h] BYREF
  idSWFScriptVar v148; // [sp+178h] [-E8h] BYREF
  idSWFScriptVar v149; // [sp+180h] [-E0h] BYREF
  idSWFScriptVar v150; // [sp+188h] [-D8h] BYREF
  idSWFScriptVar v151; // [sp+190h] [-D0h] BYREF
  idSWFScriptVar v152; // [sp+198h] [-C8h] BYREF
  idSWFScriptVar v153; // [sp+1A0h] [-C0h] BYREF
  idSWFScriptVar v154; // [sp+1A8h] [-B8h] BYREF
  idSWFScriptVar v155; // [sp+1B0h] [-B0h] BYREF
  idSWFScriptVar v156; // [sp+1B8h] [-A8h] BYREF
  idSWFScriptVar v157[20]; // [sp+1C0h] [-A0h] BYREF

  index = (const idDeclJob *)itemObj[3].index;
  v9 = (idJobManager *)(*((int (__fastcall **)(idList<idEventReceiver *,5> *))item->listeningToList->list + 117))(a1: item->listeningToList);
  JobByDecl = idJobManager::FindJobByDecl(this: v9, jobDecl: index);
  v11 = &JobByDecl->__vftable;
  if ( *(_BYTE *)(itemObj[3].index + 275) != 0 && JobByDecl != nullptr )
    return 0;
  v13 = itemObj[3].index;
  v14 = *(unsigned __int8 *)(v13 + 372);
  v15.f = *(float *)(v13 + 200);
  v116.__vftable = (idInventoryItem_vtbl *)v13;
  listeningToList = item->listeningToList;
  if ( v14 != 0 )
    size = listeningToList[1462].size;
  else
    size = listeningToList[1462].num;
  v115 = false;
  if ( JobByDecl != nullptr )
  {
    decl = JobByDecl->decl;
    v115 = ((int (__fastcall *)(idJob *))JobByDecl->__vftable[2].dtr_idClass)(a1: JobByDecl) >= (int)decl->jobLayerInfo.completeLayers.list;
  }
  v19 = (idInventoryItem_vtbl *)idMem::AllocWithLocation(
                                  this: &mem,
                                  location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                  size: 0x1Cu,
                                  tag: TAG_SWF,
                                  zeroBuffer: false,
                                  align: ALIGN_16,
                                  heap: HEAP_DEFAULTHEAP);
  v116.__vftable = v19;
  if ( v19 != nullptr )
  {
    v20 = item->decl;
    v21 = (idDeclInventory *)itemObj[3].index;
    v116.listeningToList = (idList<idEventReceiver *,5> *)&item->decl;
    if ( gameLocal->spawnIds.ptr[(unsigned __int16)v20 & 0x1FFF] == (int)v20 >> 13 )
    {
      v22 = (idAI2 *)gameLocal->entities.ptr[(unsigned __int16)v20 & 0x1FFF];
      if ( v22 != nullptr )
        v23 = idAI2::CastTo(c: v22);
      else
        v23 = nullptr;
    }
    else
    {
      v23 = nullptr;
    }
    _idPlayer::OfferWares_::_3_::idSWFScriptFunction_BuyItem::idSWFScriptFunction_BuyItem(
      _buyer: (idEntity *)v19,
      _seller: (idEntity *)item->listeningToList,
      _itemdecl: (const idDeclInventory *)v23,
      _currency: v21,
      _useDiscount: size,
      a6: a4);
    v25 = v24;
  }
  else
  {
    v25 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v148, nf: v25);
  idSWFScriptObject::Set(this: useDiscount, name: "buy", value: &v148);
  idSWFScriptVar::Free(this: &v148);
  DisplayName = (idSWFScriptVar::swfScriptVarValue_t *)idInventoryItem::GetDisplayName(this: &v116, result: itemObj);
  v143.type = SWF_VAR_UNDEF;
  v27.f = DisplayName->f;
  idSWFScriptVar::Free(this: &v143);
  v143.value = v27;
  v143.type = SWF_VAR_STRINGID;
  idSWFScriptObject::Set(this: useDiscount, name: "name", value: &v143);
  idSWFScriptVar::Free(this: &v143);
  v118.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v118);
  v118.value = v15;
  v118.type = SWF_VAR_STRINGID;
  idSWFScriptObject::Set(this: useDiscount, name: "description", value: &v118);
  idSWFScriptVar::Free(this: &v118);
  v28 = &byte_8200D768;
  v29 = *(_DWORD *)(itemObj[3].index + 212);
  if ( v29 != 0 )
    v28 = *(const char **)(v29 + 8);
  idSWFScriptVar::idSWFScriptVar(this: &v150, s: v28);
  idSWFScriptObject::Set(this: useDiscount, name: "icon", value: &v150);
  idSWFScriptVar::Free(this: &v150);
  Price = idInventoryItem::GetPrice(this: (idInventoryItem *)itemObj);
  v31 = item->decl;
  v116.__vftable = (idInventoryItem_vtbl *)&item->decl;
  v32 = Price;
  listenerList = nullptr;
  if ( gameLocal->spawnIds.ptr[(unsigned __int16)v31 & 0x1FFF] == (int)v31 >> 13
    && (v34 = (idAI2 *)gameLocal->entities.ptr[(unsigned __int16)v31 & 0x1FFF]) != nullptr )
  {
    v35 = idAI2::CastTo(c: v34);
  }
  else
  {
    v35 = nullptr;
  }
  if ( v35->aiEditable.interactions.specialDynamicMerchantInventory.isDynamicMerchant && a4 != 0 )
  {
    v36 = idEntityPtr<idAI2>::operator->(this: (idEntityPtr<idAI2> *)&item->decl);
    LODWORD(v37) = v32;
    v116.listenerList = (idList<idEventReceiver *,5> *)(int)(float)((float)v37
                                                                  * v36->aiEditable.interactions.specialDynamicMerchantInventory.discount);
    listenerList = v116.listenerList;
  }
  v138.type = SWF_VAR_UNDEF;
  v116.listeningToList = (idList<idEventReceiver *,5> *)(v32 - (_DWORD)listenerList);
  idSWFScriptVar::Free(this: &v138);
  v138.value.i = v32 - (_DWORD)listenerList;
  v138.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: useDiscount, name: "price", value: &v138);
  idSWFScriptVar::Free(this: &v138);
  v120.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v120);
  v120.value.i = (int)listenerList;
  v120.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: useDiscount, name: "discount", value: &v120);
  idSWFScriptVar::Free(this: &v120);
  v38 = itemObj[3].index;
  v39 = (*(int (__fastcall **)(idStrId *))(itemObj->index + 52))(a1: itemObj);
  v40 = *(_DWORD *)(v38 + 336);
  v147.type = SWF_VAR_UNDEF;
  v41 = v39 / v40;
  __twllei(v40, 0);
  __twlgei(v40 & ~(__ROL4__(v39, 1) - 1), 0xFFFFFFFF);
  idSWFScriptVar::Free(this: &v147);
  v147.value.i = v41;
  v147.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: useDiscount, name: "count", value: &v147);
  idSWFScriptVar::Free(this: &v147);
  LOBYTE(v41) = *(_BYTE *)(itemObj[3].index + 275);
  v122.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v122);
  v122.value.b = v41;
  v122.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: useDiscount, name: "isSingular", value: &v122);
  idSWFScriptVar::Free(this: &v122);
  v42 = false;
  v43 = (idInventoryItem_vtbl *)itemObj[3].index;
  Init = v43[4].Init;
  v116.__vftable = v43;
  if ( Init != nullptr )
  {
    v45 = Init;
    v116.__vftable = v43;
    v42 = true;
    v46 = idSWFScriptObject::Alloc();
    idSWFScriptObject::MakeArray(this: v46);
    v48 = 0;
    v116.__vftable = *((idInventoryItem_vtbl **)v45 + 23);
    v47 = v116.__vftable;
    if ( (int)v116.__vftable > 0 )
    {
      v49 = 0;
      do
      {
        if ( v48 >= 0
          && (v116.__vftable = v47, v48 <= (int)v47)
          && (v50 = (idDeclInventory **)(*((_DWORD *)v45 + 22) + v49),
              v116.__vftable = (idInventoryItem_vtbl *)v50,
              v50 != nullptr) )
        {
          v116.__vftable = v47;
          IconName = idDeclInventory::GetIconName(this: *(__CFADD__((char *)v47 - v48, v48 ^ 0x80000000) ? nullptr : v50));
          idSWFScriptVar::idSWFScriptVar(this: &v154, s: IconName);
          idSWFScriptObject::Set(this: v46, index: v48, value: &v154);
          v52 = &v154;
        }
        else
        {
          idSWFScriptVar::idSWFScriptVar(this: &v152, s: &byte_8200D768);
          idSWFScriptObject::Set(this: v46, index: v48, value: &v152);
          v52 = &v152;
        }
        idSWFScriptVar::Free(this: v52);
        ++v48;
        v49 += 12;
        v116.__vftable = *((idInventoryItem_vtbl **)v45 + 23);
        v47 = v116.__vftable;
      }
      while ( v48 < (int)v116.__vftable );
    }
    v116.count = 4;
    idSWFScriptVar::Free(this: (idSWFScriptVar *)&v116.count);
    if ( v46 != nullptr )
    {
      *(_DWORD *)&v116.forSale = v46;
      v116.count = 8;
      ++v46->refCount;
    }
    else
    {
      v116.count = 3;
    }
    idSWFScriptObject::Set(this: useDiscount, name: "requiredItems", value: (idSWFScriptVar *)&v116.count);
    idSWFScriptVar::Free(this: (idSWFScriptVar *)&v116.count);
    if ( v46->refCount-- == 1 )
    {
      idSWFScriptObject::~idSWFScriptObject(this: v46);
      idMem::Free(this: &mem, ptr: v46, align: ALIGN_16);
    }
  }
  v140.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v140);
  v140.value.b = v42;
  v140.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: useDiscount, name: "isRecipe", value: &v140);
  idSWFScriptVar::Free(this: &v140);
  v54 = false;
  if ( idWeapon::CastTo(c: (idWeapon *)itemObj) != nullptr )
    v54 = *(_BYTE *)(itemObj[3].index + 372) == 0;
  v124.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v124);
  v124.value.b = v54;
  v124.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: useDiscount, name: "isWeapon", value: &v124);
  idSWFScriptVar::Free(this: &v124);
  v55 = idAmmoItem::CastTo(c: (idAmmoItem *)itemObj);
  v56 = v55 != nullptr;
  v57 = (idInventoryItem_vtbl *)itemObj[3].index;
  if ( v55 != nullptr )
  {
    SerializeNonPrediction = v57[3].SerializeNonPrediction;
    Serialize = v57[3].Serialize;
    v126.type = SWF_VAR_UNDEF;
    v62.i = (_DWORD)SerializeNonPrediction * (_DWORD)Serialize;
    v116.__vftable = v57;
    idSWFScriptVar::Free(this: &v126);
    v126.value = v62;
    v126.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: useDiscount, name: "stackSize", value: &v126);
    v59 = &v126;
  }
  else
  {
    *(void (__fastcall **)(idInventoryItem *, idSerializer *, idInventoryCollection *))&v58.f = v57[3].SerializeNonPrediction;
    v144.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v144);
    v144.value = v58;
    v144.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: useDiscount, name: "stackSize", value: &v144);
    v59 = &v144;
  }
  idSWFScriptVar::Free(this: v59);
  if ( v55 != nullptr )
  {
    v63 = (idInventoryCollection *)(*((int (__fastcall **)(idList<idEventReceiver *,5> *))item->listeningToList->list
                                    + 117))(a1: item->listeningToList);
    v64.i = 0;
    v65 = 0;
    if ( (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v63) > 0 )
    {
      while ( 1 )
      {
        InventoryItem = (idWeapon *)idInventoryCollection::GetInventoryItem(this: v63, index: v65);
        if ( InventoryItem != nullptr )
        {
          v67 = (idInventoryItem_vtbl **)idWeapon::CastTo(c: InventoryItem);
          if ( v67 != nullptr )
          {
            v68 = v67[11];
            if ( v68 != nullptr )
            {
              RespondsTo = v68->RespondsTo;
              v70 = v55->decl;
              v116.__vftable = v67[11];
              if ( (char *)RespondsTo == (char *)v70 )
                break;
            }
          }
        }
        if ( ++v65 >= (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v63) )
          goto LABEL_54;
      }
      v64.i = ((int (__fastcall *)(idInventoryItem_vtbl **, idInventoryCollection *, _DWORD))(*v67)[1].OnUnequip)(
                a1: v67,
                a2: v63,
                a3: 0);
    }
LABEL_54:
    v71.i = 0;
    maxCount = v55->decl->maxCount;
    if ( v11 != nullptr )
    {
      v71.i = (*(int (__fastcall **)(_DWORD *))(*v11 + 52))(a1: v11);
      maxCount = *(_DWORD *)(v11[3] + 332);
    }
    if ( v64.i != 0 )
    {
      v115 = false;
      if ( v11 != nullptr )
        v115 = v64.i + 1 >= maxCount;
      v128.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v128);
      v128.value = v64;
      v128.type = SWF_VAR_INTEGER;
      idSWFScriptObject::Set(this: useDiscount, name: "invCount", value: &v128);
      v73 = &v128;
    }
    else
    {
      v142.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v142);
      v142.value = v71;
      v142.type = SWF_VAR_INTEGER;
      idSWFScriptObject::Set(this: useDiscount, name: "invCount", value: &v142);
      v73 = &v142;
    }
  }
  else if ( v11 != nullptr )
  {
    v74 = itemObj[3].index;
    v75 = (*(int (__fastcall **)(_DWORD *))(*v11 + 52))(a1: v11);
    v76 = *(_DWORD *)(v74 + 336);
    v146.type = SWF_VAR_UNDEF;
    v77 = v75 / v76;
    __twllei(v76, 0);
    __twlgei(v76 & ~(__ROL4__(v75, 1) - 1), 0xFFFFFFFF);
    idSWFScriptVar::Free(this: &v146);
    v146.value.i = v77;
    v146.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: useDiscount, name: "invCount", value: &v146);
    v73 = &v146;
  }
  else
  {
    HIDWORD(v130) = 4;
    idSWFScriptVar::Free(this: (idSWFScriptVar *)&v130);
    v130 = 0x600000000LL;
    idSWFScriptObject::Set(this: useDiscount, name: "invCount", value: (idSWFScriptVar *)&v130);
    v73 = (idSWFScriptVar *)&v130;
  }
  idSWFScriptVar::Free(this: v73);
  v139.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v139);
  v139.type = SWF_VAR_BOOL;
  v139.value.b = false;
  idSWFScriptObject::Set(this: useDiscount, name: "isVehicleAmmo", value: &v139);
  idSWFScriptVar::Free(this: &v139);
  if ( v55 != nullptr )
  {
    v116.__vftable = (idInventoryItem_vtbl *)v55->decl;
    if ( v116.__vftable != nullptr )
    {
      v78 = v116.__vftable[5].Serialize;
      if ( v78 != nullptr
        && (v79 = idDeclInfo::FindWithInheritance(
                    this: &idDeclWeapon::resourceList,
                    name: (const char *)v78,
                    makeDefault: false),
            v80 = v79,
            v79 != nullptr)
        && (trackedMemory = v79[4].trackedMemory) != 0 )
      {
        idSWFScriptVar::idSWFScriptVar(this: &v156, s: *(const char **)(trackedMemory + 8));
        idSWFScriptObject::Set(this: useDiscount, name: "weaponIcon", value: &v156);
        idSWFScriptVar::Free(this: &v156);
        *(idDeclSource **)&v82.f = v80[2].declSource;
        v132.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v132);
        v132.value = v82;
        v132.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: useDiscount, name: "weaponName", value: &v132);
        v83 = &v132;
      }
      else
      {
        v56 = false;
        idSWFScriptVar::idSWFScriptVar(this: &v149, s: &byte_8200D768);
        idSWFScriptObject::Set(this: useDiscount, name: "weaponIcon", value: &v149);
        idSWFScriptVar::Free(this: &v149);
        v141.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v141);
        v141.type = SWF_VAR_BOOL;
        v141.value.b = true;
        idSWFScriptObject::Set(this: useDiscount, name: "isVehicleAmmo", value: &v141);
        v83 = &v141;
      }
      idSWFScriptVar::Free(this: v83);
    }
  }
  v116.__vftable = (idInventoryItem_vtbl *)itemObj[3].index;
  if ( v116.__vftable != nullptr )
  {
    Use = v116.__vftable[5].Use;
    if ( Use != nullptr )
    {
      v85 = v116.__vftable[5].Use;
      v56 = true;
      v86 = *((_DWORD *)Use + 57);
      if ( v86 != 0 )
      {
        idSWFScriptVar::idSWFScriptVar(this: &v151, s: *(const char **)(v86 + 8));
        idSWFScriptObject::Set(this: useDiscount, name: "weaponIcon", value: &v151);
        idSWFScriptVar::Free(this: &v151);
        LODWORD(v87.f) = *(idSWFScriptVar::swfScriptVarValue_t *)((char *)v85 + 164);
        v134.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v134);
        v134.value = v87;
        v134.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: useDiscount, name: "weaponName", value: &v134);
        idSWFScriptVar::Free(this: &v134);
      }
    }
  }
  v116.coolDownTime = 4;
  idSWFScriptVar::Free(this: (idSWFScriptVar *)&v116.coolDownTime);
  HIBYTE(v116.skinPreload) = v56;
  v116.coolDownTime = 5;
  idSWFScriptObject::Set(this: useDiscount, name: "isAmmo", value: (idSWFScriptVar *)&v116.coolDownTime);
  idSWFScriptVar::Free(this: (idSWFScriptVar *)&v116.coolDownTime);
  v88 = false;
  v116.__vftable = (idInventoryItem_vtbl *)itemObj[3].index;
  v89 = v116.__vftable;
  if ( v116.__vftable != nullptr && (int)v116.__vftable[5].OnUnequip > 0 )
  {
    v88 = true;
    v90 = idSWFScriptObject::Alloc();
    idSWFScriptObject::MakeArray(this: v90);
    v91 = 0;
    v92 = 0;
    if ( (int)v89[5].OnUnequip > 0 )
    {
      v93 = 0;
      do
      {
        if ( v91 == 7 )
          break;
        v94 = *(const char **)((char *)v89[5].OnEquip + v93 + 4);
        if ( v94 != nullptr )
          v95 = (const idDeclJob *)idDeclInfo::FindWithInheritance(
                                     this: &idDeclInventory::resourceList,
                                     name: v94,
                                     makeDefault: false);
        else
          v95 = nullptr;
        v96 = (idJobManager *)(*((int (__fastcall **)(idList<idEventReceiver *,5> *))item->listeningToList->list + 117))(a1: item->listeningToList);
        v97 = idJobManager::FindJobByDecl(this: v96, jobDecl: v95);
        if ( v97 != nullptr )
        {
          v116.__vftable = (idInventoryItem_vtbl *)v97->decl;
          if ( v116.__vftable != nullptr )
          {
            v98 = v116.__vftable[4].Init;
            if ( v98 != nullptr )
            {
              v116.__vftable = *((idInventoryItem_vtbl **)v98 + 16);
              if ( v116.__vftable != nullptr )
              {
                v99 = idDeclInventory::GetIconName(this: (idDeclInventory *)v116.__vftable);
                idSWFScriptVar::idSWFScriptVar(this: &v153, s: v99);
                idSWFScriptObject::Set(this: v90, index: v91++, value: &v153);
                idSWFScriptVar::Free(this: &v153);
              }
            }
          }
        }
        ++v92;
        v93 += 32;
      }
      while ( v92 < (int)v89[5].OnUnequip );
    }
    v116.quickSlot = 4;
    idSWFScriptVar::Free(this: (idSWFScriptVar *)&v116.quickSlot);
    if ( v90 != nullptr )
    {
      v116.counttosave = (int)v90;
      v116.quickSlot = 8;
      ++v90->refCount;
    }
    else
    {
      v116.quickSlot = 3;
    }
    idSWFScriptObject::Set(this: useDiscount, name: "buildItems", value: (idSWFScriptVar *)&v116.quickSlot);
    idSWFScriptVar::Free(this: (idSWFScriptVar *)&v116.quickSlot);
  }
  v136.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v136);
  v136.value.b = v88;
  v136.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: useDiscount, name: "isIngredient", value: &v136);
  idSWFScriptVar::Free(this: &v136);
  v100 = *(_DWORD *)(itemObj[3].index + 428);
  v145.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v145);
  v145.type = SWF_VAR_BOOL;
  v145.value.b = (_cntlzw(v100 - 2) & 0x20) != 0;
  idSWFScriptObject::Set(this: useDiscount, name: "isQuickUse", value: &v145);
  idSWFScriptVar::Free(this: &v145);
  v101 = *(_DWORD *)(itemObj[3].index + 428);
  v117.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v117);
  v117.type = SWF_VAR_BOOL;
  v117.value.b = (_cntlzw(v101 - 4) & 0x20) != 0;
  idSWFScriptObject::Set(this: useDiscount, name: "isJunk", value: &v117);
  idSWFScriptVar::Free(this: &v117);
  v102 = *(_DWORD *)(itemObj[3].index + 428);
  v119.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v119);
  v119.type = SWF_VAR_BOOL;
  v119.value.b = (_cntlzw(v102 - 3) & 0x20) != 0;
  idSWFScriptObject::Set(this: useDiscount, name: "isEngineering", value: &v119);
  idSWFScriptVar::Free(this: &v119);
  v103 = *(_DWORD *)(itemObj[3].index + 428);
  v121.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v121);
  v121.type = SWF_VAR_BOOL;
  v121.value.b = (_cntlzw(v103 - 10) & 0x20) != 0;
  idSWFScriptObject::Set(this: useDiscount, name: "isVehicleItem", value: &v121);
  idSWFScriptVar::Free(this: &v121);
  v104 = false;
  v105 = idWeaponUpgrade::CastTo(c: (idWeaponUpgrade *)itemObj);
  v106 = v105;
  if ( v105 != nullptr )
  {
    v116.__vftable = (idInventoryItem_vtbl *)v105->decl;
    if ( v116.__vftable != nullptr )
    {
      GetCount = v116.__vftable[2].GetCount;
      if ( GetCount != nullptr )
      {
        v104 = true;
        idSWFScriptVar::idSWFScriptVar(this: &v155, s: *((const char **)GetCount + 2));
        idSWFScriptObject::Set(this: useDiscount, name: "weaponIcon", value: &v155);
        idSWFScriptVar::Free(this: &v155);
        LocalizedString = idStrId::GetLocalizedString(this: (idStrId *)&v106->decl[1].idResource + 8);
        idSWFScriptVar::idSWFScriptVar(this: v157, s: LocalizedString);
        idSWFScriptObject::Set(this: useDiscount, name: "weaponName", value: v157);
        idSWFScriptVar::Free(this: v157);
      }
    }
  }
  v123.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v123);
  v123.value.b = v104;
  v123.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: useDiscount, name: "isWeaponUpgrade", value: &v123);
  idSWFScriptVar::Free(this: &v123);
  v125.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v125);
  v125.type = SWF_VAR_BOOL;
  v125.value.b = false;
  idSWFScriptObject::Set(this: useDiscount, name: "isArmor", value: &v125);
  idSWFScriptVar::Free(this: &v125);
  if ( *(_BYTE *)(itemObj[3].index + 372) != 0 )
  {
    VehicleCash = idPlayer::GetVehicleCash(this: (idPlayer *)item->listeningToList);
    if ( (int)v116.listeningToList <= VehicleCash )
    {
      v129.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v129);
      v129.type = SWF_VAR_BOOL;
      v129.value.b = true;
      idSWFScriptObject::Set(this: useDiscount, name: "canAfford", value: &v129);
      v110 = &v129;
    }
    else
    {
      v127.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v127);
      v127.type = SWF_VAR_BOOL;
      v127.value.b = false;
      idSWFScriptObject::Set(this: useDiscount, name: "canAfford", value: &v127);
      v110 = &v127;
    }
  }
  else if ( v115 )
  {
    v131.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v131);
    v131.type = SWF_VAR_BOOL;
    v131.value.b = false;
    idSWFScriptObject::Set(this: useDiscount, name: "canAfford", value: &v131);
    v110 = &v131;
  }
  else
  {
    v111 = item->listeningToList;
    num = (const idDeclInventory *)v111[1462].num;
    v113 = (idInventoryCollection *)(*((int (__fastcall **)(idList<idEventReceiver *,5> *))v111->list + 116))(a1: v111);
    TotalInventoryItemCount = idInventoryCollection::FindTotalInventoryItemCount(this: v113, decl: num);
    if ( (int)v116.listeningToList <= TotalInventoryItemCount )
    {
      v135.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v135);
      v135.type = SWF_VAR_BOOL;
      v135.value.b = true;
      idSWFScriptObject::Set(this: useDiscount, name: "canAfford", value: &v135);
      v110 = &v135;
    }
    else
    {
      v133.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v133);
      v133.type = SWF_VAR_BOOL;
      v133.value.b = false;
      idSWFScriptObject::Set(this: useDiscount, name: "canAfford", value: &v133);
      v110 = &v133;
    }
  }
  idSWFScriptVar::Free(this: v110);
  v137.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v137);
  v137.type = SWF_VAR_BOOL;
  v137.value.b = v115;
  idSWFScriptObject::Set(this: useDiscount, name: "maxed", value: &v137);
  idSWFScriptVar::Free(this: &v137);
  return 1;
}


// ========================================================================
// __unwind$522370
// EA  : 0x82E62910
// RVA : 0x00E62910
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522370()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 608 + 88), tag: TAG_SWF);
}


// ========================================================================
// __unwind$522371
// EA  : 0x82E6293C
// RVA : 0x00E6293C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522371()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 376));
}


// ========================================================================
// __unwind$522372
// EA  : 0x82E62964
// RVA : 0x00E62964
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522372()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 336));
}


// ========================================================================
// __unwind$522373
// EA  : 0x82E6298C
// RVA : 0x00E6298C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522373()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 136));
}


// ========================================================================
// __unwind$522374
// EA  : 0x82E629B4
// RVA : 0x00E629B4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522374()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 392));
}


// ========================================================================
// __unwind$522375
// EA  : 0x82E629DC
// RVA : 0x00E629DC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522375()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 296));
}


// ========================================================================
// __unwind$522376
// EA  : 0x82E62A04
// RVA : 0x00E62A04
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522376()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 152));
}


// ========================================================================
// __unwind$522377
// EA  : 0x82E62A2C
// RVA : 0x00E62A2C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522377()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 368));
}


// ========================================================================
// __unwind$522378
// EA  : 0x82E62A54
// RVA : 0x00E62A54
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522378()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 168));
}


// ========================================================================
// __unwind$522379
// EA  : 0x82E62A7C
// RVA : 0x00E62A7C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522379()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 424));
}


// ========================================================================
// __unwind$522380
// EA  : 0x82E62AA4
// RVA : 0x00E62AA4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522380()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 408));
}


// ========================================================================
// __unwind$522381
// EA  : 0x82E62ACC
// RVA : 0x00E62ACC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522381()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 104));
}


// ========================================================================
// __unwind$522382
// EA  : 0x82E62AF4
// RVA : 0x00E62AF4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522382()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 312));
}


// ========================================================================
// __unwind$522383
// EA  : 0x82E62B1C
// RVA : 0x00E62B1C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522383()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 184));
}


// ========================================================================
// __unwind$522384
// EA  : 0x82E62B44
// RVA : 0x00E62B44
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522384()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 344));
}


// ========================================================================
// __unwind$522385
// EA  : 0x82E62B6C
// RVA : 0x00E62B6C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522385()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 200));
}


// ========================================================================
// __unwind$522386
// EA  : 0x82E62B94
// RVA : 0x00E62B94
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522386()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 328));
}


// ========================================================================
// __unwind$522387
// EA  : 0x82E62BBC
// RVA : 0x00E62BBC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522387()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 216));
}


// ========================================================================
// __unwind$522388
// EA  : 0x82E62BE4
// RVA : 0x00E62BE4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522388()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 360));
}


// ========================================================================
// __unwind$522389
// EA  : 0x82E62C0C
// RVA : 0x00E62C0C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522389()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 232));
}


// ========================================================================
// __unwind$522390
// EA  : 0x82E62C34
// RVA : 0x00E62C34
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522390()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 304));
}


// ========================================================================
// __unwind$522391
// EA  : 0x82E62C5C
// RVA : 0x00E62C5C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522391()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 440));
}


// ========================================================================
// __unwind$522392
// EA  : 0x82E62C84
// RVA : 0x00E62C84
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522392()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 248));
}


// ========================================================================
// __unwind$522393
// EA  : 0x82E62CAC
// RVA : 0x00E62CAC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522393()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 384));
}


// ========================================================================
// __unwind$522394
// EA  : 0x82E62CD4
// RVA : 0x00E62CD4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522394()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 320));
}


// ========================================================================
// __unwind$522395
// EA  : 0x82E62CFC
// RVA : 0x00E62CFC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522395()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 400));
}


// ========================================================================
// __unwind$522396
// EA  : 0x82E62D24
// RVA : 0x00E62D24
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522396()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 264));
}


// ========================================================================
// __unwind$522397
// EA  : 0x82E62D4C
// RVA : 0x00E62D4C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522397()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 120));
}


// ========================================================================
// __unwind$522398
// EA  : 0x82E62D74
// RVA : 0x00E62D74
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522398()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 416));
}


// ========================================================================
// __unwind$522399
// EA  : 0x82E62D9C
// RVA : 0x00E62D9C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522399()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 112));
}


// ========================================================================
// __unwind$522400
// EA  : 0x82E62DC4
// RVA : 0x00E62DC4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522400()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 280));
}


// ========================================================================
// __unwind$522401
// EA  : 0x82E62DEC
// RVA : 0x00E62DEC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522401()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 352));
}


// ========================================================================
// __unwind$522402
// EA  : 0x82E62E14
// RVA : 0x00E62E14
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522402()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 128));
}


// ========================================================================
// __unwind$522403
// EA  : 0x82E62E3C
// RVA : 0x00E62E3C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522403()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 144));
}


// ========================================================================
// __unwind$522404
// EA  : 0x82E62E64
// RVA : 0x00E62E64
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522404()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 160));
}


// ========================================================================
// __unwind$522405
// EA  : 0x82E62E8C
// RVA : 0x00E62E8C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522405()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 432));
}


// ========================================================================
// __unwind$522406
// EA  : 0x82E62EB4
// RVA : 0x00E62EB4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522406()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 448));
}


// ========================================================================
// __unwind$522407
// EA  : 0x82E62EDC
// RVA : 0x00E62EDC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522407()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 176));
}


// ========================================================================
// __unwind$522408
// EA  : 0x82E62F04
// RVA : 0x00E62F04
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522408()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 192));
}


// ========================================================================
// __unwind$522409
// EA  : 0x82E62F2C
// RVA : 0x00E62F2C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522409()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 208));
}


// ========================================================================
// __unwind$522410
// EA  : 0x82E62F54
// RVA : 0x00E62F54
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522410()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 224));
}


// ========================================================================
// __unwind$522411
// EA  : 0x82E62F7C
// RVA : 0x00E62F7C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522411()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 240));
}


// ========================================================================
// __unwind$522412
// EA  : 0x82E62FA4
// RVA : 0x00E62FA4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522412()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 256));
}


// ========================================================================
// __unwind$522413
// EA  : 0x82E62FCC
// RVA : 0x00E62FCC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522413()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 272));
}


// ========================================================================
// __unwind$522414
// EA  : 0x82E62FF4
// RVA : 0x00E62FF4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_522414()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 288));
}


// ========================================================================
// `idPlayer::OfferWares'::`4'::idSWFScriptFunction_MerchantInventory_Refresh::Call
// EA  : 0x82E63028
// RVA : 0x00E63028
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_4_::idSWFScriptFunction_MerchantInventory_Refresh::Call(
        idSWFScriptVar *result,
        const idInventoryItem *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  int v4; // r11
  idSWFScriptVar *v5; // r30
  int v7; // r17
  int decl; // r9
  int *p_decl; // r29
  int v10; // r9
  int v11; // r7
  idAI2 *v12; // r3
  idAI2 *v13; // r3
  int v14; // r3
  int v15; // r9
  idInventoryCollection *v16; // r25
  int v17; // r11
  idAI2 *v18; // r3
  idAI2 *v19; // r3
  int v20; // r28
  idInventoryItem *InventoryItem; // r3
  idInventoryItem *v22; // r30
  int v23; // r9
  int v24; // r11
  idAI2 *v25; // r3
  idAI2 *v26; // r3
  idList<idDeclVehicleUpgrade const *,5> *v27; // r3
  const idDeclInventory *v28; // r11
  idDeclInventory::inventoryUse_t itemUse; // r10
  const idDeclRecipe *recipe; // r10
  const idDeclVehicleUpgrade **list; // r17
  int v32; // r23
  const idDeclVehicleUpgrade **v33; // r28
  int i; // r27
  const idDeclVehicleUpgrade *v35; // r29
  idSWFScriptObject *v36; // r30
  const idDeclVehicleUpgrade **v38; // r19
  const idDeclVehicleUpgrade **v39; // r28
  int j; // r27
  const idDeclVehicleUpgrade *v41; // r29
  idSWFScriptObject *v42; // r30
  const idDeclVehicleUpgrade **v44; // r22
  const idDeclVehicleUpgrade **v45; // r28
  int k; // r27
  const idDeclVehicleUpgrade *v47; // r29
  idDeclInventory *v48; // r3
  idSWFScriptObject *v49; // r30
  const idDeclVehicleUpgrade **v51; // r25
  const idDeclVehicleUpgrade **v52; // r28
  int m; // r27
  const idDeclVehicleUpgrade *v54; // r29
  idDeclInventory *v55; // r3
  idSWFScriptObject *v56; // r30
  const idDeclVehicleUpgrade **v58; // r26
  const idDeclVehicleUpgrade **v59; // r28
  int n; // r27
  const idDeclVehicleUpgrade *v61; // r29
  idDeclInventory *v62; // r3
  idSWFScriptObject *v63; // r30
  const idDeclVehicleUpgrade **v65; // r4
  idVehicleKey *v66; // r19
  int v67; // r28
  idInventoryCollection *v68; // r29
  int ii; // r30
  idVehicleKey *v70; // r3
  idVehicleKey *v71; // r3
  char v72; // r22
  bool v73; // r26
  int v74; // r24
  int v75; // r27
  idInventoryItem *v76; // r3
  idInventoryItem *v77; // r28
  char v78; // r29
  idVehicleUpgrade *v79; // r3
  idVehicleUpgrade *v80; // r3
  idVehicleUpgrade *v81; // r3
  idVehicleUpgrade *v82; // r30
  idDeclInventory_vtbl *v83; // r10
  idSWFScriptObject *v84; // r30
  idList<idDeclVehicleUpgrade const *,5> *v85; // r3
  const idDeclVehicleUpgrade **v86; // r20
  idStrId **v87; // r29
  int jj; // r28
  idDeclInventory *v89; // r3
  idSWFScriptObject *v90; // r30
  const idDeclVehicleUpgrade **v92; // r25
  idStrId **v93; // r29
  int kk; // r28
  idDeclInventory *v95; // r3
  idSWFScriptObject *v96; // r30
  char *GarageIconName; // r3
  idStr *v99; // r29
  idStr *v100; // r3
  int *p_len; // r30
  int len; // r28
  int allocedAndFlag; // r11
  int v104; // r4
  char *v105; // r10
  int v106; // r9
  char v107; // r11
  idSWFScriptVar::swfScriptVarValue_t v108; // r11
  idSWFScriptVar::swfScriptVarValue_t v109; // r30
  idSWFScriptVar *v110; // r3
  idStr *v111; // r29
  idStr *v112; // r3
  int *v113; // r30
  int v114; // r28
  int v115; // r4
  int v116; // r11
  char *v117; // r10
  int v118; // r9
  char v119; // r11
  idSWFScriptVar::swfScriptVarValue_t v120; // r11
  int *v122; // [sp+50h] [-1F0h] BYREF
  idDeclInventory *v123; // [sp+54h] [-1ECh]
  idSWFScriptVar v124; // [sp+58h] [-1E8h] BYREF
  idSWFScriptVar v125; // [sp+60h] [-1E0h] BYREF
  idSWFScriptVar v126; // [sp+68h] [-1D8h] BYREF
  idSWFScriptVar v127; // [sp+70h] [-1D0h] BYREF
  idSWFScriptVar v128; // [sp+78h] [-1C8h] BYREF
  idSWFScriptVar v129; // [sp+80h] [-1C0h] BYREF
  idSWFScriptVar v130; // [sp+88h] [-1B8h] BYREF
  idSWFScriptVar v131; // [sp+90h] [-1B0h] BYREF
  idSWFScriptVar v132; // [sp+98h] [-1A8h] BYREF
  idSWFScriptVar v133; // [sp+A0h] [-1A0h] BYREF
  idSWFScriptVar v134; // [sp+A8h] [-198h] BYREF
  idSWFScriptVar v135; // [sp+B0h] [-190h] BYREF
  idSWFScriptVar v136; // [sp+B8h] [-188h] BYREF
  idSWFScriptVar v137; // [sp+C0h] [-180h] BYREF
  idSWFScriptVar v138; // [sp+C8h] [-178h] BYREF
  idSWFScriptVar v139; // [sp+D0h] [-170h] BYREF
  idSWFScriptVar v140; // [sp+D8h] [-168h] BYREF
  idSWFScriptVar v141[2]; // [sp+E0h] [-160h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v142; // [sp+F0h] [-150h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v143; // [sp+100h] [-140h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v144; // [sp+110h] [-130h] BYREF
  idSWFScriptVar v145; // [sp+120h] [-120h] BYREF
  idSWFScriptVar v146; // [sp+128h] [-118h] BYREF
  idSWFScriptVar v147[2]; // [sp+130h] [-110h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v148; // [sp+140h] [-100h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v149; // [sp+150h] [-F0h] BYREF
  idStr v150; // [sp+160h] [-E0h] BYREF
  idStr v151[6]; // [sp+180h] [-C0h] BYREF

  v4 = *(_DWORD *)(a4 + 4);
  v5 = result;
  v122 = nullptr;
  v7 = -1;
  if ( v4 != 0 )
    v7 = idSWFScriptVar::ToInteger(this: *(idSWFScriptVar **)a4);
  v137.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v137);
  v137.value.i = 0;
  v137.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, name: "length", value: &v137);
  idSWFScriptVar::Free(this: &v137);
  decl = (int)thisObject->decl;
  p_decl = (int *)&thisObject->decl;
  v122 = (int *)&thisObject->decl;
  if ( gameLocal->spawnIds.ptr[decl & 0x1FFF] == decl >> 13 )
  {
    v10 = *p_decl;
    v11 = (*p_decl & 0x1FFF) + 29755;
    v122 = (int *)&thisObject->decl;
    if ( *((_DWORD *)&gameLocal->__vftable + v11) == v10 >> 13
      && (v12 = (idAI2 *)gameLocal->entities.ptr[v10 & 0x1FFF]) != nullptr )
    {
      v13 = idAI2::CastTo(c: v12);
    }
    else
    {
      v13 = nullptr;
    }
    v14 = (int)v13->GetInventory_2(this: v13);
    v15 = *p_decl;
    v16 = (idInventoryCollection *)v14;
    v17 = *p_decl & 0x1FFF;
    v122 = (int *)&thisObject->decl;
    if ( gameLocal->spawnIds.ptr[v17] == v15 >> 13 && (v18 = (idAI2 *)gameLocal->entities.ptr[v17]) != nullptr )
      v19 = idAI2::CastTo(c: v18);
    else
      v19 = nullptr;
    if ( !v19->aiEditable.interactions.vehicleMerchant )
    {
      idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v144);
      idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v148);
      idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v142);
      idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v143);
      idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v149);
      v20 = 0;
      if ( (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v16) > 0 )
      {
        while ( 1 )
        {
          InventoryItem = idInventoryCollection::GetInventoryItem(this: v16, index: v20);
          v22 = InventoryItem;
          v122 = (int *)InventoryItem;
          if ( InventoryItem == nullptr || !InventoryItem->forSale )
            goto LABEL_44;
          v23 = *p_decl;
          v24 = *p_decl & 0x1FFF;
          v123 = (idDeclInventory *)&thisObject->decl;
          if ( gameLocal->spawnIds.ptr[v24] == v23 >> 13 && (v25 = (idAI2 *)gameLocal->entities.ptr[v24]) != nullptr )
            v26 = idAI2::CastTo(c: v25);
          else
            v26 = nullptr;
          if ( v26->aiEditable.interactions.specialDynamicMerchantInventory.isDynamicMerchant )
            break;
          if ( v7 != -1 )
          {
            v28 = v22->decl;
            itemUse = v28->itemUse;
            if ( v7 != 0 )
            {
              if ( v7 != 1 )
              {
                if ( (unsigned int)v7 >= 3 || itemUse != INVENTORY_USE_ENGINEERING )
                  goto LABEL_44;
                recipe = v28->recipe;
                v123 = (idDeclInventory *)v22->decl;
                if ( recipe != nullptr && recipe->produces != nullptr )
                  v27 = &v144;
                else
LABEL_36:
                  v27 = &v148;
LABEL_43:
                idList<idAnimWebBlendTree *,5>::Append(
                  this: (idList<enum encounterGroupRole_t,5> *)v27,
                  obj: (encounterGroupRole_t *)&v122);
                goto LABEL_44;
              }
              if ( itemUse == INVENTORY_USE_AMMO )
              {
                v27 = &v144;
                goto LABEL_43;
              }
            }
            else
            {
              switch ( itemUse )
              {
                case INVENTORY_USE_USABLE:
                  v27 = &v144;
                  goto LABEL_43;
                case INVENTORY_USE_BUYABLE:
                  goto LABEL_36;
                case INVENTORY_USE_WEAPON:
                  v27 = &v142;
                  goto LABEL_43;
                case INVENTORY_USE_QUICK:
                  v27 = &v143;
                  goto LABEL_43;
                case INVENTORY_USE_VEHICLE:
                  v27 = &v149;
                  goto LABEL_43;
                default:
                  break;
              }
            }
          }
LABEL_44:
          if ( ++v20 >= (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v16) )
            goto LABEL_45;
        }
        v27 = &v144;
        goto LABEL_43;
      }
LABEL_45:
      list = v144.list;
      v32 = 0;
      if ( v144.num > 0 )
      {
        v33 = v144.list;
        for ( i = v144.num; i != 0; --i )
        {
          v35 = *v33;
          if ( *v33 != nullptr && HIBYTE(v35->resourceError) != 0 )
          {
            v36 = idSWFScriptObject::Alloc();
            if ( (unsigned __int8)_idPlayer::OfferWares_::_4_::idSWFScriptFunction_MerchantInventory_Refresh::AddItem(
                                    item: thisObject,
                                    itemObj: (idStrId *)v35,
                                    useDiscount: v36,
                                    a4: 1) != 0 )
            {
              idSWFScriptVar::idSWFScriptVar(this: &v145, o: v36);
              idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, index: v32++, value: &v145);
              idSWFScriptVar::Free(this: &v145);
            }
            if ( v36->refCount-- == 1 )
            {
              idSWFScriptObject::~idSWFScriptObject(this: v36);
              idMem::Free(this: &mem, ptr: v36, align: ALIGN_16);
            }
          }
          ++v33;
        }
      }
      v38 = v148.list;
      if ( v148.num > 0 )
      {
        v39 = v148.list;
        for ( j = v148.num; j != 0; --j )
        {
          v41 = *v39;
          if ( *v39 != nullptr && HIBYTE(v41->resourceError) != 0 )
          {
            v42 = idSWFScriptObject::Alloc();
            if ( (unsigned __int8)_idPlayer::OfferWares_::_4_::idSWFScriptFunction_MerchantInventory_Refresh::AddItem(
                                    item: thisObject,
                                    itemObj: (idStrId *)v41,
                                    useDiscount: v42,
                                    a4: 1) != 0 )
            {
              v126.type = SWF_VAR_UNDEF;
              idSWFScriptVar::Free(this: &v126);
              if ( v42 != nullptr )
              {
                v126.value.i = (int)v42;
                v126.type = SWF_VAR_OBJECT;
                ++v42->refCount;
              }
              else
              {
                v126.type = SWF_VAR_NULL;
              }
              idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, index: v32++, value: &v126);
              idSWFScriptVar::Free(this: &v126);
            }
            if ( v42->refCount-- == 1 )
            {
              idSWFScriptObject::~idSWFScriptObject(this: v42);
              idMem::Free(this: &mem, ptr: v42, align: ALIGN_16);
            }
          }
          ++v39;
        }
      }
      v44 = v142.list;
      if ( v142.num > 0 )
      {
        v45 = v142.list;
        for ( k = v142.num; k != 0; --k )
        {
          v47 = *v45;
          if ( *v45 != nullptr && HIBYTE(v47->resourceError) != 0 )
          {
            v48 = (idDeclInventory *)idMem::AllocWithLocation(
                                       this: &mem,
                                       location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                       size: 0x60u,
                                       tag: TAG_SWF,
                                       zeroBuffer: false,
                                       align: ALIGN_16,
                                       heap: HEAP_DEFAULTHEAP);
            v123 = v48;
            if ( v48 != nullptr )
              v49 = idSWFScriptObject::idSWFScriptObject(this: (idSWFScriptObject *)v48);
            else
              v49 = nullptr;
            if ( (unsigned __int8)_idPlayer::OfferWares_::_4_::idSWFScriptFunction_MerchantInventory_Refresh::AddItem(
                                    item: thisObject,
                                    itemObj: (idStrId *)v47,
                                    useDiscount: v49,
                                    a4: 1) != 0 )
            {
              v124.type = SWF_VAR_UNDEF;
              idSWFScriptVar::Free(this: &v124);
              if ( v49 != nullptr )
              {
                v124.type = SWF_VAR_OBJECT;
                v124.value.i = (int)v49;
                ++v49->refCount;
              }
              else
              {
                v124.type = SWF_VAR_NULL;
              }
              idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, index: v32++, value: &v124);
              idSWFScriptVar::Free(this: &v124);
            }
            if ( v49->refCount-- == 1 )
            {
              idSWFScriptObject::~idSWFScriptObject(this: v49);
              idMem::Free(this: &mem, ptr: v49, align: ALIGN_16);
            }
          }
          ++v45;
        }
      }
      v51 = v143.list;
      if ( v143.num > 0 )
      {
        v52 = v143.list;
        for ( m = v143.num; m != 0; --m )
        {
          v54 = *v52;
          if ( *v52 != nullptr && HIBYTE(v54->resourceError) != 0 )
          {
            v55 = (idDeclInventory *)idMem::AllocWithLocation(
                                       this: &mem,
                                       location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                       size: 0x60u,
                                       tag: TAG_SWF,
                                       zeroBuffer: false,
                                       align: ALIGN_16,
                                       heap: HEAP_DEFAULTHEAP);
            v123 = v55;
            if ( v55 != nullptr )
              v56 = idSWFScriptObject::idSWFScriptObject(this: (idSWFScriptObject *)v55);
            else
              v56 = nullptr;
            if ( (unsigned __int8)_idPlayer::OfferWares_::_4_::idSWFScriptFunction_MerchantInventory_Refresh::AddItem(
                                    item: thisObject,
                                    itemObj: (idStrId *)v54,
                                    useDiscount: v56,
                                    a4: 1) != 0 )
            {
              v128.type = SWF_VAR_UNDEF;
              idSWFScriptVar::Free(this: &v128);
              if ( v56 != nullptr )
              {
                v128.type = SWF_VAR_OBJECT;
                v128.value.i = (int)v56;
                ++v56->refCount;
              }
              else
              {
                v128.type = SWF_VAR_NULL;
              }
              idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, index: v32++, value: &v128);
              idSWFScriptVar::Free(this: &v128);
            }
            if ( v56->refCount-- == 1 )
            {
              idSWFScriptObject::~idSWFScriptObject(this: v56);
              idMem::Free(this: &mem, ptr: v56, align: ALIGN_16);
            }
          }
          ++v52;
        }
      }
      v58 = v149.list;
      if ( v149.num > 0 )
      {
        v59 = v149.list;
        for ( n = v149.num; n != 0; --n )
        {
          v61 = *v59;
          if ( *v59 != nullptr && HIBYTE(v61->resourceError) != 0 )
          {
            v62 = (idDeclInventory *)idMem::AllocWithLocation(
                                       this: &mem,
                                       location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                       size: 0x60u,
                                       tag: TAG_SWF,
                                       zeroBuffer: false,
                                       align: ALIGN_16,
                                       heap: HEAP_DEFAULTHEAP);
            v123 = v62;
            if ( v62 != nullptr )
              v63 = idSWFScriptObject::idSWFScriptObject(this: (idSWFScriptObject *)v62);
            else
              v63 = nullptr;
            if ( (unsigned __int8)_idPlayer::OfferWares_::_4_::idSWFScriptFunction_MerchantInventory_Refresh::AddItem(
                                    item: thisObject,
                                    itemObj: (idStrId *)v61,
                                    useDiscount: v63,
                                    a4: 1) != 0 )
            {
              v125.type = SWF_VAR_UNDEF;
              idSWFScriptVar::Free(this: &v125);
              if ( v63 != nullptr )
              {
                v125.value.i = (int)v63;
                v125.type = SWF_VAR_OBJECT;
                ++v63->refCount;
              }
              else
              {
                v125.type = SWF_VAR_NULL;
              }
              idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, index: v32++, value: &v125);
              idSWFScriptVar::Free(this: &v125);
            }
            if ( v63->refCount-- == 1 )
            {
              idSWFScriptObject::~idSWFScriptObject(this: v63);
              idMem::Free(this: &mem, ptr: v63, align: ALIGN_16);
            }
          }
          ++v59;
        }
      }
      v132.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v132);
      v132.value.b = false;
      v132.type = SWF_VAR_BOOL;
      idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, name: "hasDiscount", value: &v132);
      idSWFScriptVar::Free(this: &v132);
      v138.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v138);
      v138.value.i = 0;
      v138.type = SWF_VAR_INTEGER;
      idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, name: "discountVal", value: &v138);
      idSWFScriptVar::Free(this: &v138);
      if ( (v149.listStatic == 0 || v149.listStatic == 2) && v58 != nullptr )
        idMem::Free(this: &mem, ptr: v58, align: ALIGN_16);
      if ( (v143.listStatic == 0 || v143.listStatic == 2) && v51 != nullptr )
        idMem::Free(this: &mem, ptr: v51, align: ALIGN_16);
      if ( (v142.listStatic == 0 || v142.listStatic == 2) && v44 != nullptr )
        idMem::Free(this: &mem, ptr: v44, align: ALIGN_16);
      if ( (v148.listStatic == 0 || v148.listStatic == 2) && v38 != nullptr )
        idMem::Free(this: &mem, ptr: v38, align: ALIGN_16);
      if ( v144.listStatic != 0 && v144.listStatic != 2 || list == nullptr )
      {
LABEL_231:
        v5 = result;
        result->type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: result);
        result->type = SWF_VAR_BOOL;
        result->value.b = true;
        return v5;
      }
      v65 = list;
LABEL_230:
      idMem::Free(this: &mem, ptr: v65, align: ALIGN_16);
      goto LABEL_231;
    }
    v66 = nullptr;
    v67 = 0;
    idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v143);
    idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v142);
    if ( v7 > 0 )
    {
      v68 = (idInventoryCollection *)(*((int (__fastcall **)(idList<idEventReceiver *,5> *))thisObject->listeningToList->list
                                      + 117))(a1: thisObject->listeningToList);
      for ( ii = 0; ii < (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v68); ++ii )
      {
        v70 = (idVehicleKey *)idInventoryCollection::GetInventoryItem(this: v68, index: ii);
        if ( v70 != nullptr )
        {
          v71 = idVehicleKey::CastTo(c: v70);
          if ( v71 != nullptr && v71->equippedUpgrades.num != 0 )
          {
            if ( v7 - 1 == v67 )
            {
              v66 = v71;
              break;
            }
            ++v67;
          }
        }
      }
    }
    v72 = v7 == 0;
    v73 = false;
    v74 = 0;
    v75 = 0;
    if ( (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v16) <= 0 )
    {
LABEL_167:
      v86 = v143.list;
      if ( v143.num > 0 )
      {
        v87 = (idStrId **)v143.list;
        for ( jj = v143.num; jj != 0; --jj )
        {
          v89 = (idDeclInventory *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x60u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
          v123 = v89;
          if ( v89 != nullptr )
            v90 = idSWFScriptObject::idSWFScriptObject(this: (idSWFScriptObject *)v89);
          else
            v90 = nullptr;
          if ( (unsigned __int8)_idPlayer::OfferWares_::_4_::idSWFScriptFunction_MerchantInventory_Refresh::AddItem(
                                  item: thisObject,
                                  itemObj: *v87,
                                  useDiscount: v90,
                                  a4: v72) != 0 )
          {
            v140.type = SWF_VAR_UNDEF;
            idSWFScriptVar::Free(this: &v140);
            v140.type = SWF_VAR_BOOL;
            v140.value.b = false;
            idSWFScriptObject::Set(this: v90, name: "freeRepair", value: &v140);
            idSWFScriptVar::Free(this: &v140);
            v127.type = SWF_VAR_UNDEF;
            idSWFScriptVar::Free(this: &v127);
            if ( v90 != nullptr )
            {
              v127.type = SWF_VAR_OBJECT;
              v127.value.i = (int)v90;
              ++v90->refCount;
            }
            else
            {
              v127.type = SWF_VAR_NULL;
            }
            idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, index: v74++, value: &v127);
            idSWFScriptVar::Free(this: &v127);
          }
          if ( v90->refCount-- == 1 )
          {
            idSWFScriptObject::~idSWFScriptObject(this: v90);
            idMem::Free(this: &mem, ptr: v90, align: ALIGN_16);
          }
          ++v87;
        }
      }
      v92 = v142.list;
      if ( v142.num > 0 )
      {
        v93 = (idStrId **)v142.list;
        for ( kk = v142.num; kk != 0; --kk )
        {
          v95 = (idDeclInventory *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x60u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
          v123 = v95;
          if ( v95 != nullptr )
            v96 = idSWFScriptObject::idSWFScriptObject(this: (idSWFScriptObject *)v95);
          else
            v96 = nullptr;
          if ( (unsigned __int8)_idPlayer::OfferWares_::_4_::idSWFScriptFunction_MerchantInventory_Refresh::AddItem(
                                  item: thisObject,
                                  itemObj: *v93,
                                  useDiscount: v96,
                                  a4: v72) != 0 )
          {
            v135.type = SWF_VAR_UNDEF;
            idSWFScriptVar::Free(this: &v135);
            v135.type = SWF_VAR_BOOL;
            v135.value.b = false;
            idSWFScriptObject::Set(this: v96, name: "freeRepair", value: &v135);
            idSWFScriptVar::Free(this: &v135);
            v129.type = SWF_VAR_UNDEF;
            idSWFScriptVar::Free(this: &v129);
            if ( v96 != nullptr )
            {
              v129.value.i = (int)v96;
              v129.type = SWF_VAR_OBJECT;
              ++v96->refCount;
            }
            else
            {
              v129.type = SWF_VAR_NULL;
            }
            idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, index: v74++, value: &v129);
            idSWFScriptVar::Free(this: &v129);
          }
          if ( v96->refCount-- == 1 )
          {
            idSWFScriptObject::~idSWFScriptObject(this: v96);
            idMem::Free(this: &mem, ptr: v96, align: ALIGN_16);
          }
          ++v93;
        }
      }
      if ( v7 <= 0 )
      {
        v130.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v130);
        v130.type = SWF_VAR_BOOL;
        v130.value.b = true;
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, name: "useRealCash", value: &v130);
        idSWFScriptVar::Free(this: &v130);
      }
      else
      {
        v141[0].type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: v141);
        v141[0].type = SWF_VAR_BOOL;
        v141[0].value.b = false;
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, name: "useRealCash", value: v141);
        idSWFScriptVar::Free(this: v141);
      }
      v139.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v139);
      v139.type = SWF_VAR_BOOL;
      v139.value.b = false;
      idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, name: "hasDiscount", value: &v139);
      idSWFScriptVar::Free(this: &v139);
      v133.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v133);
      v133.value.i = 0;
      v133.type = SWF_VAR_INTEGER;
      idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, name: "discountVal", value: &v133);
      idSWFScriptVar::Free(this: &v133);
      if ( v66 != nullptr && (v123 = (idDeclInventory *)v66->decl) != nullptr )
      {
        GarageIconName = idDeclInventory::GetGarageIconName(this: v123);
        v134.type = SWF_VAR_UNDEF;
        v99 = idStr::idStr(this: &v150, text: GarageIconName);
        idSWFScriptVar::Free(this: &v134);
        v134.type = SWF_VAR_STRING;
        v100 = (idStr *)idMem::AllocWithLocation(
                          this: &mem,
                          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                          size: 0x24u,
                          tag: TAG_SWF,
                          zeroBuffer: false,
                          align: ALIGN_16,
                          heap: HEAP_DEFAULTHEAP);
        p_len = &v100->len;
        v123 = (idDeclInventory *)v100;
        if ( v100 != nullptr )
        {
          v100->len = 0;
          v100->data = v100->baseBuffer;
          v100->allocedAndFlag = 20;
          v100->baseBuffer[0] = 0;
          len = v99->len;
          allocedAndFlag = v100->allocedAndFlag;
          v104 = v99->len + 1;
          if ( allocedAndFlag >= 0 )
          {
            if ( v104 > (allocedAndFlag & 0x7FFFFFFF) )
              idStr::ReAllocate(this: v100, amount: v104, keepold: true);
          }
          else if ( v104 > (allocedAndFlag & 0x7FFFFFFF)
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          v105 = v99->data - 1;
          v106 = p_len[1] - 1;
          do
          {
            v107 = *++v105;
            *(_BYTE *)++v106 = *v105;
          }
          while ( v107 != 0 );
          *p_len = len;
          v108.i = (int)p_len;
          p_len[8] = 1;
        }
        else
        {
          v108.i = 0;
        }
        v134.value = v108;
        idStr::FreeData(this: &v150);
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, name: "vehicleImg", value: &v134);
        idSWFScriptVar::Free(this: &v134);
        SLODWORD(v109.f) = v66->decl->displayName.index;
        v136.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v136);
        v136.value = v109;
        v136.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, name: "vehicleName", value: &v136);
        v110 = &v136;
      }
      else
      {
        v131.type = SWF_VAR_UNDEF;
        v111 = idStr::idStr(this: v151, text: &byte_8200D768);
        idSWFScriptVar::Free(this: &v131);
        v131.type = SWF_VAR_STRING;
        v112 = (idStr *)idMem::AllocWithLocation(
                          this: &mem,
                          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                          size: 0x24u,
                          tag: TAG_SWF,
                          zeroBuffer: false,
                          align: ALIGN_16,
                          heap: HEAP_DEFAULTHEAP);
        v113 = &v112->len;
        v123 = (idDeclInventory *)v112;
        if ( v112 != nullptr )
        {
          v112->len = 0;
          v112->data = v112->baseBuffer;
          v112->allocedAndFlag = 20;
          v112->baseBuffer[0] = 0;
          v114 = v111->len;
          v115 = v111->len + 1;
          v116 = v112->allocedAndFlag;
          if ( v116 >= 0 )
          {
            if ( v115 > (v116 & 0x7FFFFFFF) )
              idStr::ReAllocate(this: v112, amount: v115, keepold: true);
          }
          else if ( v115 > (v116 & 0x7FFFFFFF)
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          v117 = v111->data - 1;
          v118 = v113[1] - 1;
          do
          {
            v119 = *++v117;
            *(_BYTE *)++v118 = *v117;
          }
          while ( v119 != 0 );
          *v113 = v114;
          v120.i = (int)v113;
          v113[8] = 1;
        }
        else
        {
          v120.i = 0;
        }
        v131.value = v120;
        idStr::FreeData(this: v151);
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, name: "vehicleImg", value: &v131);
        v110 = &v131;
      }
      idSWFScriptVar::Free(this: v110);
      if ( (v142.listStatic == 0 || v142.listStatic == 2) && v92 != nullptr )
        idMem::Free(this: &mem, ptr: v92, align: ALIGN_16);
      if ( v143.listStatic != 0 && v143.listStatic != 2 || v86 == nullptr )
        goto LABEL_231;
      v65 = v86;
      goto LABEL_230;
    }
    while ( 1 )
    {
      v76 = idInventoryCollection::GetInventoryItem(this: v16, index: v75);
      v77 = v76;
      v78 = 0;
      v122 = (int *)v76;
      if ( v7 != -1 )
      {
        if ( v7 != 0 )
        {
          if ( v76 == nullptr )
            goto LABEL_156;
          v80 = (idVehicleUpgrade *)idInventoryCollection::GetInventoryItem(this: v16, index: v75);
          v81 = idVehicleUpgrade::CastTo(c: v80);
          v82 = v81;
          if ( v81 == nullptr || v66 == nullptr || !idVehicleKey::IsValidUpgrade(this: v66, upgrade: v81) )
            goto LABEL_156;
          v123 = (idDeclInventory *)v82->decl;
          if ( v123 != nullptr )
          {
            v83 = v123[1].__vftable;
            if ( v83 == (idDeclInventory_vtbl *)4 || v83 == (idDeclInventory_vtbl *)10 )
              v73 = true;
          }
        }
        else
        {
          if ( v76 == nullptr )
            goto LABEL_156;
          v79 = (idVehicleUpgrade *)idInventoryCollection::GetInventoryItem(this: v16, index: v75);
          if ( idVehicleUpgrade::CastTo(c: v79) != nullptr )
            goto LABEL_156;
        }
        v78 = 1;
      }
LABEL_156:
      if ( v78 != 0 && v77 != nullptr && v77->forSale )
      {
        if ( v7 <= 0 )
        {
          v85 = &v143;
          if ( v77->decl->itemUse != INVENTORY_USE_AMMO )
            v85 = &v142;
          idList<idAnimWebBlendTree *,5>::Append(
            this: (idList<enum encounterGroupRole_t,5> *)v85,
            obj: (encounterGroupRole_t *)&v122);
        }
        else
        {
          v84 = idSWFScriptObject::Alloc();
          if ( (unsigned __int8)_idPlayer::OfferWares_::_4_::idSWFScriptFunction_MerchantInventory_Refresh::AddItem(
                                  item: thisObject,
                                  itemObj: (idStrId *)v77,
                                  useDiscount: v84,
                                  a4: v72) != 0 )
          {
            idSWFScriptVar::idSWFScriptVar(this: v147, b: v73);
            idSWFScriptObject::Set(this: v84, name: "freeRepair", value: v147);
            idSWFScriptVar::Free(this: v147);
            idSWFScriptVar::idSWFScriptVar(this: &v146, o: v84);
            idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->count, index: v74++, value: &v146);
            idSWFScriptVar::Free(this: &v146);
          }
          idSWFScriptObject::Release(this: v84);
        }
      }
      if ( ++v75 >= (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v16) )
        goto LABEL_167;
    }
  }
  v5->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: v5);
  v5->value.b = false;
  v5->type = SWF_VAR_BOOL;
  return v5;
}


// ========================================================================
// __unwind$523718
// EA  : 0x82E64244
// RVA : 0x00E64244
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523718()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 192));
}


// ========================================================================
// __unwind$523722
// EA  : 0x82E6426C
// RVA : 0x00E6426C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523722()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 576 + 272));
}


// ========================================================================
// __unwind$523723
// EA  : 0x82E64294
// RVA : 0x00E64294
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523723()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 576 + 320));
}


// ========================================================================
// __unwind$523724
// EA  : 0x82E642BC
// RVA : 0x00E642BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523724()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 576 + 240));
}


// ========================================================================
// __unwind$523725
// EA  : 0x82E642E4
// RVA : 0x00E642E4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523725()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 576 + 256));
}


// ========================================================================
// __unwind$523726
// EA  : 0x82E6430C
// RVA : 0x00E6430C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523726()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 576 + 336));
}


// ========================================================================
// __unwind$523727
// EA  : 0x82E64334
// RVA : 0x00E64334
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523727()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 288));
}


// ========================================================================
// __unwind$523728
// EA  : 0x82E6435C
// RVA : 0x00E6435C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523728()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 104));
}


// ========================================================================
// __unwind$524077
// EA  : 0x82E64384
// RVA : 0x00E64384
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_524077()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 576 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$523729
// EA  : 0x82E643B0
// RVA : 0x00E643B0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523729()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 88));
}


// ========================================================================
// __unwind$524153
// EA  : 0x82E643D8
// RVA : 0x00E643D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_524153()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 576 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$523730
// EA  : 0x82E64404
// RVA : 0x00E64404
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523730()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 120));
}


// ========================================================================
// __unwind$524229
// EA  : 0x82E6442C
// RVA : 0x00E6442C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_524229()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 576 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$523731
// EA  : 0x82E64458
// RVA : 0x00E64458
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523731()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 96));
}


// ========================================================================
// __unwind$523732
// EA  : 0x82E64480
// RVA : 0x00E64480
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523732()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 152));
}


// ========================================================================
// __unwind$523733
// EA  : 0x82E644A8
// RVA : 0x00E644A8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523733()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 200));
}


// ========================================================================
// __unwind$523734
// EA  : 0x82E644D0
// RVA : 0x00E644D0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523734()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 576 + 256));
}


// ========================================================================
// __unwind$523735
// EA  : 0x82E644F8
// RVA : 0x00E644F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523735()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 576 + 240));
}


// ========================================================================
// __unwind$523736
// EA  : 0x82E64520
// RVA : 0x00E64520
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523736()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 304));
}


// ========================================================================
// __unwind$523737
// EA  : 0x82E64548
// RVA : 0x00E64548
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523737()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 296));
}


// ========================================================================
// __unwind$524530
// EA  : 0x82E64570
// RVA : 0x00E64570
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_524530()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 576 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$523738
// EA  : 0x82E6459C
// RVA : 0x00E6459C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523738()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 216));
}


// ========================================================================
// __unwind$523739
// EA  : 0x82E645C4
// RVA : 0x00E645C4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523739()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 112));
}


// ========================================================================
// __unwind$524614
// EA  : 0x82E645EC
// RVA : 0x00E645EC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_524614()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 576 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$523740
// EA  : 0x82E64618
// RVA : 0x00E64618
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523740()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 176));
}


// ========================================================================
// __unwind$523741
// EA  : 0x82E64640
// RVA : 0x00E64640
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523741()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 128));
}


// ========================================================================
// __unwind$523742
// EA  : 0x82E64668
// RVA : 0x00E64668
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523742()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 224));
}


// ========================================================================
// __unwind$523743
// EA  : 0x82E64690
// RVA : 0x00E64690
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523743()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 136));
}


// ========================================================================
// __unwind$523744
// EA  : 0x82E646B8
// RVA : 0x00E646B8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523744()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 208));
}


// ========================================================================
// __unwind$523745
// EA  : 0x82E646E0
// RVA : 0x00E646E0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523745()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 160));
}


// ========================================================================
// __unwind$524743
// EA  : 0x82E64708
// RVA : 0x00E64708
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_524743()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 576 + 352));
}


// ========================================================================
// __unwind$524750
// EA  : 0x82E64730
// RVA : 0x00E64730
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_524750()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 576 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$523746
// EA  : 0x82E6475C
// RVA : 0x00E6475C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523746()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 168));
}


// ========================================================================
// __unwind$523747
// EA  : 0x82E64784
// RVA : 0x00E64784
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523747()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 184));
}


// ========================================================================
// __unwind$525003
// EA  : 0x82E647AC
// RVA : 0x00E647AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525003()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 576 + 384));
}


// ========================================================================
// __unwind$525010
// EA  : 0x82E647D4
// RVA : 0x00E647D4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525010()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 576 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$523748
// EA  : 0x82E64800
// RVA : 0x00E64800
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_523748()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 576 + 144));
}


// ========================================================================
// `idPlayer::OfferWares'::`6'::idSWFScriptFunction_PlayerInventory_Refresh::Call
// EA  : 0x82E64830
// RVA : 0x00E64830
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_6_::idSWFScriptFunction_PlayerInventory_Refresh::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  idSWFScriptVar *v4; // r20
  int size; // r8
  int *p_size; // r11
  int v9; // r9
  int v10; // r7
  idAI2 *v11; // r3
  idAI2 *v12; // r3
  int v13; // r3
  int v14; // r3
  int v15; // r3
  int v16; // r3
  int v17; // r26
  idInventoryCollection *v18; // r27
  int i; // r28
  idInventoryItem *InventoryItem; // r3
  idInventoryItem *v21; // r30
  idDeclInventory::inventoryUse_t itemUse; // r29
  idList<idDeclVehicleUpgrade const *,5> *v23; // r3
  int num; // r30
  const idDeclVehicleUpgrade **list; // r21
  const idDeclVehicleUpgrade **v26; // r29
  int v27; // r30
  const idDeclVehicleUpgrade **v28; // r24
  const idDeclVehicleUpgrade **v29; // r29
  int v30; // r30
  const idDeclVehicleUpgrade **v31; // r23
  const idDeclVehicleUpgrade **v32; // r29
  int v33; // r30
  const idDeclVehicleUpgrade **v34; // r25
  const idDeclVehicleUpgrade **v35; // r29
  int v36; // r30
  encounterGroupRole_t *v37; // r26
  encounterGroupRole_t *v38; // r29
  int v39; // r30
  const idDeclVehicleUpgrade **v40; // r27
  const idDeclVehicleUpgrade **v41; // r29
  const idDeclVehicleUpgrade **v42; // r28
  int v43; // r30
  const idDeclVehicleUpgrade **v44; // r29
  idMem *v45; // r29
  idSWFScriptObject *v46; // r24
  idStrId *v47; // r17
  idSWFScriptVar::swfScriptVarValue_t v48; // r26
  idSWFScriptObject *v49; // r3
  idSWFScriptObject *v50; // r21
  void *(__fastcall ***v51)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r30
  int v52; // r9
  int index; // r27
  idAI2 *v54; // r3
  idAI2 *v55; // r3
  void *(__fastcall **v56)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r11
  int v57; // r5
  int v58; // r6
  int *v59; // r9
  void *(__fastcall ***v60)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r3
  int v61; // r11
  idSWFScriptVar::swfScriptVarValue_t v62; // r30
  int v63; // r10
  void *(__fastcall **v64)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r9
  idSWFScriptVar::swfScriptVarValue_t *DisplayName; // r3
  idSWFScriptVar::swfScriptVarValue_t v66; // r30
  const char *v67; // r4
  int v68; // r11
  idStr *v69; // r28
  idStr *v70; // r3
  idStr *v71; // r30
  int allocedAndFlag; // r11
  int len; // r27
  int v74; // r4
  char *v75; // r10
  int v76; // r9
  char v77; // r11
  int v78; // r30
  __int64 v79; // r10
  double v80; // fp30
  int v81; // r3
  __int64 v82; // r7
  double v83; // fp31
  char *v84; // r28
  __int64 v85; // r11
  __int64 v86; // r11
  idAmmoItem *v87; // r3
  idAmmoItem *v88; // r28
  bool v89; // r30
  idSWFScriptVar::swfScriptVarValue_t v90; // r26
  idSWFScriptVar *v91; // r3
  char *v92; // r20
  bool v93; // r25
  const char *str; // r4
  const idDecl *v95; // r3
  const idDecl *v96; // r26
  int trackedMemory; // r11
  const char *v98; // r4
  idStr *v99; // r28
  idStr *v100; // r3
  idStr *v101; // r30
  int v102; // r11
  int v103; // r27
  int v104; // r4
  char *v105; // r10
  int v106; // r9
  char v107; // r11
  idSWFScriptVar::swfScriptVarValue_t v108; // r30
  idSWFScriptVar *v109; // r3
  idStr *v110; // r28
  idStr *v111; // r3
  idStr *v112; // r30
  int v113; // r27
  int v114; // r4
  int v115; // r11
  char *v116; // r10
  int v117; // r9
  char v118; // r11
  bool v119; // r20
  int v120; // r26
  idSWFScriptObject *v121; // r3
  idSWFScriptObject *v122; // r23
  int v123; // r24
  int v124; // r22
  int v125; // r25
  const char *v126; // r30
  idJobManager *v127; // r3
  idJob *InventoryItemByDeclName; // r3
  int v129; // r10
  char *IconName; // r3
  idStr *v131; // r28
  idStr *v132; // r3
  idStr *v133; // r30
  int v134; // r11
  int v135; // r27
  int v136; // r4
  char *v137; // r10
  int v138; // r9
  char v139; // r11
  int v140; // r30
  int v141; // r30
  int v142; // r30
  int v143; // r30
  int v144; // r30
  const idDeclInventory *decl; // [sp+50h] [-350h]
  int v148; // [sp+50h] [-350h]
  const idDeclJob *v149; // [sp+50h] [-350h]
  idDeclInventory *v150; // [sp+50h] [-350h]
  const char *v151; // [sp+58h] [-348h] BYREF
  const char *v152; // [sp+5Ch] [-344h]
  char *v153; // [sp+60h] [-340h]
  int v154; // [sp+64h] [-33Ch]
  idSWFScriptVar v155; // [sp+68h] [-338h] BYREF
  idSWFScriptVar v156; // [sp+70h] [-330h] BYREF
  idSWFScriptVar v157; // [sp+78h] [-328h] BYREF
  idSWFScriptVar v158; // [sp+80h] [-320h] BYREF
  idSWFScriptVar v159; // [sp+88h] [-318h] BYREF
  idSWFScriptVar v160; // [sp+90h] [-310h] BYREF
  __int64 v161; // [sp+98h] [-308h] BYREF
  idSWFScriptVar v162; // [sp+A0h] [-300h] BYREF
  const char *v163; // [sp+A8h] [-2F8h]
  idSWFScriptVar v164; // [sp+B0h] [-2F0h] BYREF
  int v165; // [sp+B8h] [-2E8h]
  idSWFScriptVar v166; // [sp+C0h] [-2E0h] BYREF
  char *v167; // [sp+C8h] [-2D8h]
  idSWFScriptVar v168; // [sp+D0h] [-2D0h] BYREF
  idSWFScriptVar v169; // [sp+D8h] [-2C8h] BYREF
  idSWFScriptVar v170; // [sp+E0h] [-2C0h] BYREF
  idSWFScriptVar v171; // [sp+E8h] [-2B8h] BYREF
  idSWFScriptVar v172; // [sp+F0h] [-2B0h] BYREF
  idSWFScriptVar v173; // [sp+F8h] [-2A8h] BYREF
  idSWFScriptVar v174; // [sp+100h] [-2A0h] BYREF
  char *v175; // [sp+108h] [-298h]
  idSWFScriptVar v176; // [sp+110h] [-290h] BYREF
  idSWFScriptVar v177; // [sp+118h] [-288h] BYREF
  idSWFScriptVar v178; // [sp+120h] [-280h] BYREF
  idSWFScriptVar v179; // [sp+128h] [-278h] BYREF
  idSWFScriptVar v180; // [sp+130h] [-270h] BYREF
  idMem *v181; // [sp+138h] [-268h]
  idSWFScriptVar v182[2]; // [sp+140h] [-260h] BYREF
  idList<enum encounterGroupRole_t,5> v183; // [sp+150h] [-250h] BYREF
  idSWFScriptVar v184; // [sp+160h] [-240h] BYREF
  idSWFScriptVar v185; // [sp+168h] [-238h] BYREF
  idSWFScriptVar v186; // [sp+170h] [-230h] BYREF
  char *v187; // [sp+178h] [-228h]
  char *v188; // [sp+17Ch] [-224h]
  idDeclInfoTemplate<idDeclWeapon> *v189; // [sp+180h] [-220h]
  void *(__fastcall **v190)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // [sp+184h] [-21Ch]
  char *v191; // [sp+188h] [-218h]
  char *v192; // [sp+18Ch] [-214h]
  char *v193; // [sp+190h] [-210h]
  char *v194; // [sp+194h] [-20Ch]
  char *v195; // [sp+198h] [-208h]
  char *v196; // [sp+19Ch] [-204h]
  void *(__fastcall **v197)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // [sp+1A0h] [-200h]
  char *v198; // [sp+1A4h] [-1FCh]
  char *v199; // [sp+1A8h] [-1F8h]
  int v200; // [sp+1ACh] [-1F4h]
  char *v201; // [sp+1B0h] [-1F0h]
  char *v202; // [sp+1B4h] [-1ECh]
  char *v203; // [sp+1B8h] [-1E8h]
  char *v204; // [sp+1BCh] [-1E4h]
  char *v205; // [sp+1C0h] [-1E0h]
  char *v206; // [sp+1C4h] [-1DCh]
  idList<enum encounterGroupRole_t,5> v207; // [sp+1D0h] [-1D0h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v208; // [sp+1E0h] [-1C0h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v209; // [sp+1F0h] [-1B0h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v210; // [sp+200h] [-1A0h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v211; // [sp+210h] [-190h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v212; // [sp+220h] [-180h] BYREF
  idList<idDeclVehicleUpgrade const *,5> v213; // [sp+230h] [-170h] BYREF
  __int64 v214; // [sp+240h] [-160h]
  __int64 v215; // [sp+248h] [-158h]
  __int64 v216; // [sp+250h] [-150h]
  __int64 v217; // [sp+258h] [-148h]
  idInventoryItem v218; // [sp+260h] [-140h] BYREF
  idStr v219; // [sp+290h] [-110h] BYREF
  idStr v220; // [sp+2B0h] [-F0h] BYREF
  idStr v221; // [sp+2D0h] [-D0h] BYREF

  v200 = 0;
  v4 = result;
  v177.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v177);
  v177.value.i = 0;
  v177.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: *(idSWFScriptObject **)&thisObject->variables.granularity, name: "length", value: &v177);
  idSWFScriptVar::Free(this: &v177);
  size = thisObject->variables.size;
  p_size = &thisObject->variables.size;
  v153 = (char *)&thisObject->variables.size;
  if ( gameLocal->spawnIds.ptr[size & 0x1FFF] != size >> 13
    || ((v9 = *p_size,
         v10 = (*p_size & 0x1FFF) + 29755,
         v153 = (char *)&thisObject->variables.size,
         *((_DWORD *)&gameLocal->__vftable + v10) != v9 >> 13)
     || (v11 = (idAI2 *)gameLocal->entities.ptr[v9 & 0x1FFF]) == nullptr
      ? (v12 = nullptr)
      : (v12 = idAI2::CastTo(c: v11)),
        v12->aiEditable.interactions.vehicleMerchant) )
  {
    v4->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: v4);
    v4->value.b = false;
    v4->type = SWF_VAR_BOOL;
  }
  else
  {
    v13 = *(_DWORD *)(thisObject->variables.num + 488);
    if ( v13 != 0 )
      v14 = (*(int (__fastcall **)(int))(*(_DWORD *)v13 + 104))(a1: v13);
    else
      v14 = 0;
    if ( *(_DWORD *)(*(_DWORD *)(v14 + 16208) + 416) != 0 )
    {
      v15 = *(_DWORD *)(thisObject->variables.num + 488);
      if ( v15 != 0 )
        v16 = (*(int (__fastcall **)(int))(*(_DWORD *)v15 + 104))(a1: v15);
      else
        v16 = 0;
      idJobManager::SetGameStateIntValue(
        this: (idJobManager *)(thisObject->variables.num + 12412),
        gameState: *(const idDeclGameStateInt **)(*(_DWORD *)(v16 + 16208) + 416),
        stateValue: 1);
    }
    v17 = 0;
    if ( *(_DWORD *)(a4 + 4) != 0 )
      v17 = idSWFScriptVar::ToInteger(this: *(idSWFScriptVar **)a4);
    v18 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
    idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v212);
    idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: (idList<idDeclVehicleUpgrade const *,5> *)&v183);
    idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v213);
    idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v211);
    idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: (idList<idDeclVehicleUpgrade const *,5> *)&v207);
    idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v209);
    idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v208);
    idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: &v210);
    for ( i = 0; i < (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v18); ++i )
    {
      InventoryItem = idInventoryCollection::GetInventoryItem(this: v18, index: i);
      v21 = InventoryItem;
      v151 = (const char *)InventoryItem;
      if ( InventoryItem == nullptr )
        continue;
      itemUse = InventoryItem->decl->itemUse;
      if ( !idInventoryItem::PlayerCanSell(this: InventoryItem) || v21->GetCount(this: v21) <= 0 )
        continue;
      if ( v17 == 1 )
      {
        if ( itemUse == INVENTORY_USE_AMMO )
        {
          v23 = &v212;
LABEL_37:
          idList<idAnimWebBlendTree *,5>::Append(
            this: (idList<enum encounterGroupRole_t,5> *)v23,
            obj: (encounterGroupRole_t *)&v151);
        }
      }
      else
      {
        switch ( itemUse )
        {
          case INVENTORY_USE_QUICK:
            v23 = &v213;
            goto LABEL_37;
          case INVENTORY_USE_ENGINEERING:
            v23 = &v211;
            goto LABEL_37;
          case INVENTORY_USE_SELLABLE:
            v23 = (idList<idDeclVehicleUpgrade const *,5> *)&v207;
            goto LABEL_37;
          case INVENTORY_USE_USABLE:
            v23 = &v209;
            goto LABEL_37;
          case INVENTORY_USE_VEHICLE:
            v23 = &v208;
            goto LABEL_37;
          case INVENTORY_USE_UNDEF:
            v23 = &v210;
            goto LABEL_37;
          default:
            break;
        }
      }
    }
    num = v212.num;
    list = v212.list;
    if ( v212.num > 0 )
    {
      v26 = v212.list;
      do
      {
        idList<idAnimWebBlendTree *,5>::Append(this: &v207, obj: (encounterGroupRole_t *)v26);
        --num;
        ++v26;
      }
      while ( num != 0 );
    }
    v27 = v209.num;
    v28 = v209.list;
    if ( v209.num > 0 )
    {
      v29 = v209.list;
      do
      {
        idList<idAnimWebBlendTree *,5>::Append(this: &v183, obj: (encounterGroupRole_t *)v29);
        --v27;
        ++v29;
      }
      while ( v27 != 0 );
    }
    v30 = v213.num;
    v31 = v213.list;
    if ( v213.num > 0 )
    {
      v32 = v213.list;
      do
      {
        idList<idAnimWebBlendTree *,5>::Append(this: &v183, obj: (encounterGroupRole_t *)v32);
        --v30;
        ++v32;
      }
      while ( v30 != 0 );
    }
    v33 = v211.num;
    v34 = v211.list;
    if ( v211.num > 0 )
    {
      v35 = v211.list;
      do
      {
        idList<idAnimWebBlendTree *,5>::Append(this: &v183, obj: (encounterGroupRole_t *)v35);
        --v33;
        ++v35;
      }
      while ( v33 != 0 );
    }
    v36 = v207.num;
    v37 = v207.list;
    if ( v207.num > 0 )
    {
      v38 = v207.list;
      do
      {
        idList<idAnimWebBlendTree *,5>::Append(this: &v183, obj: v38);
        --v36;
        ++v38;
      }
      while ( v36 != 0 );
    }
    v39 = v208.num;
    v40 = v208.list;
    if ( v208.num > 0 )
    {
      v41 = v208.list;
      do
      {
        idList<idAnimWebBlendTree *,5>::Append(this: &v183, obj: (encounterGroupRole_t *)v41);
        --v39;
        ++v41;
      }
      while ( v39 != 0 );
    }
    v42 = v210.list;
    if ( swf_inventoryShowUndefined.valueInteger != 0 )
    {
      v43 = v210.num;
      if ( v210.num > 0 )
      {
        v44 = v210.list;
        do
        {
          idList<idAnimWebBlendTree *,5>::Append(this: &v183, obj: (encounterGroupRole_t *)v44);
          --v43;
          ++v44;
        }
        while ( v43 != 0 );
      }
    }
    v165 = 0;
    v45 = &mem;
    v154 = 0;
    v181 = &mem;
    if ( v183.num > 0 )
    {
      v152 = "w:\\tech5\\shared\\idlib\\text/Str.h";
      v151 = "amount <= GetAlloced()";
      v197 = &`idPlayer::OfferWares'::`2'::idSWFScriptFunction_CanSellItem::`vftable';
      v190 = &`idPlayer::OfferWares'::`3'::idSWFScriptFunction_BuyItem::`vftable';
      v153 = "isArmor";
      v198 = "isVehicleItem";
      v45 = v181;
      v194 = "isIngredient";
      v203 = "isEngineering";
      v196 = "isJunk";
      v205 = "isQuickUse";
      v199 = "buildItems";
      v191 = "isAmmo";
      v163 = &byte_8200D768;
      v195 = "weaponName";
      v175 = "weaponIcon";
      v204 = "canSellItem";
      v206 = "name";
      v189 = &idDeclWeapon::resourceList;
      v201 = "isVehicleAmmo";
      v167 = "stackSize";
      v188 = "price";
      v193 = "count";
      v192 = "icon";
      v202 = "description";
      v187 = "sell";
      v46 = thisObject;
      do
      {
        v47 = (idStrId *)v183.list[v154];
        v48.f = *(float *)(v47[3].index + 200);
        v49 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                     this: v45,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x60u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
        if ( v49 != nullptr )
          v50 = idSWFScriptObject::idSWFScriptObject(this: v49);
        else
          v50 = nullptr;
        v51 = (void *(__fastcall ***)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))idMem::AllocWithLocation(
                                                                                                  this: v45,
                                                                                                  location: "w:\\tech5\\shared\\idl"
                                                                                                  "ib\\Heap.h(64) : tag",
                                                                                                  size: 0x1Cu,
                                                                                                  tag: TAG_SWF,
                                                                                                  zeroBuffer: false,
                                                                                                  align: ALIGN_16,
                                                                                                  heap: HEAP_DEFAULTHEAP);
        if ( v51 != nullptr )
        {
          v52 = v46->variables.size;
          index = v47[3].index;
          v181 = (idMem *)&v46->variables.size;
          if ( gameLocal->spawnIds.ptr[v52 & 0x1FFF] == v52 >> 13 )
          {
            v54 = (idAI2 *)gameLocal->entities.ptr[v52 & 0x1FFF];
            if ( v54 != nullptr )
              v55 = idAI2::CastTo(c: v54);
            else
              v55 = nullptr;
          }
          else
          {
            v55 = nullptr;
          }
          v56 = v190;
          v57 = 0x1FFF;
          v58 = v46->variables.num;
          v59 = (int *)(v51 + 2);
          v51[1] = nullptr;
          *v51 = v56;
          v51[2] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))0x1FFF;
          v51[3] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))0x1FFF;
          if ( v55 != nullptr )
            *v59 = (gameLocal->spawnIds.ptr[v55->entityNumber] << 13) | v55->entityNumber;
          else
            *v59 = 0x1FFF;
          if ( v58 != 0 )
            v57 = (gameLocal->spawnIds.ptr[*(_DWORD *)(v58 + 492)] << 13) | *(_DWORD *)(v58 + 492);
          v51[3] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))v57;
          v51[4] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))index;
          v51[5] = nullptr;
          *((_BYTE *)v51 + 24) = 0;
        }
        else
        {
          v51 = nullptr;
        }
        v157.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v157);
        if ( v51 != nullptr )
        {
          v157.value.i = (int)v51;
          v157.type = SWF_VAR_FUNCTION;
          ((void (__fastcall *)(void *(__fastcall ***)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int)))(*v51)[2])(a1: v51);
        }
        else
        {
          v157.type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: v50, name: v187, value: &v157);
        idSWFScriptVar::Free(this: &v157);
        v60 = (void *(__fastcall ***)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))idMem::AllocWithLocation(
                                                                                                  this: v45,
                                                                                                  location: "w:\\tech5\\shared\\idl"
                                                                                                  "ib\\Heap.h(64) : tag",
                                                                                                  size: 0x10u,
                                                                                                  tag: TAG_SWF,
                                                                                                  zeroBuffer: false,
                                                                                                  align: ALIGN_16,
                                                                                                  heap: HEAP_DEFAULTHEAP);
        if ( v60 != nullptr )
        {
          v61 = v47[3].index;
          v62.i = (int)v60;
          v63 = v46->variables.num;
          v64 = v197;
          v60[1] = nullptr;
          v60[3] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))v61;
          v60[2] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))v63;
          *v60 = v64;
        }
        else
        {
          v62.i = 0;
        }
        v155.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v155);
        if ( v62.i != 0 )
        {
          v155.value = v62;
          v155.type = SWF_VAR_FUNCTION;
          (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v62.i + 8))(a1: v62.i);
        }
        else
        {
          v155.type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: v50, name: v204, value: &v155);
        idSWFScriptVar::Free(this: &v155);
        DisplayName = (idSWFScriptVar::swfScriptVarValue_t *)idInventoryItem::GetDisplayName(this: &v218, result: v47);
        v159.type = SWF_VAR_UNDEF;
        v66.f = DisplayName->f;
        idSWFScriptVar::Free(this: &v159);
        v159.value = v66;
        v159.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v50, name: v206, value: &v159);
        idSWFScriptVar::Free(this: &v159);
        v169.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v169);
        v169.value = v48;
        v169.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v50, name: v202, value: &v169);
        idSWFScriptVar::Free(this: &v169);
        v67 = v163;
        v68 = *(_DWORD *)(v47[3].index + 212);
        if ( v68 != 0 )
          v67 = *(const char **)(v68 + 8);
        v185.type = SWF_VAR_UNDEF;
        v69 = idStr::idStr(this: (idStr *)&v218.count, text: v67);
        idSWFScriptVar::Free(this: &v185);
        v185.type = SWF_VAR_STRING;
        v70 = (idStr *)idMem::AllocWithLocation(
                         this: v45,
                         location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                         size: 0x24u,
                         tag: TAG_SWF,
                         zeroBuffer: false,
                         align: ALIGN_16,
                         heap: HEAP_DEFAULTHEAP);
        v71 = v70;
        if ( v70 != nullptr )
        {
          v70->allocedAndFlag = 20;
          v70->len = 0;
          v70->data = v70->baseBuffer;
          v70->baseBuffer[0] = 0;
          allocedAndFlag = v70->allocedAndFlag;
          len = v69->len;
          v74 = v69->len + 1;
          if ( allocedAndFlag >= 0 )
          {
            if ( v74 > (allocedAndFlag & 0x7FFFFFFF) )
              idStr::ReAllocate(this: v70, amount: v74, keepold: true);
          }
          else if ( v74 > (allocedAndFlag & 0x7FFFFFFF)
                 && AssertFailed(file: v152, line: 463, expression: v151, inlineBreak: true) )
          {
            __trap();
          }
          v75 = v69->data - 1;
          v76 = (int)(v71->data - 1);
          do
          {
            v77 = *++v75;
            *(_BYTE *)++v76 = *v75;
          }
          while ( v77 != 0 );
          v71->len = len;
          v71[1].len = 1;
        }
        else
        {
          v71 = nullptr;
        }
        v185.value.i = (int)v71;
        idStr::FreeData(this: (idStr *)&v218.count);
        idSWFScriptObject::Set(this: v50, name: v192, value: &v185);
        idSWFScriptVar::Free(this: &v185);
        v78 = *(_DWORD *)(v47[3].index + 336);
        LODWORD(v79) = idInventoryItem::GetSellPrice(this: (idInventoryItem *)v47);
        HIDWORD(v79) = (idStrId)v47->index;
        v214 = v79;
        v80 = (float)v79;
        v81 = (*(int (__fastcall **)(idStrId *))(HIDWORD(v79) + 52))(a1: v47);
        v171.type = SWF_VAR_UNDEF;
        LODWORD(v82) = v81;
        v217 = v82;
        v83 = (float)v82;
        idSWFScriptVar::Free(this: &v171);
        v171.value.f = v83;
        v171.type = SWF_VAR_FLOAT;
        v84 = v193;
        idSWFScriptObject::Set(this: v50, name: v193, value: &v171);
        idSWFScriptVar::Free(this: &v171);
        if ( *(_BYTE *)(v47[3].index + 360) != 0 )
        {
          LODWORD(v86) = idInventoryItem::GetSellPrice(this: (idInventoryItem *)v47);
          v179.type = SWF_VAR_UNDEF;
          v216 = v86;
          v80 = (float)((float)v86 * (float)v83);
          idSWFScriptVar::Free(this: &v179);
          v179.type = SWF_VAR_INTEGER;
          v179.value.i = 0;
          idSWFScriptObject::Set(this: v50, name: v84, value: &v179);
          idSWFScriptVar::Free(this: &v179);
        }
        else
        {
          LODWORD(v85) = v78;
          v215 = v85;
          if ( (float)v85 > v83 )
            v80 = (float)((float)((float)v83 / (float)v85) * (float)v80);
        }
        v160.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v160);
        v160.type = SWF_VAR_INTEGER;
        v160.value.i = (int)v80;
        idSWFScriptObject::Set(this: v50, name: v188, value: &v160);
        idSWFScriptVar::Free(this: &v160);
        v87 = idAmmoItem::CastTo(c: (idAmmoItem *)v47);
        v88 = v87;
        v89 = v87 != nullptr;
        if ( v87 != nullptr )
        {
          v90.i = v87->decl->buyCount * v87->decl->count;
          v173.type = SWF_VAR_UNDEF;
          idSWFScriptVar::Free(this: &v173);
          v173.value = v90;
          v173.type = SWF_VAR_INTEGER;
          idSWFScriptObject::Set(this: v50, name: v167, value: &v173);
          v91 = &v173;
        }
        else
        {
          HIDWORD(v161) = 4;
          idSWFScriptVar::Free(this: (idSWFScriptVar *)&v161);
          v161 = 0x600000001LL;
          idSWFScriptObject::Set(this: v50, name: v167, value: (idSWFScriptVar *)&v161);
          v91 = (idSWFScriptVar *)&v161;
        }
        idSWFScriptVar::Free(this: v91);
        v162.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v162);
        v162.type = SWF_VAR_BOOL;
        v162.value.b = false;
        v92 = v201;
        idSWFScriptObject::Set(this: v50, name: v201, value: &v162);
        idSWFScriptVar::Free(this: &v162);
        v93 = v89;
        if ( v89 )
        {
          decl = v88->decl;
          if ( decl != nullptr )
          {
            str = decl[1].name.str;
            if ( str != nullptr
              && (v95 = idDeclInfo::FindWithInheritance(this: v189, name: str, makeDefault: false),
                  v96 = v95,
                  v95 != nullptr)
              && (trackedMemory = v95[4].trackedMemory) != 0 )
            {
              v98 = *(const char **)(trackedMemory + 8);
              v164.type = SWF_VAR_UNDEF;
              v99 = idStr::idStr(this: &v220, text: v98);
              idSWFScriptVar::Free(this: &v164);
              v164.type = SWF_VAR_STRING;
              v100 = (idStr *)idMem::AllocWithLocation(
                                this: v45,
                                location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                size: 0x24u,
                                tag: TAG_SWF,
                                zeroBuffer: false,
                                align: ALIGN_16,
                                heap: HEAP_DEFAULTHEAP);
              v101 = v100;
              if ( v100 != nullptr )
              {
                v100->allocedAndFlag = 20;
                v100->len = 0;
                v100->data = v100->baseBuffer;
                v100->baseBuffer[0] = 0;
                v102 = v100->allocedAndFlag;
                v103 = v99->len;
                v104 = v99->len + 1;
                if ( v102 >= 0 )
                {
                  if ( v104 > (v102 & 0x7FFFFFFF) )
                    idStr::ReAllocate(this: v100, amount: v104, keepold: true);
                }
                else if ( v104 > (v102 & 0x7FFFFFFF)
                       && AssertFailed(file: v152, line: 463, expression: v151, inlineBreak: true) )
                {
                  __trap();
                }
                v105 = v99->data - 1;
                v106 = (int)(v101->data - 1);
                do
                {
                  v107 = *++v105;
                  *(_BYTE *)++v106 = *v105;
                }
                while ( v107 != 0 );
                v101->len = v103;
                v101[1].len = 1;
              }
              else
              {
                v101 = nullptr;
              }
              v164.value.i = (int)v101;
              idStr::FreeData(this: &v220);
              idSWFScriptObject::Set(this: v50, name: v175, value: &v164);
              idSWFScriptVar::Free(this: &v164);
              *(idDeclSource **)&v108.f = v96[2].declSource;
              v166.type = SWF_VAR_UNDEF;
              idSWFScriptVar::Free(this: &v166);
              v166.value = v108;
              v166.type = SWF_VAR_STRINGID;
              idSWFScriptObject::Set(this: v50, name: v195, value: &v166);
              v109 = &v166;
            }
            else
            {
              v168.type = SWF_VAR_UNDEF;
              v93 = false;
              v110 = idStr::idStr(this: &v219, text: v163);
              idSWFScriptVar::Free(this: &v168);
              v168.type = SWF_VAR_STRING;
              v111 = (idStr *)idMem::AllocWithLocation(
                                this: v45,
                                location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                size: 0x24u,
                                tag: TAG_SWF,
                                zeroBuffer: false,
                                align: ALIGN_16,
                                heap: HEAP_DEFAULTHEAP);
              v112 = v111;
              if ( v111 != nullptr )
              {
                v111->allocedAndFlag = 20;
                v111->len = 0;
                v111->data = v111->baseBuffer;
                v111->baseBuffer[0] = 0;
                v113 = v110->len;
                v114 = v110->len + 1;
                v115 = v111->allocedAndFlag;
                if ( v115 >= 0 )
                {
                  if ( v114 > (v115 & 0x7FFFFFFF) )
                    idStr::ReAllocate(this: v111, amount: v114, keepold: true);
                }
                else if ( v114 > (v115 & 0x7FFFFFFF)
                       && AssertFailed(file: v152, line: 463, expression: v151, inlineBreak: true) )
                {
                  __trap();
                }
                v116 = v110->data - 1;
                v117 = (int)(v112->data - 1);
                do
                {
                  v118 = *++v116;
                  *(_BYTE *)++v117 = *v116;
                }
                while ( v118 != 0 );
                v112->len = v113;
                v112[1].len = 1;
              }
              else
              {
                v112 = nullptr;
              }
              v168.value.i = (int)v112;
              idStr::FreeData(this: &v219);
              idSWFScriptObject::Set(this: v50, name: v175, value: &v168);
              idSWFScriptVar::Free(this: &v168);
              v170.type = SWF_VAR_UNDEF;
              idSWFScriptVar::Free(this: &v170);
              v170.type = SWF_VAR_BOOL;
              v170.value.b = true;
              idSWFScriptObject::Set(this: v50, name: v92, value: &v170);
              v109 = &v170;
            }
            idSWFScriptVar::Free(this: v109);
          }
        }
        v172.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v172);
        v172.value.b = v93;
        v172.type = SWF_VAR_BOOL;
        idSWFScriptObject::Set(this: v50, name: v191, value: &v172);
        idSWFScriptVar::Free(this: &v172);
        v119 = false;
        v148 = v47[3].index;
        v120 = v148;
        if ( v148 != 0 && *(int *)(v148 + 484) > 0 )
        {
          v119 = true;
          v121 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                        this: v45,
                                        location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                        size: 0x60u,
                                        tag: TAG_SWF,
                                        zeroBuffer: false,
                                        align: ALIGN_16,
                                        heap: HEAP_DEFAULTHEAP);
          if ( v121 != nullptr )
            v122 = idSWFScriptObject::idSWFScriptObject(this: v121);
          else
            v122 = nullptr;
          idSWFScriptObject::MakeArray(this: v122);
          v123 = 0;
          v124 = 0;
          if ( *(int *)(v148 + 484) > 0 )
          {
            v125 = 0;
            do
            {
              if ( v123 == 7 )
                break;
              v126 = *(const char **)(*(_DWORD *)(v120 + 480) + v125 + 4);
              v127 = (idJobManager *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
              InventoryItemByDeclName = idInventoryCollection::FindInventoryItemByDeclName(this: v127, jobName: v126);
              if ( InventoryItemByDeclName != nullptr )
              {
                v149 = InventoryItemByDeclName->decl;
                if ( v149 != nullptr )
                {
                  v129 = *(_DWORD *)&v149->jobLayerInfo.completeLayersRemove.granularity;
                  if ( v129 != 0 )
                  {
                    v150 = *(idDeclInventory **)(v129 + 64);
                    if ( v150 != nullptr )
                    {
                      IconName = idDeclInventory::GetIconName(this: v150);
                      v174.type = SWF_VAR_UNDEF;
                      v131 = idStr::idStr(this: &v221, text: IconName);
                      idSWFScriptVar::Free(this: &v174);
                      v174.type = SWF_VAR_STRING;
                      v132 = (idStr *)idMem::AllocWithLocation(
                                        this: v45,
                                        location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                        size: 0x24u,
                                        tag: TAG_SWF,
                                        zeroBuffer: false,
                                        align: ALIGN_16,
                                        heap: HEAP_DEFAULTHEAP);
                      v133 = v132;
                      if ( v132 != nullptr )
                      {
                        v132->len = 0;
                        v132->data = v132->baseBuffer;
                        v132->allocedAndFlag = 20;
                        v132->baseBuffer[0] = 0;
                        v134 = v132->allocedAndFlag;
                        v135 = v131->len;
                        v136 = v131->len + 1;
                        if ( v134 >= 0 )
                        {
                          if ( v136 > (v134 & 0x7FFFFFFF) )
                            idStr::ReAllocate(this: v132, amount: v136, keepold: true);
                        }
                        else if ( v136 > (v134 & 0x7FFFFFFF)
                               && AssertFailed(file: v152, line: 463, expression: v151, inlineBreak: true) )
                        {
                          __trap();
                        }
                        v137 = v131->data - 1;
                        v138 = (int)(v133->data - 1);
                        do
                        {
                          v139 = *++v137;
                          *(_BYTE *)++v138 = *v137;
                        }
                        while ( v139 != 0 );
                        v133->len = v135;
                        v133[1].len = 1;
                      }
                      else
                      {
                        v133 = nullptr;
                      }
                      v174.value.i = (int)v133;
                      idStr::FreeData(this: &v221);
                      idSWFScriptObject::Set(this: v122, index: v123++, value: &v174);
                      idSWFScriptVar::Free(this: &v174);
                    }
                  }
                }
              }
              ++v124;
              v125 += 32;
            }
            while ( v124 < *(_DWORD *)(v120 + 484) );
          }
          v156.type = SWF_VAR_UNDEF;
          idSWFScriptVar::Free(this: &v156);
          if ( v122 != nullptr )
          {
            v156.value.i = (int)v122;
            v156.type = SWF_VAR_OBJECT;
            ++v122->refCount;
          }
          else
          {
            v156.type = SWF_VAR_NULL;
          }
          idSWFScriptObject::Set(this: v50, name: v199, value: &v156);
          idSWFScriptVar::Free(this: &v156);
          v46 = thisObject;
        }
        v176.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v176);
        v176.value.b = v119;
        v176.type = SWF_VAR_BOOL;
        idSWFScriptObject::Set(this: v50, name: v194, value: &v176);
        idSWFScriptVar::Free(this: &v176);
        v140 = *(_DWORD *)(v47[3].index + 428);
        v178.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v178);
        v178.type = SWF_VAR_BOOL;
        v178.value.b = (_cntlzw(v140 - 2) & 0x20) != 0;
        idSWFScriptObject::Set(this: v50, name: v205, value: &v178);
        idSWFScriptVar::Free(this: &v178);
        v141 = *(_DWORD *)(v47[3].index + 428);
        v180.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v180);
        v180.type = SWF_VAR_BOOL;
        v180.value.b = (_cntlzw(v141 - 4) & 0x20) != 0;
        idSWFScriptObject::Set(this: v50, name: v196, value: &v180);
        idSWFScriptVar::Free(this: &v180);
        v142 = *(_DWORD *)(v47[3].index + 428);
        v182[0].type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: v182);
        v182[0].type = SWF_VAR_BOOL;
        v182[0].value.b = (_cntlzw(v142 - 3) & 0x20) != 0;
        idSWFScriptObject::Set(this: v50, name: v203, value: v182);
        idSWFScriptVar::Free(this: v182);
        v143 = *(_DWORD *)(v47[3].index + 428);
        v184.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v184);
        v184.type = SWF_VAR_BOOL;
        v184.value.b = (_cntlzw(v143 - 10) & 0x20) != 0;
        idSWFScriptObject::Set(this: v50, name: v198, value: &v184);
        idSWFScriptVar::Free(this: &v184);
        v186.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v186);
        v186.type = SWF_VAR_BOOL;
        v186.value.b = false;
        idSWFScriptObject::Set(this: v50, name: v153, value: &v186);
        idSWFScriptVar::Free(this: &v186);
        v158.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v158);
        if ( v50 != nullptr )
        {
          v158.value.i = (int)v50;
          v158.type = SWF_VAR_OBJECT;
          ++v50->refCount;
        }
        else
        {
          v158.type = SWF_VAR_NULL;
        }
        v144 = v165;
        idSWFScriptObject::Set(this: *(idSWFScriptObject **)&v46->variables.granularity, index: v165, value: &v158);
        v165 = v144 + 1;
        idSWFScriptVar::Free(this: &v158);
        if ( v50->refCount-- == 1 )
        {
          idSWFScriptObject::~idSWFScriptObject(this: v50);
          idMem::Free(this: v45, ptr: v50, align: ALIGN_16);
        }
        ++v154;
      }
      while ( v154 < v183.num );
      v4 = result;
      list = v212.list;
      v28 = v209.list;
      v31 = v213.list;
      v34 = v211.list;
      v37 = v207.list;
      v40 = v208.list;
      v42 = v210.list;
    }
    v4->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: v4);
    v4->type = SWF_VAR_BOOL;
    v4->value.b = true;
    v200 = 1;
    if ( (v210.listStatic == 0 || v210.listStatic == 2) && v42 != nullptr )
      idMem::Free(this: v45, ptr: v42, align: ALIGN_16);
    if ( (v208.listStatic == 0 || v208.listStatic == 2) && v40 != nullptr )
      idMem::Free(this: v45, ptr: v40, align: ALIGN_16);
    if ( (v209.listStatic == 0 || v209.listStatic == 2) && v28 != nullptr )
      idMem::Free(this: v45, ptr: v28, align: ALIGN_16);
    if ( (v207.listStatic == 0 || v207.listStatic == 2) && v37 != nullptr )
      idMem::Free(this: v45, ptr: v37, align: ALIGN_16);
    if ( (v211.listStatic == 0 || v211.listStatic == 2) && v34 != nullptr )
      idMem::Free(this: v45, ptr: v34, align: ALIGN_16);
    if ( (v213.listStatic == 0 || v213.listStatic == 2) && v31 != nullptr )
      idMem::Free(this: v45, ptr: v31, align: ALIGN_16);
    if ( (v183.listStatic == 0 || v183.listStatic == 2) && v183.list != nullptr )
      idMem::Free(this: v45, ptr: v183.list, align: ALIGN_16);
    if ( (v212.listStatic == 0 || v212.listStatic == 2) && list != nullptr )
      idMem::Free(this: v45, ptr: list, align: ALIGN_16);
  }
  return v4;
}


// ========================================================================
// __unwind$525616
// EA  : 0x82E65D78
// RVA : 0x00E65D78
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525616()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 280));
}


// ========================================================================
// __unwind$525617
// EA  : 0x82E65DA0
// RVA : 0x00E65DA0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525617()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 928;
  if ( (*(_DWORD *)(v0 - 928 + 428) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 428) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 948));
  }
}


// ========================================================================
// __unwind$525620
// EA  : 0x82E65DE4
// RVA : 0x00E65DE4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525620()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 928 + 544));
}


// ========================================================================
// __unwind$525621
// EA  : 0x82E65E0C
// RVA : 0x00E65E0C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525621()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 928 + 336));
}


// ========================================================================
// __unwind$525622
// EA  : 0x82E65E34
// RVA : 0x00E65E34
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525622()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 928 + 560));
}


// ========================================================================
// __unwind$525623
// EA  : 0x82E65E5C
// RVA : 0x00E65E5C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525623()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 928 + 528));
}


// ========================================================================
// __unwind$525624
// EA  : 0x82E65E84
// RVA : 0x00E65E84
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525624()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 928 + 464));
}


// ========================================================================
// __unwind$525625
// EA  : 0x82E65EAC
// RVA : 0x00E65EAC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525625()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 928 + 496));
}


// ========================================================================
// __unwind$525626
// EA  : 0x82E65ED4
// RVA : 0x00E65ED4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525626()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 928 + 480));
}


// ========================================================================
// __unwind$525627
// EA  : 0x82E65EFC
// RVA : 0x00E65EFC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525627()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 928 + 512));
}


// ========================================================================
// __unwind$525886
// EA  : 0x82E65F24
// RVA : 0x00E65F24
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525886()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 928 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$525628_0
// EA  : 0x82E65F50
// RVA : 0x00E65F50
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525628_0()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 928 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$525629_0
// EA  : 0x82E65F7C
// RVA : 0x00E65F7C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525629_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 120));
}


// ========================================================================
// __unwind$525631_0
// EA  : 0x82E65FA4
// RVA : 0x00E65FA4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525631_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 104));
}


// ========================================================================
// __unwind$525632_0
// EA  : 0x82E65FCC
// RVA : 0x00E65FCC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525632_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 136));
}


// ========================================================================
// __unwind$525633
// EA  : 0x82E65FF4
// RVA : 0x00E65FF4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525633()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 216));
}


// ========================================================================
// __unwind$526328
// EA  : 0x82E6601C
// RVA : 0x00E6601C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_526328()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 928 + 624));
}


// ========================================================================
// __unwind$526335
// EA  : 0x82E66044
// RVA : 0x00E66044
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_526335()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 928 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$525634
// EA  : 0x82E66070
// RVA : 0x00E66070
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525634()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 360));
}


// ========================================================================
// __unwind$525635
// EA  : 0x82E66098
// RVA : 0x00E66098
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525635()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 232));
}


// ========================================================================
// __unwind$525636
// EA  : 0x82E660C0
// RVA : 0x00E660C0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525636()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 296));
}


// ========================================================================
// __unwind$525637
// EA  : 0x82E660E8
// RVA : 0x00E660E8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525637()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 144));
}


// ========================================================================
// __unwind$525638
// EA  : 0x82E66110
// RVA : 0x00E66110
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525638()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 248));
}


// ========================================================================
// __unwind$525639
// EA  : 0x82E66138
// RVA : 0x00E66138
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525639()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 152));
}


// ========================================================================
// __unwind$525640
// EA  : 0x82E66160
// RVA : 0x00E66160
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525640()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 160));
}


// ========================================================================
// __unwind$526676
// EA  : 0x82E66188
// RVA : 0x00E66188
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_526676()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 928 + 688));
}


// ========================================================================
// __unwind$526683
// EA  : 0x82E661B0
// RVA : 0x00E661B0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_526683()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 928 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$525641
// EA  : 0x82E661DC
// RVA : 0x00E661DC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525641()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 176));
}


// ========================================================================
// __unwind$525642
// EA  : 0x82E66204
// RVA : 0x00E66204
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525642()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 192));
}


// ========================================================================
// __unwind$526931
// EA  : 0x82E6622C
// RVA : 0x00E6622C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_526931()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 928 + 656));
}


// ========================================================================
// __unwind$526938
// EA  : 0x82E66254
// RVA : 0x00E66254
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_526938()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 928 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$525643
// EA  : 0x82E66280
// RVA : 0x00E66280
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525643()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 208));
}


// ========================================================================
// __unwind$525644
// EA  : 0x82E662A8
// RVA : 0x00E662A8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525644()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 224));
}


// ========================================================================
// __unwind$525645
// EA  : 0x82E662D0
// RVA : 0x00E662D0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525645()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 240));
}


// ========================================================================
// __unwind$527195
// EA  : 0x82E662F8
// RVA : 0x00E662F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_527195()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 928 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$527242
// EA  : 0x82E66324
// RVA : 0x00E66324
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_527242()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 928 + 720));
}


// ========================================================================
// __unwind$527249
// EA  : 0x82E6634C
// RVA : 0x00E6634C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_527249()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 928 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$525646
// EA  : 0x82E66378
// RVA : 0x00E66378
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525646()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 256));
}


// ========================================================================
// __unwind$525647
// EA  : 0x82E663A0
// RVA : 0x00E663A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525647()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 112));
}


// ========================================================================
// __unwind$525648
// EA  : 0x82E663C8
// RVA : 0x00E663C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525648()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 272));
}


// ========================================================================
// __unwind$525649
// EA  : 0x82E663F0
// RVA : 0x00E663F0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525649()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 288));
}


// ========================================================================
// __unwind$525650
// EA  : 0x82E66418
// RVA : 0x00E66418
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525650()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 304));
}


// ========================================================================
// __unwind$525651
// EA  : 0x82E66440
// RVA : 0x00E66440
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525651()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 320));
}


// ========================================================================
// __unwind$525652
// EA  : 0x82E66468
// RVA : 0x00E66468
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525652()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 352));
}


// ========================================================================
// __unwind$525653
// EA  : 0x82E66490
// RVA : 0x00E66490
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525653()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 368));
}


// ========================================================================
// __unwind$525654
// EA  : 0x82E664B8
// RVA : 0x00E664B8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_525654()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 928 + 128));
}


// ========================================================================
// `idPlayer::OfferWares'::`7'::idSWFScriptFunction_PlayerCash_get::Call
// EA  : 0x82E664E0
// RVA : 0x00E664E0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_7_::idSWFScriptFunction_PlayerCash_get::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  char v6; // r3
  idPlayer *num; // r3
  bool v8; // zf
  idSWFScriptVar::swfScriptVarValue_t v9; // r30
  const idDeclInventory *cashDecl; // r30
  idInventoryCollection *v11; // r3

  v6 = 0;
  if ( *(_DWORD *)(a4 + 4) != 0 )
    v6 = idSWFScriptVar::ToBool(this: *(idSWFScriptVar **)a4);
  v8 = v6 == 0;
  num = (idPlayer *)thisObject->variables.num;
  if ( v8 )
  {
    cashDecl = num->cashDecl;
    v11 = (idInventoryCollection *)((int (__fastcall *)(idPlayer *, idSWFScriptObject *, const idSWFParmList *))num->GetInventory)(
                                     a1: num,
                                     a2: thisObject,
                                     a3: parms);
    v9.i = idInventoryCollection::FindTotalInventoryItemCount(this: v11, decl: cashDecl);
  }
  else
  {
    v9.i = idPlayer::GetVehicleCash(this: num);
  }
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->type = SWF_VAR_INTEGER;
  result->value = v9;
  return result;
}


// ========================================================================
// `idPlayer::OfferWares'::`10'::idSWFScriptFunction_PlayerVendor_GetVehicleHeading::Call
// EA  : 0x82E665A0
// RVA : 0x00E665A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_10_::idSWFScriptFunction_PlayerVendor_GetVehicleHeading::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  idSWFScriptVar *v4; // r28
  int v6; // r27
  int v7; // r29
  idInventoryCollection *v8; // r30
  int i; // r31
  idVehicleKey *InventoryItem; // r3
  idStrId *v11; // r3
  int index; // r31
  idStrId v13; // [sp+50h] [-40h] BYREF
  idInventoryItem v14; // [sp+54h] [-3Ch] BYREF

  v4 = result;
  if ( *(_DWORD *)(a4 + 4) == 1 )
  {
    v6 = idSWFScriptVar::ToInteger(this: *(idSWFScriptVar **)a4);
    v13.index = -1;
    if ( v6 == 0 )
    {
      idStrId::Set(this: &v13, key: "#STR_SWF_VEHICLE_VENDOR_GENERAL");
      goto LABEL_14;
    }
    v7 = 0;
    v8 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
    for ( i = 0; i < (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v8); ++i )
    {
      InventoryItem = (idVehicleKey *)idInventoryCollection::GetInventoryItem(this: v8, index: i);
      if ( InventoryItem != nullptr )
      {
        v11 = (idStrId *)idVehicleKey::CastTo(c: InventoryItem);
        if ( v11 != nullptr && v11[22].index != 0 )
        {
          if ( v6 - 1 == v7 )
          {
            v13.index = idInventoryItem::GetDisplayName(this: &v14, result: v11)->index;
            break;
          }
          ++v7;
        }
      }
    }
LABEL_14:
    index = v13.index;
    v4->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: v4);
    v4->value.i = index;
    v4->type = SWF_VAR_STRINGID;
    return v4;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
  }
  return result;
}


// ========================================================================
// `idPlayer::OfferWares'::`11'::idSWFScriptFunction_PlayerVendor_GetNumVehicles::Call
// EA  : 0x82E666C0
// RVA : 0x00E666C0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_11_::idSWFScriptFunction_PlayerVendor_GetNumVehicles::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int v4; // r31
  idSWFScriptVar::swfScriptVarValue_t v5; // r28
  idInventoryCollection *v6; // r30
  idVehicleKey *InventoryItem; // r3
  idVehicleKey *v8; // r3

  v4 = 0;
  v5.i = 0;
  v6 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
  if ( (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v6) > 0 )
  {
    do
    {
      InventoryItem = (idVehicleKey *)idInventoryCollection::GetInventoryItem(this: v6, index: v4);
      if ( InventoryItem != nullptr )
      {
        v8 = idVehicleKey::CastTo(c: InventoryItem);
        if ( v8 != nullptr && v8->equippedUpgrades.num > 0 )
          ++v5.i;
      }
      ++v4;
    }
    while ( v4 < (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v6) );
  }
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v5;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::LaunchPlayTestGui'::`5'::idSWFScriptFunction_PlaytestAvailableModel_Refresh::processFolder
// EA  : 0x82E66770
// RVA : 0x00E66770
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall _idPlayer::LaunchPlayTestGui_::_5_::idSWFScriptFunction_PlaytestAvailableModel_Refresh::processFolder(
        idStr *in_foldername,
        idStr *filter,
        idStr *index,
        _DWORD *a4)
{
  idFileList *v8; // r29
  int v9; // r28
  int v10; // r27
  idSWFScriptObject *v11; // r3
  idSWFScriptObject *v12; // r30
  int v13; // r4
  idFileList *v14; // r29
  int v15; // r27
  int v16; // r28
  idSWFScriptObject *v17; // r3
  idSWFScriptObject *v18; // r30
  int v19; // r4
  idSWFScriptVar v20; // [sp+58h] [-F8h] BYREF
  idSWFScriptVar v21; // [sp+60h] [-F0h] BYREF
  idSWFScriptVar v22; // [sp+68h] [-E8h] BYREF
  idSWFScriptVar v23[2]; // [sp+70h] [-E0h] BYREF
  idStr v24; // [sp+80h] [-D0h] BYREF
  idStr v25[5]; // [sp+A0h] [-B0h] BYREF

  v8 = fileSystem->ListFiles(this: fileSystem, a2: filter->data, a3: ".model", a4: 1, a5: 1);
  v9 = 0;
  if ( v8->list.num > 0 )
  {
    v10 = 0;
    do
    {
      idStr::idStr(this: &v24, text: v8->list.list[v10].data);
      if ( idStr::Find(searchIn: v24.data, searchFor: index->data, casesensitive: false, start: 0, end: v24.len) != -1 )
      {
        v11 = idSWFScriptObject::Alloc();
        v22.type = SWF_VAR_UNDEF;
        v12 = v11;
        idSWFScriptVar::Free(this: &v22);
        v22.type = SWF_VAR_STRING;
        v22.value.i = (int)idSWFScriptString::Alloc(s: &v24);
        idSWFScriptObject::Set(this: v12, name: "name", value: &v22);
        idSWFScriptVar::Free(this: &v22);
        v20.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v20);
        if ( v12 != nullptr )
        {
          v20.value.i = (int)v12;
          v20.type = SWF_VAR_OBJECT;
          ++v12->refCount;
        }
        else
        {
          v20.type = SWF_VAR_NULL;
        }
        v13 = (*a4)++;
        idSWFScriptObject::Set(this: *(idSWFScriptObject **)in_foldername->baseBuffer, index: v13, value: &v20);
        idSWFScriptVar::Free(this: &v20);
      }
      idStr::FreeData(this: &v24);
      ++v9;
      ++v10;
    }
    while ( v9 < v8->list.num );
  }
  v14 = fileSystem->ListFiles(this: fileSystem, a2: filter->data, a3: "/", a4: 1, a5: 1);
  v15 = 0;
  if ( v14->list.num > 0 )
  {
    v16 = 0;
    do
    {
      idStr::idStr(this: v25, text: v14->list.list[v16].data);
      if ( idStr::Find(searchIn: v25[0].data, searchFor: index->data, casesensitive: false, start: 0, end: v25[0].len) != -1 )
      {
        v17 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x60u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
        if ( v17 != nullptr )
          v18 = idSWFScriptObject::idSWFScriptObject(this: v17);
        else
          v18 = nullptr;
        v23[0].type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: v23);
        v23[0].type = SWF_VAR_STRING;
        v23[0].value.i = (int)idSWFScriptString::Alloc(s: v25);
        idSWFScriptObject::Set(this: v18, name: "name", value: v23);
        idSWFScriptVar::Free(this: v23);
        v21.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v21);
        if ( v18 != nullptr )
        {
          v21.value.i = (int)v18;
          v21.type = SWF_VAR_OBJECT;
          ++v18->refCount;
        }
        else
        {
          v21.type = SWF_VAR_NULL;
        }
        v19 = (*a4)++;
        idSWFScriptObject::Set(this: *(idSWFScriptObject **)in_foldername->baseBuffer, index: v19, value: &v21);
        idSWFScriptVar::Free(this: &v21);
      }
      idStr::FreeData(this: v25);
      ++v15;
      ++v16;
    }
    while ( v15 < v14->list.num );
  }
  idStr::FreeData(this: filter);
  idStr::FreeData(this: index);
}


// ========================================================================
// __unwind$528382
// EA  : 0x82E66A48
// RVA : 0x00E66A48
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528382()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 336 + 372));
}


// ========================================================================
// __unwind$528383
// EA  : 0x82E66A70
// RVA : 0x00E66A70
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528383()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 336 + 364));
}


// ========================================================================
// __unwind$528384
// EA  : 0x82E66A98
// RVA : 0x00E66A98
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528384()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 336 + 128));
}


// ========================================================================
// __unwind$528385
// EA  : 0x82E66AC0
// RVA : 0x00E66AC0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528385()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 104));
}


// ========================================================================
// __unwind$528386
// EA  : 0x82E66AE8
// RVA : 0x00E66AE8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528386()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 88));
}


// ========================================================================
// __unwind$528387
// EA  : 0x82E66B10
// RVA : 0x00E66B10
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528387()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 336 + 160));
}


// ========================================================================
// __unwind$528522
// EA  : 0x82E66B38
// RVA : 0x00E66B38
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528522()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 336 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$528388
// EA  : 0x82E66B64
// RVA : 0x00E66B64
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528388()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 112));
}


// ========================================================================
// __unwind$528389
// EA  : 0x82E66B8C
// RVA : 0x00E66B8C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528389()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 96));
}


// ========================================================================
// `idPlayer::LaunchPlayTestGui'::`5'::idSWFScriptFunction_PlaytestAvailableModel_Refresh::Call
// EA  : 0x82E66BC0
// RVA : 0x00E66BC0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::LaunchPlayTestGui_::_5_::idSWFScriptFunction_PlaytestAvailableModel_Refresh::Call(
        idSWFScriptVar *result,
        idStr *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  __int64 v7; // r10
  __int64 v8; // r6
  __int64 v9; // r8
  idSWFScriptVar *v10; // r25
  size_t type; // r27
  idStr *v12; // r29
  idStr *v13; // r3
  __int64 v14; // r10
  __int64 v15; // r8
  __int64 v16; // r6
  idStr *v17; // r3
  idSWFScriptVar v19; // [sp+50h] [-E0h] BYREF
  int v20; // [sp+58h] [-D8h]
  int v21; // [sp+5Ch] [-D4h] BYREF
  idSWFScriptObject v22; // [sp+60h] [-D0h] BYREF
  idSWFScriptVar v23; // [sp+D0h] [-60h] BYREF

  v20 = 0;
  v19.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v19);
  v19.value.i = 0;
  v19.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: *(idSWFScriptObject **)thisObject->baseBuffer, name: "length", value: &v19);
  idSWFScriptVar::Free(this: &v19);
  idStr::idStr(this: (idStr *)&v22.variables.granularity, text: &byte_8200D768);
  LODWORD(v9) = *(_DWORD *)(a4 + 4);
  if ( (int)v9 > 0 )
  {
    v10 = idSWFScriptVar::ToString(
            this: (idSWFScriptVar *)&v22.variablesHash[7],
            result: *(idStr **)a4,
            a3: v8,
            a4: v9,
            a5: v7);
    type = v10->type;
    idStr::EnsureAlloced(
      this: (idStr *)&v22.variables.granularity,
      amount: v10->type + 1,
      keepold: false,
      geometricGrowth: false);
    memcpy(Dst: (void *)v22.variablesHash[0], Src: v10->value.object, Size: type);
    *(_BYTE *)(type + v22.variablesHash[0]) = 0;
    *(_DWORD *)&v22.variables.granularity = type;
    idStr::FreeData(this: (idStr *)&v22.variablesHash[7]);
  }
  v21 = 0;
  v22.variables.num = (int)&v22.variablesHash[15];
  v12 = idStr::idStr(this: (idStr *)&v22.variablesHash[15], text: (const idStr *)&v22.variables.granularity);
  v13 = (idStr *)idSWFScriptObject::Get(
                   this: &v22,
                   result: *(idSWFScriptObject **)thisObject->baseBuffer,
                   name: "filterPath");
  v17 = (idStr *)idSWFScriptVar::ToString(this: &v23, result: v13, a3: v16, a4: v15, a5: v14);
  _idPlayer::LaunchPlayTestGui_::_5_::idSWFScriptFunction_PlaytestAvailableModel_Refresh::processFolder(
    in_foldername: thisObject,
    filter: v17,
    index: v12,
    a4: &v21);
  idSWFScriptVar::Free(this: (idSWFScriptVar *)&v22);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value.b = true;
  result->type = SWF_VAR_BOOL;
  v20 = 1;
  idStr::FreeData(this: (idStr *)&v22.variables.granularity);
  return result;
}


// ========================================================================
// __unwind$528651_1
// EA  : 0x82E66D14
// RVA : 0x00E66D14
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528651_1()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 304 + 80));
}


// ========================================================================
// __unwind$528652_1
// EA  : 0x82E66D3C
// RVA : 0x00E66D3C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528652_1()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 304 + 112));
}


// ========================================================================
// __unwind$528653_1
// EA  : 0x82E66D64
// RVA : 0x00E66D64
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528653_1()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 304 + 144));
}


// ========================================================================
// __unwind$528654_0
// EA  : 0x82E66D8C
// RVA : 0x00E66D8C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528654_0()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 304 + 104));
}


// ========================================================================
// __unwind$528655
// EA  : 0x82E66DB4
// RVA : 0x00E66DB4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528655()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 304 + 96));
}


// ========================================================================
// __unwind$528657
// EA  : 0x82E66DDC
// RVA : 0x00E66DDC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528657()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 304;
  if ( (*(_DWORD *)(v0 - 304 + 88) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 88) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 324));
  }
}


// ========================================================================
// `idPlayer::LaunchPlayTestGui'::`6'::idSWFScriptFunction_DoReaction::Call
// EA  : 0x82E66E28
// RVA : 0x00E66E28
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::LaunchPlayTestGui_::_6_::idSWFScriptFunction_DoReaction::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  __int64 v7; // r8
  __int64 v8; // r6
  __int64 v9; // r10
  idSWFScriptVar *v10; // r26
  size_t type; // r29
  idStr *FileExtension; // r3
  BOOL v13; // r29
  __int64 v14; // r10
  __int64 v15; // r8
  __int64 v16; // r6
  va *v17; // r3
  int v19; // [sp+8h] [-1108h]
  int v20; // [sp+Ch] [-1104h]
  int v21; // [sp+10h] [-1100h]
  int v22; // [sp+14h] [-10FCh]
  int v23; // [sp+18h] [-10F8h]
  int v24; // [sp+1Ch] [-10F4h]
  idSWFScriptVar v25; // [sp+58h] [-10B8h] BYREF
  idSWFScriptVar v26[2]; // [sp+60h] [-10B0h] BYREF
  idStr v27; // [sp+70h] [-10A0h] BYREF
  idStr v28; // [sp+90h] [-1080h] BYREF
  idStr v29; // [sp+B0h] [-1060h] BYREF
  va v30; // [sp+D0h] [-1040h] BYREF

  idStr::idStr(this: &v27, text: "playtest");
  LODWORD(v9) = *(_DWORD *)(a4 + 4);
  if ( (int)v9 > 0 )
  {
    v10 = idSWFScriptVar::ToString(this: (idSWFScriptVar *)&v29, result: *(idStr **)a4, a3: v8, a4: v7, a5: v9);
    type = v10->type;
    idStr::EnsureAlloced(this: &v27, amount: v10->type + 1, keepold: false, geometricGrowth: false);
    memcpy(Dst: v27.data, Src: v10->value.object, Size: type);
    v27.data[type] = 0;
    v27.len = type;
    idStr::FreeData(this: &v29);
  }
  FileExtension = idStr::GetFileExtension(this: &v28, result: &v27);
  v13 = (_cntlzw(idStr::Icmp(s1: FileExtension->data, s2: "model")) & 0x20) != 0;
  idStr::FreeData(this: &v28);
  if ( v13 )
  {
    HIDWORD(v16) = v27.data;
    v17 = va::va(
            this: &v30,
            fmt: "playtestModel %s\n",
            a3: v16,
            a4: v15,
            a5: v14,
            a6: v19,
            a7: v20,
            a8: v21,
            a9: v22,
            a10: v23,
            a11: v24);
    cmdSystem->AppendCommandText(this: cmdSystem, a2: v17->buffer);
    idSWFScriptVar::idSWFScriptVar(this: &v25, s: v27.data);
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "modelName", value: &v25);
    idSWFScriptVar::Free(this: &v25);
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = true;
  }
  else
  {
    idSWFScriptVar::idSWFScriptVar(this: v26, s: v27.data);
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "filterPath", value: v26);
    idSWFScriptVar::Free(this: v26);
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
  }
  result->type = SWF_VAR_BOOL;
  idStr::FreeData(this: &v27);
  return result;
}


// ========================================================================
// __unwind$528756
// EA  : 0x82E66FD0
// RVA : 0x00E66FD0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528756()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4368 + 112));
}


// ========================================================================
// __unwind$528757
// EA  : 0x82E66FF8
// RVA : 0x00E66FF8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528757()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4368 + 176));
}


// ========================================================================
// __unwind$528758
// EA  : 0x82E67020
// RVA : 0x00E67020
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528758()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4368 + 144));
}


// ========================================================================
// __unwind$528759
// EA  : 0x82E67048
// RVA : 0x00E67048
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528759()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4368 + 88));
}


// ========================================================================
// __unwind$528760
// EA  : 0x82E67070
// RVA : 0x00E67070
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528760()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 4368;
  if ( (*(_DWORD *)(v0 - 4368 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 4388));
  }
}


// ========================================================================
// __unwind$528763
// EA  : 0x82E670B4
// RVA : 0x00E670B4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528763()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4368 + 96));
}


// ========================================================================
// `idPlayer::LaunchPlayTestGui'::`7'::idSWFScriptFunction_ClearPlaytestModel::Call
// EA  : 0x82E670E8
// RVA : 0x00E670E8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::LaunchPlayTestGui_::_7_::idSWFScriptFunction_ClearPlaytestModel::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        __int64 parms,
        __int64 a4,
        __int64 a5)
{
  va *v7; // r3
  int v9; // [sp+8h] [-1078h]
  int v10; // [sp+Ch] [-1074h]
  int v11; // [sp+10h] [-1070h]
  int v12; // [sp+14h] [-106Ch]
  int v13; // [sp+18h] [-1068h]
  int v14; // [sp+1Ch] [-1064h]
  idSWFScriptVar v15[2]; // [sp+50h] [-1030h] BYREF
  va v16; // [sp+60h] [-1020h] BYREF

  LODWORD(a5) = 0;
  v15[0].type = SWF_VAR_STRINGID;
  v7 = va::va(this: &v16, fmt: "tm_remove\n", a3: parms, a4, a5, a6: v9, a7: v10, a8: v11, a9: v12, a10: v13, a11: v14);
  cmdSystem->AppendCommandText(this: cmdSystem, a2: v7->buffer);
  idSWFScriptVar::idSWFScriptVar(this: v15, s: &byte_8200D768);
  idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "modelName", value: v15);
  idSWFScriptVar::Free(this: v15);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->type = SWF_VAR_BOOL;
  result->value.b = true;
  return result;
}


// ========================================================================
// __unwind$528888
// EA  : 0x82E67190
// RVA : 0x00E67190
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528888()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4224 + 80));
}


// ========================================================================
// `idPlayer::LaunchPlayTestGui'::`8'::idSWFScriptFunction_DoBack::Call
// EA  : 0x82E671C0
// RVA : 0x00E671C0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::LaunchPlayTestGui_::_8_::idSWFScriptFunction_DoBack::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idStr *v5; // r3
  __int64 v6; // r10
  __int64 v7; // r8
  __int64 v8; // r6
  idSWFScriptVar v10; // [sp+58h] [-88h] BYREF
  idSWFScriptObject v11; // [sp+60h] [-80h] BYREF

  v5 = (idStr *)idSWFScriptObject::Get(
                  this: &v11,
                  result: (idSWFScriptObject *)thisObject->variables.size,
                  name: "filterPath");
  idSWFScriptVar::ToString(this: (idSWFScriptVar *)&v11.variablesHash[7], result: v5, a3: v8, a4: v7, a5: v6);
  idSWFScriptVar::Free(this: (idSWFScriptVar *)&v11);
  idStr::StripTrailing(this: (idStr *)&v11.variablesHash[7], c: 47);
  if ( idStr::Icmp(s1: (const char *)v11.variablesHash[8], s2: "playtest") != 0 )
  {
    *(_DWORD *)&v11.variables.granularity = 0;
    HIBYTE(v11.variablesHash[2]) = 0;
    v11.variablesHash[1] = 20;
    v11.variablesHash[0] = (int)&v11.variablesHash[2];
    idStr::ExtractFilePath(this: (idStr *)&v11.variablesHash[7], dest: (idStr *)&v11.variables.granularity);
    idStr::StripTrailing(this: (idStr *)&v11.variables.granularity, c: 47);
    idSWFScriptVar::idSWFScriptVar(this: &v10, s: (const char *)v11.variablesHash[0]);
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "filterPath", value: &v10);
    idSWFScriptVar::Free(this: &v10);
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = true;
    result->type = SWF_VAR_BOOL;
    idStr::FreeData(this: (idStr *)&v11.variables.granularity);
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
  }
  idStr::FreeData(this: (idStr *)&v11.variablesHash[7]);
  return result;
}


// ========================================================================
// __unwind$528926_0
// EA  : 0x82E672F0
// RVA : 0x00E672F0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528926_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 224 + 96));
}


// ========================================================================
// __unwind$528927
// EA  : 0x82E67318
// RVA : 0x00E67318
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528927()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 224 + 144));
}


// ========================================================================
// __unwind$528928
// EA  : 0x82E67340
// RVA : 0x00E67340
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528928()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 224;
  if ( (*(_DWORD *)(v0 - 224 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 244));
  }
}


// ========================================================================
// __unwind$528931
// EA  : 0x82E67384
// RVA : 0x00E67384
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528931()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 224 + 112));
}


// ========================================================================
// __unwind$528932
// EA  : 0x82E673AC
// RVA : 0x00E673AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_528932()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 224 + 88));
}


// ========================================================================
// `idPlayer::LaunchDebugJobGui'::`6'::idSWFScriptFunction_RespawnForJobSameMap::Call
// EA  : 0x82E673D8
// RVA : 0x00E673D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::LaunchDebugJobGui_::_6_::idSWFScriptFunction_RespawnForJobSameMap::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idPlayer::LaunchDebugJobGui(this: (idPlayer *)thisObject->variables.num);
  idPlayer::OfferJob(
    this: (idPlayer *)thisObject->variables.num,
    job: (idStrId *)thisObject->variables.size,
    offeringEntity: nullptr,
    skipActivate: false);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::LaunchDebugJobGui'::`7'::idSWFScriptFunction_PlayerJobsDebug_Refresh::Call
// EA  : 0x82E67440
// RVA : 0x00E67440
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::LaunchDebugJobGui_::_7_::idSWFScriptFunction_PlayerJobsDebug_Refresh::Call(
        idSWFScriptVar *result,
        const idDeclJob *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  idSWFScriptVar *v4; // r24
  unsigned __int8 v7; // r23
  int num; // r26
  int v9; // r8
  int v10; // r7
  int v11; // r6
  int v12; // r30
  int i; // r28
  idDeclSource **v14; // r10
  idDeclSource *v15; // r9
  idDeclJob *v16; // r3
  idMem *v17; // r20
  int v18; // r30
  idDeclJob *v19; // r24
  idSWFScriptObject *v20; // r3
  idSWFScriptObject *v21; // r23
  idDeclJob *JobName; // r3
  idSWFScriptVar::swfScriptVarValue_t v23; // r30
  idDeclJob *JobSummary; // r3
  idSWFScriptVar::swfScriptVarValue_t v25; // r30
  idDeclJob *JobRequirements; // r3
  idSWFScriptVar::swfScriptVarValue_t v27; // r30
  idDeclJob *JobReward; // r3
  idSWFScriptVar::swfScriptVarValue_t v29; // r30
  idStr *v30; // r3
  idStr *v31; // r30
  idSWFScriptVar::swfScriptVarValue_t v32; // r11
  __int64 v33; // r6
  __int64 v34; // r10
  __int64 v35; // r8
  va *v36; // r3
  va *v37; // r28
  size_t j; // r30
  int v39; // r4
  int v40; // r11
  int v41; // r28
  idDeclJob *JobPreconditionDebugString; // r3
  idStr *v43; // r28
  idStr *v44; // r3
  idStr *v45; // r30
  int len; // r27
  int allocedAndFlag; // r11
  int v48; // r4
  char *v49; // r10
  int v50; // r9
  char v51; // r11
  idSWFScriptVar::swfScriptVarValue_t v52; // r11
  __int64 v53; // r6
  __int64 v54; // r10
  __int64 v55; // r8
  va *v56; // r3
  va *v57; // r30
  size_t k; // r28
  int v59; // r4
  int v60; // r11
  int v61; // r30
  idDeclJob *JobAcceptRewardDebugString; // r3
  __int64 v63; // r6
  __int64 v64; // r10
  __int64 v65; // r8
  va *v66; // r3
  int m; // r30
  idDeclJob *JobReadyRewardDebugString; // r3
  idStr *v69; // r28
  idStr *v70; // r3
  idStr *v71; // r30
  int v72; // r11
  int v73; // r27
  int v74; // r4
  char *v75; // r10
  int v76; // r9
  char v77; // r11
  idSWFScriptVar::swfScriptVarValue_t v78; // r11
  __int64 v79; // r6
  __int64 v80; // r10
  __int64 v81; // r8
  va *v82; // r3
  va *v83; // r30
  size_t n; // r28
  int v85; // r4
  int v86; // r11
  int v87; // r30
  idDeclJob *CompletionRequirementDebugString; // r3
  idStr *v89; // r28
  idStr *v90; // r3
  idStr *v91; // r30
  int v92; // r27
  int v93; // r4
  int v94; // r11
  char *v95; // r10
  int v96; // r9
  char v97; // r11
  idSWFScriptVar::swfScriptVarValue_t v98; // r11
  __int64 v99; // r6
  __int64 v100; // r10
  __int64 v101; // r8
  va *v102; // r3
  va *v103; // r30
  size_t ii; // r28
  int v105; // r4
  int v106; // r11
  int v107; // r30
  idDeclJob *JobRewardDebugString; // r3
  idStr *v109; // r28
  idStr *v110; // r3
  idStr *v111; // r30
  int v112; // r11
  int v113; // r27
  int v114; // r4
  char *v115; // r10
  int v116; // r9
  char v117; // r11
  idSWFScriptVar::swfScriptVarValue_t v118; // r11
  __int64 v119; // r6
  __int64 v120; // r10
  __int64 v121; // r8
  va *v122; // r3
  va *v123; // r30
  size_t jj; // r28
  int v125; // r4
  int v126; // r11
  int v127; // r30
  idDeclJob *JobDebugRewardDebugString; // r3
  idStr *v129; // r28
  idStr *v130; // r3
  idStr *v131; // r30
  int v132; // r11
  int v133; // r27
  int v134; // r4
  char *v135; // r10
  int v136; // r9
  char v137; // r11
  idSWFScriptVar::swfScriptVarValue_t v138; // r11
  idJob *JobByDecl; // r3
  idMapModel *v140; // r27
  idSWFScriptVar::swfScriptVarValue_t v141; // r30
  idSWFScriptVar *v142; // r3
  __int64 v143; // r8
  __int64 v144; // r6
  __int64 v145; // r10
  va *v146; // r3
  va *v147; // r28
  size_t mm; // r30
  int v149; // r4
  int v150; // r11
  va *v151; // r3
  va *v152; // r30
  size_t kk; // r28
  int v154; // r4
  int v155; // r11
  int v156; // r30
  const char *v157; // r28
  __int64 v158; // r6
  __int64 v159; // r10
  __int64 v160; // r8
  va *v161; // r3
  idMapPrimitive *JobNote; // r3
  idStr *list; // r11
  int *v164; // r10
  int v165; // r9
  char *LocalizedString; // r3
  idStr *v167; // r28
  idStr *v168; // r3
  idStr *v169; // r30
  int v170; // r11
  int v171; // r27
  int v172; // r4
  char *v173; // r10
  int v174; // r9
  char v175; // r11
  idSWFScriptVar::swfScriptVarValue_t v176; // r11
  __int64 v177; // r10
  __int64 v178; // r8
  __int64 v179; // r6
  int v180; // r26
  int v181; // r27
  int v182; // r28
  const char *str; // r4
  const idDecl *v184; // r30
  char *v185; // r3
  va *v186; // r3
  va *v187; // r28
  size_t nn; // r30
  int v189; // r4
  int v190; // r11
  idStr *v191; // r28
  idStr *v192; // r3
  idStr *v193; // r30
  int v194; // r11
  int v195; // r27
  int v196; // r4
  char *v197; // r10
  int v198; // r9
  char v199; // r11
  void *(__fastcall ***v200)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r3
  int v201; // r10
  idSWFScriptVar::swfScriptVarValue_t v202; // r30
  void *(__fastcall **v203)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r11
  void *(__fastcall ***v204)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r3
  int v205; // r11
  idSWFScriptVar::swfScriptVarValue_t v206; // r30
  void *(__fastcall **v207)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r10
  void *(__fastcall ***v208)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r3
  int v209; // r11
  idSWFScriptVar::swfScriptVarValue_t v210; // r30
  void *(__fastcall **v211)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r10
  int v212; // r30
  int v215; // [sp+8h] [-1448h]
  int v216; // [sp+8h] [-1448h]
  int v217; // [sp+8h] [-1448h]
  int v218; // [sp+8h] [-1448h]
  int v219; // [sp+8h] [-1448h]
  int v220; // [sp+8h] [-1448h]
  int v221; // [sp+8h] [-1448h]
  int v222; // [sp+Ch] [-1444h]
  int v223; // [sp+Ch] [-1444h]
  int v224; // [sp+Ch] [-1444h]
  int v225; // [sp+Ch] [-1444h]
  int v226; // [sp+Ch] [-1444h]
  int v227; // [sp+Ch] [-1444h]
  int v228; // [sp+Ch] [-1444h]
  int v229; // [sp+10h] [-1440h]
  int v230; // [sp+10h] [-1440h]
  int v231; // [sp+10h] [-1440h]
  int v232; // [sp+10h] [-1440h]
  int v233; // [sp+10h] [-1440h]
  int v234; // [sp+10h] [-1440h]
  int v235; // [sp+10h] [-1440h]
  int v236; // [sp+14h] [-143Ch]
  int v237; // [sp+14h] [-143Ch]
  int v238; // [sp+14h] [-143Ch]
  int v239; // [sp+14h] [-143Ch]
  int v240; // [sp+14h] [-143Ch]
  int v241; // [sp+14h] [-143Ch]
  int v242; // [sp+14h] [-143Ch]
  int v243; // [sp+18h] [-1438h]
  int v244; // [sp+18h] [-1438h]
  int v245; // [sp+18h] [-1438h]
  int v246; // [sp+18h] [-1438h]
  int v247; // [sp+18h] [-1438h]
  int v248; // [sp+18h] [-1438h]
  int v249; // [sp+18h] [-1438h]
  idVec1 *v250; // [sp+1Ch] [-1434h]
  int v251; // [sp+1Ch] [-1434h]
  int v252; // [sp+1Ch] [-1434h]
  int v253; // [sp+1Ch] [-1434h]
  int v254; // [sp+1Ch] [-1434h]
  int v255; // [sp+1Ch] [-1434h]
  int v256; // [sp+1Ch] [-1434h]
  idStr v257; // [sp+50h] [-1400h] BYREF
  idDeclSource **v258; // [sp+70h] [-13E0h]
  int v259; // [sp+74h] [-13DCh]
  char *v260; // [sp+78h] [-13D8h]
  char *v261; // [sp+7Ch] [-13D4h]
  idMem *v262; // [sp+80h] [-13D0h]
  char *v263; // [sp+84h] [-13CCh]
  idSWFScriptVar v264; // [sp+88h] [-13C8h] BYREF
  idSWFScriptVar v265; // [sp+90h] [-13C0h] BYREF
  idSWFScriptVar v266; // [sp+98h] [-13B8h] BYREF
  idSWFScriptVar v267[2]; // [sp+A0h] [-13B0h] BYREF
  idList<idVehicleState *,5> v268; // [sp+B0h] [-13A0h] BYREF
  idSWFScriptVar v269; // [sp+C0h] [-1390h] BYREF
  idSWFScriptVar v270; // [sp+C8h] [-1388h] BYREF
  char *v271; // [sp+D0h] [-1380h]
  idSWFScriptVar v272; // [sp+D8h] [-1378h] BYREF
  idSWFScriptVar v273; // [sp+E0h] [-1370h] BYREF
  idSWFScriptVar v274; // [sp+E8h] [-1368h] BYREF
  idSWFScriptVar v275; // [sp+F0h] [-1360h] BYREF
  idSWFScriptVar v276; // [sp+F8h] [-1358h] BYREF
  idSWFScriptVar v277; // [sp+100h] [-1350h] BYREF
  idSWFScriptVar v278; // [sp+108h] [-1348h] BYREF
  char *v279; // [sp+110h] [-1340h]
  __int64 v280; // [sp+118h] [-1338h] BYREF
  idSWFScriptVar v281; // [sp+120h] [-1330h] BYREF
  idSWFScriptVar v282; // [sp+128h] [-1328h] BYREF
  idSWFScriptVar v283; // [sp+130h] [-1320h] BYREF
  idSWFScriptVar v284; // [sp+138h] [-1318h] BYREF
  idSWFScriptVar v285; // [sp+140h] [-1310h] BYREF
  int v286; // [sp+148h] [-1308h]
  void *(__fastcall **v287)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // [sp+14Ch] [-1304h]
  char *v288; // [sp+150h] [-1300h]
  void *(__fastcall **v289)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // [sp+154h] [-12FCh]
  const char *v290; // [sp+158h] [-12F8h]
  void *(__fastcall **v291)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // [sp+15Ch] [-12F4h]
  char *v292; // [sp+160h] [-12F0h]
  int v293; // [sp+164h] [-12ECh]
  const char *v294; // [sp+168h] [-12E8h]
  const char *v295; // [sp+16Ch] [-12E4h]
  const char *v296; // [sp+170h] [-12E0h]
  const char *v297; // [sp+174h] [-12DCh]
  const char *v298; // [sp+178h] [-12D8h]
  char *v299; // [sp+17Ch] [-12D4h]
  int v300; // [sp+180h] [-12D0h] BYREF
  char *v301; // [sp+184h] [-12CCh]
  int v302; // [sp+188h] [-12C8h] BYREF
  char *v303; // [sp+18Ch] [-12C4h]
  idStrId v304; // [sp+190h] [-12C0h] BYREF
  int v305; // [sp+194h] [-12BCh]
  char *v306; // [sp+198h] [-12B8h]
  const char *v307; // [sp+19Ch] [-12B4h]
  idStrId v308; // [sp+1A0h] [-12B0h] BYREF
  const char *v309; // [sp+1A4h] [-12ACh]
  const char *v310; // [sp+1A8h] [-12A8h]
  char *v311; // [sp+1ACh] [-12A4h]
  char *v312; // [sp+1B0h] [-12A0h]
  int v313; // [sp+1B4h] [-129Ch]
  char *v314; // [sp+1B8h] [-1298h]
  const char *v315; // [sp+1BCh] [-1294h]
  idStr v316; // [sp+1C0h] [-1290h] BYREF
  idDeclJob v317[4]; // [sp+1E0h] [-1270h] BYREF

  v305 = 0;
  v4 = result;
  v269.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v269);
  v269.value.i = 0;
  v269.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->nextOnHashChain, name: "length", value: &v269);
  idSWFScriptVar::Free(this: &v269);
  v7 = 0;
  if ( *(int *)(a4 + 4) > 0 )
    v7 = idSWFScriptVar::ToBool(this: *(idSWFScriptVar **)a4);
  memset(&v268, 0, 14);
  *(_WORD *)&v268.memTag = 1280;
  num = idDeclJob::resourceList.declSources.num;
  v293 = idDeclJob::resourceList.declSources.num;
  idList<idThread *,58>::Clear(this: &v268);
  if ( num > v268.size )
    idList<idNavSpline *,5>::Resize(this: (idList<idSpawnArea::GeneratedPosition *,5> *)&v268, newsize: num);
  if ( num > 0 )
  {
    v12 = 0;
    for ( i = num; i != 0; --i )
    {
      v14 = &idDeclJob::resourceList.declSources.list[v12];
      v271 = (char *)&idDeclJob::resourceList.declSources.list[v12];
      v15 = idDeclJob::resourceList.declSources.list[v12];
      if ( v15->name.str != nullptr )
        v16 = (idDeclJob *)idDeclInfo::FindWithInheritance(
                             this: &idDeclJob::resourceList,
                             name: v15->name.str,
                             makeDefault: false);
      else
        v16 = nullptr;
      _idPlayer::LaunchDebugJobGui_::_7_::idSWFScriptFunction_PlayerJobsDebug_Refresh::InsertJob(
        jobDecl: thisObject,
        jobList: v16,
        a3: (idList<idVec1,116> *)&v268,
        a4: v11,
        a5: v10,
        a6: v9,
        a7: (int)v15,
        a8: (int)v14,
        a9: v215,
        a10: v222,
        a11: v229,
        a12: v236,
        a13: v243,
        a14: v250);
      ++v12;
    }
  }
  v259 = 0;
  v286 = 0;
  v17 = &mem;
  v262 = &mem;
  if ( num > 0 )
  {
    v313 = v7;
    v291 = &`idPlayer::LaunchDebugJobGui'::`6'::idSWFScriptFunction_RespawnForJobSameMap::`vftable';
    v312 = "possiblejobnoteslist";
    v289 = &`idPlayer::LaunchDebugJobGui'::`5'::idSWFScriptFunction_RespawnForJob::`vftable';
    v287 = &`idPlayer::LaunchDebugJobGui'::`2'::idSWFScriptFunction_IncreaseJob::`vftable';
    v309 = "REWARDS %d";
    v271 = "RespawnForJobSameMap";
    v303 = "RespawnForJob";
    v314 = "IncreaseJob";
    v306 = "jobnoteslist";
    v298 = "%d: ";
    v296 = "JOB NOTES: %d";
    v294 = "JOB NOTES: NULL";
    v279 = "status";
    v310 = "POSSIBLE JOB NOTES: %d";
    v17 = v262;
    v288 = "rewardlist";
    v292 = "debugrewardlist";
    v290 = "DEBUG REWARDS %d";
    v301 = "completionlist";
    v315 = "COMPLETION REQUIREMENTS %d";
    v299 = "acceptrewardlist";
    v307 = "\nREADY REWARDS %d";
    v18 = v259;
    v297 = "ACCEPT REWARDS %d";
    v311 = "preconditionlist";
    v260 = "name";
    v295 = "PRECONDITIONS %d";
    v262 = (idMem *)"jobpath";
    v261 = "requirements";
    v263 = "summary";
    do
    {
      v19 = (idDeclJob *)v268.list[v18];
      idStr::idStr(this: (idStr *)&v317[0].resourceListPtr, text: v19->name.str);
      if ( v313 != 0 || (unsigned __int8)idDeclJob::IsQuestJob(this: v19) != 0 && v19->showOnDebugJobGUI )
      {
        v20 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                     this: v17,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x60u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
        v258 = (idDeclSource **)v20;
        if ( v20 != nullptr )
          v21 = idSWFScriptObject::idSWFScriptObject(this: v20);
        else
          v21 = nullptr;
        JobName = idDeclJob::GetJobName(this: (idDeclJob *)&v317[0].name, result: (idStrId *)v19);
        v273.type = SWF_VAR_UNDEF;
        *(idDeclJob_vtbl **)&v23.f = JobName->__vftable;
        idSWFScriptVar::Free(this: &v273);
        v273.value = v23;
        v273.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v21, name: v260, value: &v273);
        idSWFScriptVar::Free(this: &v273);
        JobSummary = idDeclJob::GetJobSummary(this: v317, result: (idStrId *)v19);
        v283.type = SWF_VAR_UNDEF;
        *(idDeclJob_vtbl **)&v25.f = JobSummary->__vftable;
        idSWFScriptVar::Free(this: &v283);
        v283.value = v25;
        v283.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v21, name: v263, value: &v283);
        idSWFScriptVar::Free(this: &v283);
        JobRequirements = idDeclJob::GetJobRequirements(
                            this: (idDeclJob *)&v317[0].nextOnHashChain,
                            result: (idStrId *)v19);
        v275.type = SWF_VAR_UNDEF;
        *(idDeclJob_vtbl **)&v27.f = JobRequirements->__vftable;
        idSWFScriptVar::Free(this: &v275);
        v275.value = v27;
        v275.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v21, name: v261, value: &v275);
        idSWFScriptVar::Free(this: &v275);
        JobReward = idDeclJob::GetJobReward(this: (idDeclJob *)&v317[0].trackedMemory, result: (idStrId *)v19);
        v281.type = SWF_VAR_UNDEF;
        *(idDeclJob_vtbl **)&v29.f = JobReward->__vftable;
        idSWFScriptVar::Free(this: &v281);
        v281.value = v29;
        v281.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v21, name: "reward", value: &v281);
        idSWFScriptVar::Free(this: &v281);
        v277.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v277);
        v277.type = SWF_VAR_STRING;
        v30 = (idStr *)idMem::AllocWithLocation(
                         this: v17,
                         location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                         size: 0x24u,
                         tag: TAG_SWF,
                         zeroBuffer: false,
                         align: ALIGN_16,
                         heap: HEAP_DEFAULTHEAP);
        v31 = v30;
        v258 = (idDeclSource **)v30;
        if ( v30 != nullptr )
        {
          idStr::idStr(this: v30, text: (const idStr *)&v317[0].resourceListPtr);
          v32.i = (int)v31;
          v31[1].len = 1;
        }
        else
        {
          v32.i = 0;
        }
        v277.value = v32;
        idSWFScriptObject::Set(this: v21, name: (char *)v262, value: &v277);
        idSWFScriptVar::Free(this: &v277);
        v257.allocedAndFlag = 20;
        v257.data = v257.baseBuffer;
        v257.len = 0;
        v257.baseBuffer[0] = 0;
        HIDWORD(v33) = idMapPatch::GetMaterial(hSSMDev: v19);
        v36 = va::va(
                this: (va *)&v317[0].jobNoteInfo.completeJobNotesRemove.num,
                fmt: v295,
                a3: v33,
                a4: v35,
                a5: v34,
                a6: v215,
                a7: v222,
                a8: v229,
                a9: v236,
                a10: v243,
                a11: (int)v250);
        v37 = v36;
        for ( j = 0; v36->buffer[j] != 0; ++j )
          ;
        v39 = j + 1;
        v40 = v257.allocedAndFlag & 0x7FFFFFFF;
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( v39 > v40 )
            idStr::ReAllocate(this: &v257, amount: v39, keepold: false);
        }
        else if ( v39 > v40
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        memcpy(Dst: v257.data, Src: v37, Size: j);
        v41 = 0;
        v257.data[j] = 0;
        for ( v257.len = j; v41 < (int)idMapPatch::GetMaterial(hSSMDev: v19); ++v41 )
        {
          idStr::Append(this: &v257, text: "\n");
          JobPreconditionDebugString = idDeclJob::GetJobPreconditionDebugString(
                                         this: (idDeclJob *)&v317[0].jobNoteInfo.readyJobNotesRemove.num,
                                         result: (idStr *)v19,
                                         idx: v41);
          idStr::Append(this: &v257, text: (char *)JobPreconditionDebugString->trackedMemory);
          idStr::FreeData(this: (idStr *)&v317[0].jobNoteInfo.readyJobNotesRemove.num);
        }
        v285.type = SWF_VAR_UNDEF;
        v43 = idStr::idStr(this: (idStr *)&v317[0].normalFlowVars, text: v257.data);
        idSWFScriptVar::Free(this: &v285);
        v285.type = SWF_VAR_STRING;
        v44 = (idStr *)idMem::AllocWithLocation(
                         this: v17,
                         location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                         size: 0x24u,
                         tag: TAG_SWF,
                         zeroBuffer: false,
                         align: ALIGN_16,
                         heap: HEAP_DEFAULTHEAP);
        v45 = v44;
        v258 = (idDeclSource **)v44;
        if ( v44 != nullptr )
        {
          v44->allocedAndFlag = 20;
          v44->len = 0;
          v44->data = v44->baseBuffer;
          v44->baseBuffer[0] = 0;
          len = v43->len;
          allocedAndFlag = v44->allocedAndFlag;
          v48 = v43->len + 1;
          if ( allocedAndFlag >= 0 )
          {
            if ( v48 > (allocedAndFlag & 0x7FFFFFFF) )
              idStr::ReAllocate(this: v44, amount: v48, keepold: true);
          }
          else if ( v48 > (allocedAndFlag & 0x7FFFFFFF)
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          v49 = v43->data - 1;
          v50 = (int)(v45->data - 1);
          do
          {
            v51 = *++v49;
            *(_BYTE *)++v50 = *v49;
          }
          while ( v51 != 0 );
          v45->len = len;
          v52.i = (int)v45;
          v45[1].len = 1;
        }
        else
        {
          v52.i = 0;
        }
        v285.value = v52;
        idStr::FreeData(this: (idStr *)&v317[0].normalFlowVars);
        idSWFScriptObject::Set(this: v21, name: v311, value: &v285);
        idSWFScriptVar::Free(this: &v285);
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0 )
            idStr::ReAllocate(this: &v257, amount: 1, keepold: true);
        }
        else if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        *v257.data = 0;
        v257.len = 0;
        HIDWORD(v53) = XAUDIO2::CX2SubmixVoice::ProcessingStage(this: (XAUDIO2::CX2SubmixVoice *)v19);
        v56 = va::va(
                this: (va *)&v317[0].jobNoteInfo.completeJobNotesRemove.num,
                fmt: v297,
                a3: v53,
                a4: v55,
                a5: v54,
                a6: v216,
                a7: v223,
                a8: v230,
                a9: v237,
                a10: v244,
                a11: v251);
        v57 = v56;
        for ( k = 0; v56->buffer[k] != 0; ++k )
          ;
        v59 = k + 1;
        v60 = v257.allocedAndFlag & 0x7FFFFFFF;
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( v59 > v60 )
            idStr::ReAllocate(this: &v257, amount: v59, keepold: false);
        }
        else if ( v59 > v60
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        memcpy(Dst: v257.data, Src: v57, Size: k);
        v61 = 0;
        v257.data[k] = 0;
        for ( v257.len = k; v61 < (int)XAUDIO2::CX2SubmixVoice::ProcessingStage(this: (XAUDIO2::CX2SubmixVoice *)v19); ++v61 )
        {
          idStr::Append(this: &v257, text: "\n");
          JobAcceptRewardDebugString = idDeclJob::GetJobAcceptRewardDebugString(
                                         this: (idDeclJob *)&v317[0].jobLayerInfo.readyLayersDeactive.num,
                                         result: (idStr *)v19,
                                         idx: v61);
          idStr::Append(this: &v257, text: (char *)JobAcceptRewardDebugString->trackedMemory);
          idStr::FreeData(this: (idStr *)&v317[0].jobLayerInfo.readyLayersDeactive.num);
        }
        if ( idPhysics_AF::GetNumConstraints(this: (idPhysics_AF *)v19) > 0 )
        {
          HIDWORD(v63) = XAUDIO2::CX2SubmixVoice::ProcessingStage(this: (XAUDIO2::CX2SubmixVoice *)v19);
          v66 = va::va(
                  this: (va *)&v317[0].jobNoteInfo.completeJobNotesRemove.num,
                  fmt: v307,
                  a3: v63,
                  a4: v65,
                  a5: v64,
                  a6: v217,
                  a7: v224,
                  a8: v231,
                  a9: v238,
                  a10: v245,
                  a11: v252);
          idStr::Append(this: &v257, text: v66);
          for ( m = 0; m < idPhysics_AF::GetNumConstraints(this: (idPhysics_AF *)v19); ++m )
          {
            idStr::Append(this: &v257, text: "\n");
            JobReadyRewardDebugString = idDeclJob::GetJobReadyRewardDebugString(
                                          this: (idDeclJob *)&v317[0].completion.size,
                                          result: (idStr *)v19,
                                          idx: m);
            idStr::Append(this: &v257, text: (char *)JobReadyRewardDebugString->trackedMemory);
            idStr::FreeData(this: (idStr *)&v317[0].completion.size);
          }
        }
        v270.type = SWF_VAR_UNDEF;
        v69 = idStr::idStr(this: (idStr *)&v317[0].programaticallyDefined, text: v257.data);
        idSWFScriptVar::Free(this: &v270);
        v270.type = SWF_VAR_STRING;
        v70 = (idStr *)idMem::AllocWithLocation(
                         this: v17,
                         location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                         size: 0x24u,
                         tag: TAG_SWF,
                         zeroBuffer: false,
                         align: ALIGN_16,
                         heap: HEAP_DEFAULTHEAP);
        v71 = v70;
        v258 = (idDeclSource **)v70;
        if ( v70 != nullptr )
        {
          v70->allocedAndFlag = 20;
          v70->len = 0;
          v70->data = v70->baseBuffer;
          v70->baseBuffer[0] = 0;
          v72 = v70->allocedAndFlag;
          v73 = v69->len;
          v74 = v69->len + 1;
          if ( v72 >= 0 )
          {
            if ( v74 > (v72 & 0x7FFFFFFF) )
              idStr::ReAllocate(this: v70, amount: v74, keepold: true);
          }
          else if ( v74 > (v72 & 0x7FFFFFFF)
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          v75 = v69->data - 1;
          v76 = (int)(v71->data - 1);
          do
          {
            v77 = *++v75;
            *(_BYTE *)++v76 = *v75;
          }
          while ( v77 != 0 );
          v71->len = v73;
          v78.i = (int)v71;
          v71[1].len = 1;
        }
        else
        {
          v78.i = 0;
        }
        v270.value = v78;
        idStr::FreeData(this: (idStr *)&v317[0].programaticallyDefined);
        idSWFScriptObject::Set(this: v21, name: v299, value: &v270);
        idSWFScriptVar::Free(this: &v270);
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0 )
            idStr::ReAllocate(this: &v257, amount: 1, keepold: true);
        }
        else if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        *v257.data = 0;
        v257.len = 0;
        HIDWORD(v79) = idDeclJob::GetNumCompletionRequirements(this: v19);
        v82 = va::va(
                this: (va *)&v317[0].jobNoteInfo.completeJobNotesRemove.num,
                fmt: v315,
                a3: v79,
                a4: v81,
                a5: v80,
                a6: v217,
                a7: v224,
                a8: v231,
                a9: v238,
                a10: v245,
                a11: v252);
        v83 = v82;
        for ( n = 0; v82->buffer[n] != 0; ++n )
          ;
        v85 = n + 1;
        v86 = v257.allocedAndFlag & 0x7FFFFFFF;
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( v85 > v86 )
            idStr::ReAllocate(this: &v257, amount: v85, keepold: false);
        }
        else if ( v85 > v86
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        memcpy(Dst: v257.data, Src: v83, Size: n);
        v87 = 0;
        v257.data[n] = 0;
        for ( v257.len = n; v87 < idDeclJob::GetNumCompletionRequirements(this: v19); ++v87 )
        {
          idStr::Append(this: &v257, text: "\n");
          CompletionRequirementDebugString = idDeclJob::GetCompletionRequirementDebugString(
                                               this: (idDeclJob *)&v317[0].jobLayerInfo.acceptLayers.num,
                                               result: (idStr *)v19,
                                               idx: v87);
          idStr::Append(this: &v257, text: (char *)CompletionRequirementDebugString->trackedMemory);
          idStr::FreeData(this: (idStr *)&v317[0].jobLayerInfo.acceptLayers.num);
        }
        v272.type = SWF_VAR_UNDEF;
        v89 = idStr::idStr(this: (idStr *)&v317[0].jobLayerInfo.completeLayersRemove.num, text: v257.data);
        idSWFScriptVar::Free(this: &v272);
        v272.type = SWF_VAR_STRING;
        v90 = (idStr *)idMem::AllocWithLocation(
                         this: v17,
                         location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                         size: 0x24u,
                         tag: TAG_SWF,
                         zeroBuffer: false,
                         align: ALIGN_16,
                         heap: HEAP_DEFAULTHEAP);
        v91 = v90;
        v258 = (idDeclSource **)v90;
        if ( v90 != nullptr )
        {
          v90->allocedAndFlag = 20;
          v90->len = 0;
          v90->data = v90->baseBuffer;
          v90->baseBuffer[0] = 0;
          v92 = v89->len;
          v93 = v89->len + 1;
          v94 = v90->allocedAndFlag;
          if ( v94 >= 0 )
          {
            if ( v93 > (v94 & 0x7FFFFFFF) )
              idStr::ReAllocate(this: v90, amount: v93, keepold: true);
          }
          else if ( v93 > (v94 & 0x7FFFFFFF)
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          v95 = v89->data - 1;
          v96 = (int)(v91->data - 1);
          do
          {
            v97 = *++v95;
            *(_BYTE *)++v96 = *v95;
          }
          while ( v97 != 0 );
          v91->len = v92;
          v98.i = (int)v91;
          v91[1].len = 1;
        }
        else
        {
          v98.i = 0;
        }
        v272.value = v98;
        idStr::FreeData(this: (idStr *)&v317[0].jobLayerInfo.completeLayersRemove.num);
        idSWFScriptObject::Set(this: v21, name: v301, value: &v272);
        idSWFScriptVar::Free(this: &v272);
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0 )
            idStr::ReAllocate(this: &v257, amount: 1, keepold: true);
        }
        else if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        *v257.data = 0;
        v257.len = 0;
        HIDWORD(v99) = idDeclJob::GetNumJobRewards(this: v19);
        v102 = va::va(
                 this: (va *)&v317[0].jobNoteInfo.completeJobNotesRemove.num,
                 fmt: v309,
                 a3: v99,
                 a4: v101,
                 a5: v100,
                 a6: v218,
                 a7: v225,
                 a8: v232,
                 a9: v239,
                 a10: v246,
                 a11: v253);
        v103 = v102;
        for ( ii = 0; v102->buffer[ii] != 0; ++ii )
          ;
        v105 = ii + 1;
        v106 = v257.allocedAndFlag & 0x7FFFFFFF;
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( v105 > v106 )
            idStr::ReAllocate(this: &v257, amount: v105, keepold: false);
        }
        else if ( v105 > v106
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        memcpy(Dst: v257.data, Src: v103, Size: ii);
        v107 = 0;
        v257.data[ii] = 0;
        for ( v257.len = ii; v107 < idDeclJob::GetNumJobRewards(this: v19); ++v107 )
        {
          idStr::Append(this: &v257, text: "\n");
          JobRewardDebugString = idDeclJob::GetJobRewardDebugString(
                                   this: (idDeclJob *)&v317[0].jobStanleyObjId,
                                   result: (idStr *)v19,
                                   idx: v107);
          idStr::Append(this: &v257, text: (char *)JobRewardDebugString->trackedMemory);
          idStr::FreeData(this: (idStr *)&v317[0].jobStanleyObjId);
        }
        v274.type = SWF_VAR_UNDEF;
        v109 = idStr::idStr(this: (idStr *)&v317[0].acceptRewards.size, text: v257.data);
        idSWFScriptVar::Free(this: &v274);
        v274.type = SWF_VAR_STRING;
        v110 = (idStr *)idMem::AllocWithLocation(
                          this: v17,
                          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                          size: 0x24u,
                          tag: TAG_SWF,
                          zeroBuffer: false,
                          align: ALIGN_16,
                          heap: HEAP_DEFAULTHEAP);
        v111 = v110;
        v258 = (idDeclSource **)v110;
        if ( v110 != nullptr )
        {
          v110->allocedAndFlag = 20;
          v110->len = 0;
          v110->data = v110->baseBuffer;
          v110->baseBuffer[0] = 0;
          v112 = v110->allocedAndFlag;
          v113 = v109->len;
          v114 = v109->len + 1;
          if ( v112 >= 0 )
          {
            if ( v114 > (v112 & 0x7FFFFFFF) )
              idStr::ReAllocate(this: v110, amount: v114, keepold: true);
          }
          else if ( v114 > (v112 & 0x7FFFFFFF)
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          v115 = v109->data - 1;
          v116 = (int)(v111->data - 1);
          do
          {
            v117 = *++v115;
            *(_BYTE *)++v116 = *v115;
          }
          while ( v117 != 0 );
          v111->len = v113;
          v118.i = (int)v111;
          v111[1].len = 1;
        }
        else
        {
          v118.i = 0;
        }
        v274.value = v118;
        idStr::FreeData(this: (idStr *)&v317[0].acceptRewards.size);
        idSWFScriptObject::Set(this: v21, name: v288, value: &v274);
        idSWFScriptVar::Free(this: &v274);
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0 )
            idStr::ReAllocate(this: &v257, amount: 1, keepold: true);
        }
        else if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        *v257.data = 0;
        v257.len = 0;
        HIDWORD(v119) = idDeclJob::GetNumDebugRewards(this: v19);
        v122 = va::va(
                 this: (va *)&v317[0].jobNoteInfo.completeJobNotesRemove.num,
                 fmt: v290,
                 a3: v119,
                 a4: v121,
                 a5: v120,
                 a6: v219,
                 a7: v226,
                 a8: v233,
                 a9: v240,
                 a10: v247,
                 a11: v254);
        v123 = v122;
        for ( jj = 0; v122->buffer[jj] != 0; ++jj )
          ;
        v125 = jj + 1;
        v126 = v257.allocedAndFlag & 0x7FFFFFFF;
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( v125 > v126 )
            idStr::ReAllocate(this: &v257, amount: v125, keepold: false);
        }
        else if ( v125 > v126
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        memcpy(Dst: v257.data, Src: v123, Size: jj);
        v127 = 0;
        v257.data[jj] = 0;
        for ( v257.len = jj; v127 < idDeclJob::GetNumDebugRewards(this: v19); ++v127 )
        {
          idStr::Append(this: &v257, text: "\n");
          JobDebugRewardDebugString = idDeclJob::GetJobDebugRewardDebugString(
                                        this: (idDeclJob *)&v317[0].acceptedMiniMapTravelEnt.size,
                                        result: (idStr *)v19,
                                        idx: v127);
          idStr::Append(this: &v257, text: (char *)JobDebugRewardDebugString->trackedMemory);
          idStr::FreeData(this: (idStr *)&v317[0].acceptedMiniMapTravelEnt.size);
        }
        v276.type = SWF_VAR_UNDEF;
        v129 = idStr::idStr(this: (idStr *)&v317[0].jobLayerInfo.acceptLayersRemove.num, text: v257.data);
        idSWFScriptVar::Free(this: &v276);
        v276.type = SWF_VAR_STRING;
        v130 = (idStr *)idMem::AllocWithLocation(
                          this: v17,
                          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                          size: 0x24u,
                          tag: TAG_SWF,
                          zeroBuffer: false,
                          align: ALIGN_16,
                          heap: HEAP_DEFAULTHEAP);
        v131 = v130;
        v258 = (idDeclSource **)v130;
        if ( v130 != nullptr )
        {
          v130->allocedAndFlag = 20;
          v130->len = 0;
          v130->data = v130->baseBuffer;
          v130->baseBuffer[0] = 0;
          v132 = v130->allocedAndFlag;
          v133 = v129->len;
          v134 = v129->len + 1;
          if ( v132 >= 0 )
          {
            if ( v134 > (v132 & 0x7FFFFFFF) )
              idStr::ReAllocate(this: v130, amount: v134, keepold: true);
          }
          else if ( v134 > (v132 & 0x7FFFFFFF)
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          v135 = v129->data - 1;
          v136 = (int)(v131->data - 1);
          do
          {
            v137 = *++v135;
            *(_BYTE *)++v136 = *v135;
          }
          while ( v137 != 0 );
          v131->len = v133;
          v138.i = (int)v131;
          v131[1].len = 1;
        }
        else
        {
          v138.i = 0;
        }
        v276.value = v138;
        idStr::FreeData(this: (idStr *)&v317[0].jobLayerInfo.acceptLayersRemove.num);
        idSWFScriptObject::Set(this: v21, name: v292, value: &v276);
        idSWFScriptVar::Free(this: &v276);
        JobByDecl = idJobManager::FindJobByDecl(this: (idJobManager *)(thisObject->name.str + 12412), jobDecl: v19);
        v140 = (idMapModel *)JobByDecl;
        if ( JobByDecl != nullptr )
        {
          SLODWORD(v141.f) = JobByDecl->status;
          v278.type = SWF_VAR_UNDEF;
          idSWFScriptVar::Free(this: &v278);
          v278.value = v141;
          v278.type = SWF_VAR_INTEGER;
          idSWFScriptObject::Set(this: v21, name: v279, value: &v278);
          v142 = &v278;
        }
        else
        {
          HIDWORD(v280) = 4;
          idSWFScriptVar::Free(this: (idSWFScriptVar *)&v280);
          v280 = 0x600000000LL;
          idSWFScriptObject::Set(this: v21, name: v279, value: (idSWFScriptVar *)&v280);
          v142 = (idSWFScriptVar *)&v280;
        }
        idSWFScriptVar::Free(this: v142);
        LODWORD(v145) = (unsigned int)v257.allocedAndFlag >> 31;
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0 )
            idStr::ReAllocate(this: &v257, amount: 1, keepold: true);
        }
        else if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        *v257.data = 0;
        v257.len = 0;
        if ( v140 != nullptr )
        {
          HIDWORD(v144) = v140->primitives.num;
          v151 = va::va(
                   this: (va *)&v317[0].jobNoteInfo.completeJobNotesRemove.num,
                   fmt: v296,
                   a3: v144,
                   a4: v143,
                   a5: v145,
                   a6: v220,
                   a7: v227,
                   a8: v234,
                   a9: v241,
                   a10: v248,
                   a11: v255);
          v152 = v151;
          for ( kk = 0; v151->buffer[kk] != 0; ++kk )
            ;
          v154 = kk + 1;
          v155 = v257.allocedAndFlag & 0x7FFFFFFF;
          if ( v257.allocedAndFlag >= 0 )
          {
            if ( v154 > v155 )
              idStr::ReAllocate(this: &v257, amount: v154, keepold: false);
          }
          else if ( v154 > v155
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          memcpy(Dst: v257.data, Src: v152, Size: kk);
          v156 = 0;
          v257.data[kk] = 0;
          v257.len = kk;
          if ( v140->primitives.num > 0 )
          {
            v157 = v298;
            do
            {
              idStr::Append(this: &v257, text: "\n");
              HIDWORD(v158) = idJob::GetJobNote(this: v140, i: v156)->groupList.num;
              v161 = va::va(
                       this: (va *)&v317[0].jobNoteInfo.completeJobNotesRemove.num,
                       fmt: v157,
                       a3: v158,
                       a4: v160,
                       a5: v159,
                       a6: v221,
                       a7: v228,
                       a8: v235,
                       a9: v242,
                       a10: v249,
                       a11: v256);
              idStr::Append(this: &v257, text: v161);
              JobNote = idJob::GetJobNote(this: v140, i: v156);
              list = JobNote->groupList.list;
              if ( list != nullptr )
              {
                v165 = list[3].len;
                v164 = &v302;
                v258 = (idDeclSource **)JobNote->groupList.list;
                v302 = v165;
              }
              else
              {
                v164 = &v300;
                v300 = -1;
              }
              v304.index = *v164;
              LocalizedString = (char *)idStrId::GetLocalizedString(this: &v304);
              idStr::Append(this: &v257, text: LocalizedString);
              ++v156;
            }
            while ( v156 < v140->primitives.num );
          }
        }
        else
        {
          v146 = va::va(
                   this: (va *)&v317[0].jobNoteInfo.completeJobNotesRemove.num,
                   fmt: v294,
                   a3: v144,
                   a4: v143,
                   a5: v145,
                   a6: v220,
                   a7: v227,
                   a8: v234,
                   a9: v241,
                   a10: v248,
                   a11: v255);
          v147 = v146;
          for ( mm = 0; v146->buffer[mm] != 0; ++mm )
            ;
          v149 = mm + 1;
          v150 = v257.allocedAndFlag & 0x7FFFFFFF;
          if ( v257.allocedAndFlag >= 0 )
          {
            if ( v149 > v150 )
              idStr::ReAllocate(this: &v257, amount: v149, keepold: false);
          }
          else if ( v149 > v150
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          memcpy(Dst: v257.data, Src: v147, Size: mm);
          v257.data[mm] = 0;
          v257.len = mm;
        }
        v282.type = SWF_VAR_UNDEF;
        v167 = idStr::idStr(this: (idStr *)&v317[0].jobLayerInfo.completeLayers.num, text: v257.data);
        idSWFScriptVar::Free(this: &v282);
        v282.type = SWF_VAR_STRING;
        v168 = (idStr *)idMem::AllocWithLocation(
                          this: v17,
                          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                          size: 0x24u,
                          tag: TAG_SWF,
                          zeroBuffer: false,
                          align: ALIGN_16,
                          heap: HEAP_DEFAULTHEAP);
        v169 = v168;
        v258 = (idDeclSource **)v168;
        if ( v168 != nullptr )
        {
          v168->allocedAndFlag = 20;
          v168->len = 0;
          v168->data = v168->baseBuffer;
          v168->baseBuffer[0] = 0;
          v170 = v168->allocedAndFlag;
          v171 = v167->len;
          v172 = v167->len + 1;
          if ( v170 >= 0 )
          {
            if ( v172 > (v170 & 0x7FFFFFFF) )
              idStr::ReAllocate(this: v168, amount: v172, keepold: true);
          }
          else if ( v172 > (v170 & 0x7FFFFFFF)
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          v173 = v167->data - 1;
          v174 = (int)(v169->data - 1);
          do
          {
            v175 = *++v173;
            *(_BYTE *)++v174 = *v173;
          }
          while ( v175 != 0 );
          v169->len = v171;
          v176.i = (int)v169;
          v169[1].len = 1;
        }
        else
        {
          v176.i = 0;
        }
        v282.value = v176;
        idStr::FreeData(this: (idStr *)&v317[0].jobLayerInfo.completeLayers.num);
        idSWFScriptObject::Set(this: v21, name: v306, value: &v282);
        idSWFScriptVar::Free(this: &v282);
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0 )
            idStr::ReAllocate(this: &v257, amount: 1, keepold: true);
        }
        else if ( (v257.allocedAndFlag & 0x7FFFFFFF) == 0
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        LODWORD(v177) = v316.baseBuffer;
        *v257.data = 0;
        v257.len = 0;
        v316.allocedAndFlag = 20;
        v316.data = v316.baseBuffer;
        v316.len = 0;
        v316.baseBuffer[0] = 0;
        v180 = 0;
        v181 = 0;
        if ( idDeclJobNote::resourceList.declSources.num > 0 )
        {
          v182 = 0;
          do
          {
            v258 = &idDeclJobNote::resourceList.declSources.list[v182];
            str = idDeclJobNote::resourceList.declSources.list[v182]->name.str;
            if ( str != nullptr )
              v184 = idDeclInfo::FindWithInheritance(this: &idDeclJobNote::resourceList, name: str, makeDefault: false);
            else
              v184 = nullptr;
            if ( idStr::Cmp(s1: (const char *)v184[1].nextOnHashChain, s2: v19->name.str) == 0 )
            {
              ++v180;
              idStr::Append(this: &v316, text: "\n");
              v308.index = v184[1].textLength;
              v185 = (char *)idStrId::GetLocalizedString(this: &v308);
              idStr::Append(this: &v316, text: v185);
            }
            ++v181;
            ++v182;
          }
          while ( v181 < idDeclJobNote::resourceList.declSources.num );
        }
        HIDWORD(v179) = v180;
        v186 = va::va(
                 this: (va *)&v317[0].jobNoteInfo.completeJobNotesRemove.num,
                 fmt: v310,
                 a3: v179,
                 a4: v178,
                 a5: v177,
                 a6: v221,
                 a7: v228,
                 a8: v235,
                 a9: v242,
                 a10: v249,
                 a11: v256);
        v187 = v186;
        for ( nn = 0; v186->buffer[nn] != 0; ++nn )
          ;
        v189 = nn + 1;
        v190 = v257.allocedAndFlag & 0x7FFFFFFF;
        if ( v257.allocedAndFlag >= 0 )
        {
          if ( v189 > v190 )
            idStr::ReAllocate(this: &v257, amount: v189, keepold: false);
        }
        else if ( v189 > v190
               && AssertFailed(
                    file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                    line: 463,
                    expression: "amount <= GetAlloced()",
                    inlineBreak: true) )
        {
          __trap();
        }
        memcpy(Dst: v257.data, Src: v187, Size: nn);
        v257.data[nn] = 0;
        v257.len = nn;
        idStr::Append(this: &v257, text: &v316);
        v284.type = SWF_VAR_UNDEF;
        v191 = idStr::idStr(this: (idStr *)&v317[0].jobNoteInfo.acceptJobNotesRemove.num, text: v257.data);
        idSWFScriptVar::Free(this: &v284);
        v284.type = SWF_VAR_STRING;
        v192 = (idStr *)idMem::AllocWithLocation(
                          this: v17,
                          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                          size: 0x24u,
                          tag: TAG_SWF,
                          zeroBuffer: false,
                          align: ALIGN_16,
                          heap: HEAP_DEFAULTHEAP);
        v193 = v192;
        v258 = (idDeclSource **)v192;
        if ( v192 != nullptr )
        {
          v192->allocedAndFlag = 20;
          v192->len = 0;
          v192->data = v192->baseBuffer;
          v192->baseBuffer[0] = 0;
          v194 = v192->allocedAndFlag;
          v195 = v191->len;
          v196 = v191->len + 1;
          if ( v194 >= 0 )
          {
            if ( v196 > (v194 & 0x7FFFFFFF) )
              idStr::ReAllocate(this: v192, amount: v196, keepold: true);
          }
          else if ( v196 > (v194 & 0x7FFFFFFF)
                 && AssertFailed(
                      file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                      line: 463,
                      expression: "amount <= GetAlloced()",
                      inlineBreak: true) )
          {
            __trap();
          }
          v197 = v191->data - 1;
          v198 = (int)(v193->data - 1);
          do
          {
            v199 = *++v197;
            *(_BYTE *)++v198 = *v197;
          }
          while ( v199 != 0 );
          v193->len = v195;
          v193[1].len = 1;
        }
        else
        {
          v193 = nullptr;
        }
        v284.value.i = (int)v193;
        idStr::FreeData(this: (idStr *)&v317[0].jobNoteInfo.acceptJobNotesRemove.num);
        idSWFScriptObject::Set(this: v21, name: v312, value: &v284);
        idSWFScriptVar::Free(this: &v284);
        v200 = (void *(__fastcall ***)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))idMem::AllocWithLocation(
                                                                                                   this: v17,
                                                                                                   location: "w:\\tech5\\shared\\id"
                                                                                                   "lib\\Heap.h(64) : tag",
                                                                                                   size: 0x10u,
                                                                                                   tag: TAG_SWF,
                                                                                                   zeroBuffer: false,
                                                                                                   align: ALIGN_16,
                                                                                                   heap: HEAP_DEFAULTHEAP);
        if ( v200 != nullptr )
        {
          v201 = (int)thisObject->name.str;
          v202.i = (int)v200;
          v203 = v287;
          v200[3] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))v19;
          v200[1] = nullptr;
          v200[2] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))v201;
          *v200 = v203;
        }
        else
        {
          v202.i = 0;
        }
        v264.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v264);
        if ( v202.i != 0 )
        {
          v264.value = v202;
          v264.type = SWF_VAR_FUNCTION;
          (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v202.i + 8))(a1: v202.i);
        }
        else
        {
          v264.type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: v21, name: v314, value: &v264);
        idSWFScriptVar::Free(this: &v264);
        v204 = (void *(__fastcall ***)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))idMem::AllocWithLocation(
                                                                                                   this: v17,
                                                                                                   location: "w:\\tech5\\shared\\id"
                                                                                                   "lib\\Heap.h(64) : tag",
                                                                                                   size: 0x10u,
                                                                                                   tag: TAG_SWF,
                                                                                                   zeroBuffer: false,
                                                                                                   align: ALIGN_16,
                                                                                                   heap: HEAP_DEFAULTHEAP);
        if ( v204 != nullptr )
        {
          v205 = (int)thisObject->name.str;
          v206.i = (int)v204;
          v207 = v289;
          v204[3] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))v19;
          v204[1] = nullptr;
          v204[2] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))v205;
          *v204 = v207;
        }
        else
        {
          v206.i = 0;
        }
        v267[0].type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: v267);
        if ( v206.i != 0 )
        {
          v267[0].value = v206;
          v267[0].type = SWF_VAR_FUNCTION;
          (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v206.i + 8))(a1: v206.i);
        }
        else
        {
          v267[0].type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: v21, name: v303, value: v267);
        idSWFScriptVar::Free(this: v267);
        v208 = (void *(__fastcall ***)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))idMem::AllocWithLocation(
                                                                                                   this: v17,
                                                                                                   location: "w:\\tech5\\shared\\id"
                                                                                                   "lib\\Heap.h(64) : tag",
                                                                                                   size: 0x10u,
                                                                                                   tag: TAG_SWF,
                                                                                                   zeroBuffer: false,
                                                                                                   align: ALIGN_16,
                                                                                                   heap: HEAP_DEFAULTHEAP);
        if ( v208 != nullptr )
        {
          v209 = (int)thisObject->name.str;
          v210.i = (int)v208;
          v211 = v291;
          v208[3] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))v19;
          v208[1] = nullptr;
          v208[2] = (void *(__fastcall **)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int))v209;
          *v208 = v211;
        }
        else
        {
          v210.i = 0;
        }
        v265.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v265);
        if ( v210.i != 0 )
        {
          v265.value = v210;
          v265.type = SWF_VAR_FUNCTION;
          (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v210.i + 8))(a1: v210.i);
        }
        else
        {
          v265.type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: v21, name: v271, value: &v265);
        idSWFScriptVar::Free(this: &v265);
        v266.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v266);
        if ( v21 != nullptr )
        {
          v266.value.i = (int)v21;
          v266.type = SWF_VAR_OBJECT;
          ++v21->refCount;
        }
        else
        {
          v266.type = SWF_VAR_NULL;
        }
        v212 = v286;
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->nextOnHashChain, index: v286, value: &v266);
        v286 = v212 + 1;
        idSWFScriptVar::Free(this: &v266);
        if ( v21->refCount-- == 1 )
        {
          idSWFScriptObject::~idSWFScriptObject(this: v21);
          idMem::Free(this: v17, ptr: v21, align: ALIGN_16);
        }
        idStr::FreeData(this: &v316);
        idStr::FreeData(this: &v257);
        idStr::FreeData(this: (idStr *)&v317[0].resourceListPtr);
        v18 = v259;
      }
      else
      {
        idStr::FreeData(this: (idStr *)&v317[0].resourceListPtr);
      }
      v259 = ++v18;
    }
    while ( v18 < v293 );
    v4 = result;
  }
  v4->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: v4);
  v4->value.b = true;
  v4->type = SWF_VAR_BOOL;
  v305 = 1;
  if ( (v268.listStatic == 0 || v268.listStatic == 2) && v268.list != nullptr )
    idMem::Free(this: v17, ptr: v268.list, align: ALIGN_16);
  return v4;
}


// ========================================================================
// __unwind$529101
// EA  : 0x82E69070
// RVA : 0x00E69070
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529101()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 192));
}


// ========================================================================
// __unwind$529102
// EA  : 0x82E69098
// RVA : 0x00E69098
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529102()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 5200 + 176));
}


// ========================================================================
// __unwind$529103
// EA  : 0x82E690C0
// RVA : 0x00E690C0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529103()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 496));
}


// ========================================================================
// __unwind$529241
// EA  : 0x82E690E8
// RVA : 0x00E690E8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529241()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 5200 + 112), tag: TAG_SWF);
}


// ========================================================================
// __unwind$529104
// EA  : 0x82E69114
// RVA : 0x00E69114
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529104()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 224));
}


// ========================================================================
// __unwind$529105
// EA  : 0x82E6913C
// RVA : 0x00E6913C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529105()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 304));
}


// ========================================================================
// __unwind$529106
// EA  : 0x82E69164
// RVA : 0x00E69164
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529106()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 240));
}


// ========================================================================
// __unwind$529107
// EA  : 0x82E6918C
// RVA : 0x00E6918C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529107()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 288));
}


// ========================================================================
// __unwind$529376
// EA  : 0x82E691B4
// RVA : 0x00E691B4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529376()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 5200 + 112), tag: TAG_SWF);
}


// ========================================================================
// __unwind$529108
// EA  : 0x82E691E0
// RVA : 0x00E691E0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529108()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 256));
}


// ========================================================================
// __unwind$529109
// EA  : 0x82E69208
// RVA : 0x00E69208
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529109()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 80));
}


// ========================================================================
// __unwind$529110
// EA  : 0x82E69230
// RVA : 0x00E69230
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529110()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 912));
}


// ========================================================================
// __unwind$529522
// EA  : 0x82E69258
// RVA : 0x00E69258
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529522()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 592));
}


// ========================================================================
// __unwind$529529
// EA  : 0x82E69280
// RVA : 0x00E69280
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529529()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 5200 + 112), tag: TAG_SWF);
}


// ========================================================================
// __unwind$529111
// EA  : 0x82E692AC
// RVA : 0x00E692AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529111()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 320));
}


// ========================================================================
// __unwind$529112
// EA  : 0x82E692D4
// RVA : 0x00E692D4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529112()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 784));
}


// ========================================================================
// __unwind$529113
// EA  : 0x82E692FC
// RVA : 0x00E692FC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529113()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 656));
}


// ========================================================================
// __unwind$529867
// EA  : 0x82E69324
// RVA : 0x00E69324
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529867()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 528));
}


// ========================================================================
// __unwind$529874
// EA  : 0x82E6934C
// RVA : 0x00E6934C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529874()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 5200 + 112), tag: TAG_SWF);
}


// ========================================================================
// __unwind$529114
// EA  : 0x82E69378
// RVA : 0x00E69378
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529114()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 200));
}


// ========================================================================
// __unwind$529115
// EA  : 0x82E693A0
// RVA : 0x00E693A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529115()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 720));
}


// ========================================================================
// __unwind$530204
// EA  : 0x82E693C8
// RVA : 0x00E693C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_530204()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 848));
}


// ========================================================================
// __unwind$530211
// EA  : 0x82E693F0
// RVA : 0x00E693F0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_530211()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 5200 + 112), tag: TAG_SWF);
}


// ========================================================================
// __unwind$529116
// EA  : 0x82E6941C
// RVA : 0x00E6941C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529116()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 216));
}


// ========================================================================
// __unwind$529117
// EA  : 0x82E69444
// RVA : 0x00E69444
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529117()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 560));
}


// ========================================================================
// __unwind$530541
// EA  : 0x82E6946C
// RVA : 0x00E6946C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_530541()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 624));
}


// ========================================================================
// __unwind$530548
// EA  : 0x82E69494
// RVA : 0x00E69494
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_530548()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 5200 + 112), tag: TAG_SWF);
}


// ========================================================================
// __unwind$529118
// EA  : 0x82E694C0
// RVA : 0x00E694C0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529118()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 232));
}


// ========================================================================
// __unwind$529119
// EA  : 0x82E694E8
// RVA : 0x00E694E8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529119()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 688));
}


// ========================================================================
// __unwind$530878
// EA  : 0x82E69510
// RVA : 0x00E69510
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_530878()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 752));
}


// ========================================================================
// __unwind$530885
// EA  : 0x82E69538
// RVA : 0x00E69538
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_530885()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 5200 + 112), tag: TAG_SWF);
}


// ========================================================================
// __unwind$529120
// EA  : 0x82E69564
// RVA : 0x00E69564
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529120()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 248));
}


// ========================================================================
// __unwind$529121
// EA  : 0x82E6958C
// RVA : 0x00E6958C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529121()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 264));
}


// ========================================================================
// __unwind$529122
// EA  : 0x82E695B4
// RVA : 0x00E695B4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529122()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 280));
}


// ========================================================================
// __unwind$531360
// EA  : 0x82E695DC
// RVA : 0x00E695DC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_531360()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 816));
}


// ========================================================================
// __unwind$531367_0
// EA  : 0x82E69604
// RVA : 0x00E69604
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_531367_0()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 5200 + 112), tag: TAG_SWF);
}


// ========================================================================
// __unwind$529123
// EA  : 0x82E69630
// RVA : 0x00E69630
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529123()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 296));
}


// ========================================================================
// __unwind$529124
// EA  : 0x82E69658
// RVA : 0x00E69658
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529124()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 448));
}


// ========================================================================
// __unwind$531785_0
// EA  : 0x82E69680
// RVA : 0x00E69680
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_531785_0()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 5200 + 880));
}


// ========================================================================
// __unwind$531792_0
// EA  : 0x82E696A8
// RVA : 0x00E696A8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_531792_0()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 5200 + 112), tag: TAG_SWF);
}


// ========================================================================
// __unwind$529125
// EA  : 0x82E696D4
// RVA : 0x00E696D4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529125()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 312));
}


// ========================================================================
// __unwind$529127
// EA  : 0x82E696FC
// RVA : 0x00E696FC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529127()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 136));
}


// ========================================================================
// __unwind$529129
// EA  : 0x82E69724
// RVA : 0x00E69724
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529129()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 160));
}


// ========================================================================
// __unwind$529131
// EA  : 0x82E6974C
// RVA : 0x00E6974C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529131()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 144));
}


// ========================================================================
// __unwind$529132
// EA  : 0x82E69774
// RVA : 0x00E69774
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529132()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 5200 + 152));
}


// ========================================================================
// __unwind$529133
// EA  : 0x82E6979C
// RVA : 0x00E6979C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_529133()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 5200;
  if ( (*(_DWORD *)(v0 - 5200 + 404) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 404) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 5220));
  }
}


// ========================================================================
// ?LootItems@idPlayer@@QAA_NPAVidEntity@@PBVidDisassembleLoot@@@Z
// EA  : 0x82E697E8
// RVA : 0x00E697E8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

BOOL __fastcall idPlayer::LootItems(idPlayer *this, idActor *ent, const idDisassembleLoot *disassemble)
{
  idActor *v6; // r3
  idActor *v7; // r20
  bfx::Planner3D *v8; // r23
  idSmartLootComponent *v9; // r3
  idSmartLootComponent *v10; // r30
  bfx::Space *TypeDef; // r3
  idInventoryItem *InventoryItem; // r3
  char v13; // r11
  int num; // ctr
  bool *p_canPickup; // r9
  BOOL v16; // r24
  idVehicleState **list; // r4
  int v18; // r27
  int v19; // r28
  idActor_vtbl *v20; // r30
  idWeapon *EquippedWeapon; // r3
  idActor_vtbl *v22; // r30
  idWeapon *v23; // r3
  idPresentable *presentable; // r30
  idInventoryCollection *v25; // r3
  char *i; // r28
  idInventoryItem *v27; // r3
  idPresentable *v28; // r30
  idPresentable *v29; // r4
  idInventoryItem *v30; // r3
  int v31; // r3
  int v32; // r3
  int *v33; // r10
  _DWORD *v34; // r11
  int j; // ctr
  idAnimator_AF *v36; // r3
  int v37; // r30
  int v38; // r3
  idClipModel *clipModel; // r11
  float y; // r5
  float z; // r4
  idPhysics *Physics; // r3
  float *v43; // r3
  double v44; // fp9
  double v45; // fp7
  idPresentable *v46; // r3
  idPresentableAI *v47; // r3
  float v48; // r11
  float maxVisibleRange; // r5
  idPlayer *PlayerSounds; // r3
  idVec3 v52; // [sp+50h] [-1F0h] BYREF
  idList<idVehicleState *,5> v53; // [sp+60h] [-1E0h] BYREF
  int v54; // [sp+70h] [-1D0h] BYREF
  float x; // [sp+80h] [-1C0h] BYREF
  float v56; // [sp+84h] [-1BCh]
  float v57; // [sp+88h] [-1B8h]
  idPickupHudInfo v58; // [sp+90h] [-1B0h] BYREF
  float v59[5]; // [sp+C8h] [-178h] BYREF
  int v60; // [sp+DCh] [-164h] BYREF
  idBounds v61; // [sp+E0h] [-160h] BYREF
  _BYTE v62[320]; // [sp+100h] [-140h] BYREF

  if ( ent == nullptr
    || ent->GetInventory_2(this: ent) == nullptr
    || (v6 = idActor::CastTo(c: ent), v7 = v6, v6 != nullptr)
    && v6->looted
    && (unsigned __int8)idActor::HasLootableItems(this: v6) == 0 )
  {
    PlayerSounds = idPlayer::GetPlayerSounds(
                     this: (idPlayer *)v62,
                     result: (const idDeclPlayerProps::playerSounds_t *)this);
    idEntity::StartSoundShader(
      this,
      channel: SND_CHANNEL_ANY,
      shader: (const idSoundShader *)LODWORD(PlayerSounds->spawnOrientation.mat[1].z),
      soundShaderFlags: (soundShaderFlags_t)0,
      peerMask: 0xFFu);
    return false;
  }
  v8 = (bfx::Planner3D *)ent->GetInventory_2(this: ent);
  v9 = ent->GetSmartLootComponent_2(this: ent);
  v58.items.num = 0;
  v58.items.granularity = 1;
  v58.items.size = 3;
  v58.items.memTag = 5;
  v10 = v9;
  v58.items.list = v58.items.staticList;
  v58.items.listStatic = 1;
  v58.items.staticList[0].icon = nullptr;
  v58.items.staticList[0].count = 0;
  v58.items.staticList[0].canPickup = true;
  v58.items.staticList[1].icon = nullptr;
  v58.items.staticList[1].count = 0;
  v58.items.staticList[1].canPickup = true;
  v58.items.staticList[2].icon = nullptr;
  v58.items.staticList[2].count = 0;
  v58.items.staticList[2].canPickup = true;
  if ( v9 != nullptr )
  {
    idSmartLootComponent::GetPickupHudInfo(this: v9, user: this, info: &v58, weaponStuffOnly: false);
  }
  else if ( idScriptObject::GetTypeDef(this: v8) != nullptr )
  {
    TypeDef = idScriptObject::GetTypeDef(this: v8);
    InventoryItem = idInventoryCollection::GetInventoryItem(
                      this: (idInventoryCollection *)v8,
                      index: (int)&TypeDef[-1].m_components.m_tag + 3);
    InventoryItem->GetPickupHudInfo(this: InventoryItem, a2: this, a3: &v58);
  }
  v13 = 0;
  if ( v58.items.num > 0 )
  {
    num = v58.items.num;
    p_canPickup = &v58.items.list->canPickup;
    do
    {
      if ( v13 != 0 || (v13 = 0, *p_canPickup) )
        v13 = 1;
      p_canPickup += 12;
      --num;
    }
    while ( num != 0 );
  }
  if ( v13 == 0 )
  {
    idList<idThread *,58>::Clear(this: (idList<idVehicleState *,5> *)&v58);
    return false;
  }
  if ( v7 != nullptr )
    idActor::SetLooted(this: v7, b: true);
  v16 = false;
  if ( v10 != nullptr )
  {
    v53.size = 3;
    v53.num = 0;
    v53.granularity = 1;
    v53.list = (idVehicleState **)&v54;
    v53.memTag = 5;
    v53.listStatic = 1;
    idSmartLootComponent::GetLootItems(this: v10, output: &v53, weaponStuffOnly: false);
    list = v53.list;
    v18 = 0;
    if ( v53.num > 0 )
    {
      v19 = 0;
      do
      {
        LODWORD(v52.x) = list[v19];
        if ( LODWORD(v52.x) != 0 )
        {
          if ( (unsigned __int8)idWeapon::IsTypeOf(c: (idClass *)LODWORD(v52.x)) != 0 && v7 != nullptr )
          {
            v20 = v7->__vftable;
            EquippedWeapon = idActor::GetEquippedWeapon(this: v7, slot: EQUIP_LEFT_HAND);
            v20->UnequipItem(this: v7, a2: EquippedWeapon);
            v22 = v7->__vftable;
            v23 = idActor::GetEquippedWeapon(this: v7, slot: EQUIP_RIGHT_HAND);
            v22->UnequipItem(this: v7, a2: v23);
          }
          presentable = this->presentable;
          if ( presentable == nullptr )
          {
            idEntity::InitPresentableInternal(this);
            presentable = this->presentable;
          }
          v25 = this->GetInventory_2(this);
          idInventoryCollection::TransferItem(
            this: v25,
            owner: nullptr,
            to: presentable,
            item: (idInventoryItem **)&v52,
            deleteOwnerItem: true,
            canIntro: false);
          idRageMetrics::ItemsTaken(this: clientGame->rageMetrics, player: (idVehicle *)this, items: 1);
          list = v53.list;
          v16 = true;
        }
        ++v18;
        ++v19;
      }
      while ( v18 < v53.num );
    }
    if ( v53.listStatic == 0 || v53.listStatic == 2 )
    {
      if ( list != nullptr )
        idMem::Free(this: &mem, ptr: list, align: ALIGN_16);
      v53.list = nullptr;
      v53.size = 0;
    }
    v53.num = 0;
  }
  else
  {
    for ( i = (char *)&idScriptObject::GetTypeDef(this: v8)[-1].m_components.m_tag + 3; (int)i >= 0; --i )
    {
      v27 = idInventoryCollection::GetInventoryItem(this: (idInventoryCollection *)v8, index: (int)i);
      LODWORD(v52.x) = v27;
      if ( v27 != nullptr && v27->lootable )
      {
        if ( this->presentable == nullptr )
          idEntity::InitPresentableInternal(this);
        v28 = this->presentable;
        v29 = ent->presentable;
        if ( v29 == nullptr )
        {
          idEntity::InitPresentableInternal(this: ent);
          v29 = ent->presentable;
        }
        v30 = idInventoryCollection::TransferItem(
                this: (idInventoryCollection *)v8,
                owner: v29,
                to: v28,
                item: (idInventoryItem **)&v52,
                deleteOwnerItem: true,
                canIntro: false);
        if ( v30 != nullptr )
          v30->forSale = true;
        idRageMetrics::ItemsTaken(this: clientGame->rageMetrics, player: (idVehicle *)this, items: 1);
        v16 = true;
      }
    }
  }
  if ( v7 != nullptr )
  {
    v31 = ((int (__fastcall *)(idActor *, idVehicleState **))v7->GetAF_2)(a1: v7, a2: list);
    v32 = (*(int (__fastcall **)(int, int))(*(_DWORD *)(v31 + 288) + 44))(a1: v31 + 288, a2: -1);
    v33 = &v60;
    v34 = (_DWORD *)(v32 - 4);
    for ( j = 6; j != 0; --j )
      *++v33 = *++v34;
    this->lootQuery.index = *(_QWORD *)&idClip::GatherTouchingBounds(
                                          this: (idClip *)&v52,
                                          result: (idGatherQuery *)&clientGame->clip,
                                          bounds: &v61,
                                          clipMask: 2048,
                                          passEntityNumber: this->entityNumber,
                                          userName: "w:\\tech5\\tungsten\\game\\player\\Player_Guis.cpp(2489) : Touching Bounds")->world;
  }
  if ( tungsten_lootPoke.valueInteger != 0
    && v7 != nullptr
    && ((unsigned __int8 (__fastcall *)(idActor *, idVehicleState **))v7->IsDead)(a1: v7, a2: list) != 0 )
  {
    if ( common->IsMultiplayer(this: common) )
    {
      v46 = v7->presentable;
      if ( v46 == nullptr )
      {
        idEntity::InitPresentableInternal(this: v7);
        v46 = v7->presentable;
      }
      v47 = v46->GetAIInterface(this: v46);
      if ( v47 != nullptr )
        idPresentableAI::LootBody(this: v47, playerIndex: this->entityNumber, hasLoot: v16);
    }
    else
    {
      v36 = v7->GetAF_2(this: v7);
      v37 = idAnimator_AF::BodyForJoint(this: v36, joint: (idIndex<short,enum invalidJointIndex_t> *)0xFFFFFFFF);
      v38 = (int)v7->GetAF_2(this: v7);
      clipModel = idPhysics_AF::GetBody(this: (idPhysics_AF *)(v38 + 288), id: v37)->clipModel;
      y = clipModel->origin.y;
      z = clipModel->origin.z;
      x = clipModel->origin.x;
      v56 = y;
      v57 = z;
      Physics = idEntity::GetPhysics(this);
      v43 = (float *)Physics->GetOrigin(this: Physics, a2: 0);
      v44 = (float)(v43[2] - v57);
      v45 = (float)(v43[1] - v56);
      v52.x = *v43 - x;
      v52.z = v44;
      v52.y = v45;
      idVec3::NormalizeFast(this: &v52);
      v59[2] = v52.z * g_ragdollLootingImpulse.valueFloat;
      v59[1] = v52.y * g_ragdollLootingImpulse.valueFloat;
      v59[0] = v52.x * g_ragdollLootingImpulse.valueFloat;
      v7->ApplyImpulse(this: v7, a2: 0, a3: v37, a4: (const idVec3 *)&x, a5: (const idVec3 *)v59);
    }
  }
  if ( disassemble != nullptr )
  {
    LODWORD(v52.x) = disassemble->soundShader;
    v48 = v52.x;
    if ( LODWORD(v52.x) == 0 )
      v48 = *(float *)&idPlayer::GetPlayerSounds(
                         this: (idPlayer *)v62,
                         result: (const idDeclPlayerProps::playerSounds_t *)this)->flags;
    maxVisibleRange = v48;
  }
  else
  {
    this->lootSoundPlayed = v16;
    if ( ((unsigned __int8 (__fastcall *)(idCommon *, idVehicleState **))common->IsMultiplayer)(a1: common, a2: list) != 0 )
      goto LABEL_70;
    if ( v16 )
      maxVisibleRange = idPlayer::GetPlayerSounds(
                          this: (idPlayer *)v62,
                          result: (const idDeclPlayerProps::playerSounds_t *)this)->renderModelInfo.maxVisibleRange;
    else
      maxVisibleRange = idPlayer::GetPlayerSounds(
                          this: (idPlayer *)v62,
                          result: (const idDeclPlayerProps::playerSounds_t *)this)->spawnOrientation.mat[1].z;
  }
  idEntity::StartSoundShader(
    this,
    channel: SND_CHANNEL_ANY,
    shader: (const idSoundShader *)LODWORD(maxVisibleRange),
    soundShaderFlags: (soundShaderFlags_t)0,
    peerMask: 0xFFu);
LABEL_70:
  if ( (v58.items.listStatic == 0 || v58.items.listStatic == 2) && v58.items.list != nullptr )
    idMem::Free(this: &mem, ptr: v58.items.list, align: ALIGN_16);
  return v16;
}


// ========================================================================
// __unwind$532548
// EA  : 0x82E69F00
// RVA : 0x00E69F00
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_532548()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 576 + 144));
}


// ========================================================================
// __unwind$532549
// EA  : 0x82E69F28
// RVA : 0x00E69F28
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_532549()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 576 + 96));
}


// ========================================================================
// ?CheckIsNewItem@idPlayer@@QAA_NPBVidDeclInventory@@@Z
// EA  : 0x82E69F50
// RVA : 0x00E69F50
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

int __fastcall idPlayer::CheckIsNewItem(idPlayer *this, const idDeclInventory *decl)
{
  idDeclInventory::inventoryUse_t itemUse; // r11
  int v5; // r30
  int num; // r8
  int v7; // r10
  int v8; // r11
  idPresentable *presentable; // r3
  int v10; // r11
  idPlayer::newInventoryItems_t v11; // [sp+50h] [-30h] BYREF

  if ( decl == nullptr )
    return 0;
  itemUse = decl->itemUse;
  if ( itemUse == INVENTORY_USE_VEHICLE || itemUse == INVENTORY_USE_QUICK || itemUse == INVENTORY_USE_USABLE )
  {
    v5 = 0;
  }
  else
  {
    if ( itemUse == INVENTORY_USE_AMMO && !decl->isVehicleAmmo
      || itemUse == INVENTORY_USE_WEAPON
      || decl->recipe == nullptr )
    {
      return 0;
    }
    v5 = 1;
  }
  num = this->newItemList.num;
  v7 = 0;
  if ( num > 0 )
  {
    v8 = 0;
    while ( this->newItemList.list[v8].decl != decl )
    {
      ++v7;
      ++v8;
      if ( v7 >= num )
        goto LABEL_16;
    }
    return 0;
  }
LABEL_16:
  presentable = this->presentable;
  v11.decl = decl;
  if ( presentable != nullptr )
    v10 = (int)presentable->GetPlayerInterface_2(this: presentable);
  else
    v10 = 0;
  v11.page = v5;
  v11.seen = *(_BYTE *)(v10 + 35105) != 0;
  idList<idPlayer::newInventoryItems_t,5>::Append(this: &this->newItemList, obj: &v11);
  return 1;
}


// ========================================================================
// `idPlayer::ShowInventory'::`14'::idSWFScriptFunction_CanUse::Call
// EA  : 0x82E6A070
// RVA : 0x00E6A070
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_14_::idSWFScriptFunction_CanUse::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  char v5; // r11
  int v6; // r10
  int v7; // r9
  char v8; // r30

  v5 = (*(int (__fastcall **)(int, int, const idSWFParmList *))(*(_DWORD *)thisObject->variables.size + 56))(
         a1: thisObject->variables.size,
         a2: thisObject->variables.num,
         a3: parms);
  v6 = *(_DWORD *)(thisObject->variables.size + 12);
  v7 = *(_DWORD *)(v6 + 428);
  if ( v7 == 2 )
    v5 = gameLocal->world->mapType != MAPTYPE_TOWN || v6 != 0 && *(_BYTE *)(v6 + 245) != 0;
  result->type = SWF_VAR_UNDEF;
  v8 = v7 == 10 ? 0 : v5;
  idSWFScriptVar::Free(this: result);
  result->value.b = v8;
  result->type = SWF_VAR_BOOL;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`15'::idSWFScriptFunction_CanUseInVehicle::Call
// EA  : 0x82E6A148
// RVA : 0x00E6A148
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_15_::idSWFScriptFunction_CanUseInVehicle::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  char v4; // r30

  v4 = (*(int (__fastcall **)(int, int, const idSWFParmList *))(*(_DWORD *)thisObject->variables.size + 64))(
         a1: thisObject->variables.size,
         a2: thisObject->variables.num,
         a3: parms);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value.b = v4;
  result->type = SWF_VAR_BOOL;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`16'::idSWFScriptFunction_Use::Call
// EA  : 0x82E6A1B8
// RVA : 0x00E6A1B8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_16_::idSWFScriptFunction_Use::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  bool v4; // r30

  v4 = idPresentablePlayer::UseItem(
         this: (idPresentablePlayer *)thisObject->variables.num,
         item: (idAmmoItem *)thisObject->variables.size);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value.b = v4;
  result->type = SWF_VAR_BOOL;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`18'::idSWFScriptFunction_CanEquip::Call
// EA  : 0x82E6A220
// RVA : 0x00E6A220
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_18_::idSWFScriptFunction_CanEquip::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  bool v4; // r30
  int v5; // r11

  v4 = false;
  v5 = *(_DWORD *)(thisObject->variables.num + 12);
  if ( *(_DWORD *)(v5 + 248) != 0 )
    v4 = *(_DWORD *)(v5 + 428) != 10;
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value.b = v4;
  result->type = SWF_VAR_BOOL;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`19'::idSWFScriptFunction_CanScrollJobs::Call
// EA  : 0x82E6A298
// RVA : 0x00E6A298
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_19_::idSWFScriptFunction_CanScrollJobs::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int valueInteger; // r29
  int v6; // r28

  if ( (signed int)Sys_Milliseconds() < thisObject->variables.num )
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
    return result;
  }
  else
  {
    valueInteger = swf_textScrollSpeed.valueInteger;
    v6 = swf_optionScrollSpeed.valueInteger;
    thisObject->variables.num = Sys_Milliseconds() + v6 + valueInteger;
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->type = SWF_VAR_BOOL;
    result->value.b = true;
    return result;
  }
}


// ========================================================================
// `idPlayer::ShowInventory'::`20'::idSWFScriptFunction_GetScreenFade::Call
// EA  : 0x82E6A340
// RVA : 0x00E6A340
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_20_::idSWFScriptFunction_GetScreenFade::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  __int128 v7; // r10
  idSWFScriptVar::swfScriptVarValue_t v8; // r30

  if ( *(int *)(a4 + 4) > 0 && (unsigned __int8)idSWFScriptVar::ToBool(this: *(idSWFScriptVar **)a4) != 0 )
  {
    thisObject->variables.num = Sys_Milliseconds();
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.i = 0;
    result->type = SWF_VAR_INTEGER;
    return result;
  }
  else
  {
    LODWORD(v7) = Sys_Milliseconds();
    DWORD2(v7) = thisObject->variables.num;
    v8.i = (int)(float)((float)((float)((float)(__int64)v7 - (float)*(__int64 *)((char *)&v7 + 4))
                              / swf_invFadeTime.valueFloat)
                      * (float)100.0);
    if ( v8.i >= 0 )
    {
      if ( v8.i > 100 )
        v8.i = 100;
    }
    else
    {
      v8.i = 0;
    }
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value = v8;
    result->type = SWF_VAR_INTEGER;
    return result;
  }
}


// ========================================================================
// `idPlayer::ShowInventory'::`21'::idSWFScriptFunction_GetShouldScreenFade::Call
// EA  : 0x82E6A448
// RVA : 0x00E6A448
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_21_::idSWFScriptFunction_GetShouldScreenFade::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  int valueInteger; // r28

  if ( *(int *)(a4 + 4) > 0 && (unsigned __int8)idSWFScriptVar::ToBool(this: *(idSWFScriptVar **)a4) != 0 )
  {
    thisObject->variables.num = Sys_Milliseconds();
LABEL_4:
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
    return result;
  }
  valueInteger = swf_invFadeWait.valueInteger;
  if ( (int)(Sys_Milliseconds() - thisObject->variables.num) < valueInteger )
    goto LABEL_4;
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value.b = true;
  result->type = SWF_VAR_BOOL;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`22'::idSWFScriptFunction_Category_Refresh::Call
// EA  : 0x82E6A508
// RVA : 0x00E6A508
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_22_::idSWFScriptFunction_Category_Refresh::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int v5; // r28
  idSWFScriptVar::swfScriptVarValue_t v6; // r29
  int num; // r11
  int v8; // r9
  int v9; // r7
  int v10; // r11
  char v11; // r11
  int v13; // [sp+50h] [-60h]
  idSWFScriptVar v14; // [sp+58h] [-58h] BYREF
  idSWFScriptVar v15[10]; // [sp+60h] [-50h] BYREF

  v14.type = SWF_VAR_UNDEF;
  v5 = 0;
  idSWFScriptVar::Free(this: &v14);
  v14.value.i = 0;
  v14.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "length", value: &v14);
  idSWFScriptVar::Free(this: &v14);
  v6.i = 0;
  do
  {
    num = thisObject->variables.num;
    v8 = 0;
    v13 = *(_DWORD *)(num + 12812);
    if ( v13 <= 0 )
    {
LABEL_7:
      v11 = 0;
    }
    else
    {
      v9 = *(_DWORD *)(num + 12808);
      v10 = 0;
      while ( *(_BYTE *)(v10 + v9 + 4) != 0 || *(_DWORD *)(v10 + v9 + 8) != v6.i )
      {
        ++v8;
        v10 += 12;
        if ( v8 >= v13 )
          goto LABEL_7;
      }
      v11 = 1;
    }
    if ( v11 != 0 )
    {
      v15[0].type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: v15);
      v15[0].value = v6;
      v15[0].type = SWF_VAR_INTEGER;
      idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, index: v5++, value: v15);
      idSWFScriptVar::Free(this: v15);
    }
    ++v6.i;
  }
  while ( v6.i < 5 );
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// $M533258_0
// EA  : 0x82E6A618
// RVA : 0x00E6A618
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _M533258_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 176 + 88));
}


// ========================================================================
// __unwind$533191
// EA  : 0x82E6A640
// RVA : 0x00E6A640
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533191()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 176 + 96));
}


// ========================================================================
// `idPlayer::ShowInventory'::`23'::idSWFScriptFunction_PlayerInventory_Refresh::AddItem
// EA  : 0x82E6A670
// RVA : 0x00E6A670
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

int __fastcall _idPlayer::ShowInventory_::_23_::idSWFScriptFunction_PlayerInventory_Refresh::AddItem(
        idInventoryItem *item,
        idStrId *itemInfo,
        idSWFScriptObject *container,
        const idDeclInventory *type,
        idSWFScriptVar::swfScriptVarValue_t *a5)
{
  idDeclInventory *index; // r30
  bool v10; // r28
  bool v11; // r11
  bool IsInventoryItemNew; // r28
  idSWFScriptFunction *v13; // r3
  idList<idEventReceiver *,5> *listeningToList; // r11
  idSWFScriptFunction *v15; // r4
  idStrId *DisplayName; // r3
  const char *str; // r28
  idStrId *v18; // r3
  const char *LocalizedString; // r3
  idSWFScriptVar *v20; // r3
  idSWFScriptVar *p_listeningToList; // r3
  idSWFScriptVar::swfScriptVarValue_t *SellPrice; // r3
  idSWFScriptVar::swfScriptVarValue_t *v23; // r3
  idSWFScriptVar *v24; // r3
  idSWFScriptFunction *v25; // r3
  idList<idEventReceiver *,5> *v26; // r11
  idSWFScriptFunction *v27; // r4
  idSWFScriptVar *v28; // r3
  idSWFScriptFunction *v29; // r3
  idList<idEventReceiver *,5> *v30; // r11
  idSWFScriptFunction *v31; // r4
  idInventoryItem_vtbl *v32; // r30
  int size; // r3
  int v34; // r3
  idSWFScriptFunction *v35; // r4
  idSWFScriptFunction *v36; // r3
  idSWFScriptFunction *v37; // r4
  idInventoryItem v39; // [sp+50h] [-130h] BYREF
  idSWFScriptVar v40; // [sp+78h] [-108h] BYREF
  idSWFScriptVar v41; // [sp+80h] [-100h] BYREF
  idSWFScriptVar v42; // [sp+88h] [-F8h] BYREF
  idSWFScriptVar v43; // [sp+90h] [-F0h] BYREF
  idSWFScriptVar v44; // [sp+98h] [-E8h] BYREF
  idSWFScriptVar v45; // [sp+A0h] [-E0h] BYREF
  idSWFScriptVar v46; // [sp+A8h] [-D8h] BYREF
  idSWFScriptVar v47; // [sp+B0h] [-D0h] BYREF
  idSWFScriptVar v48; // [sp+B8h] [-C8h] BYREF
  idSWFScriptVar v49; // [sp+C0h] [-C0h] BYREF
  idSWFScriptVar v50; // [sp+C8h] [-B8h] BYREF
  idSWFScriptVar v51; // [sp+D0h] [-B0h] BYREF
  idSWFScriptVar v52; // [sp+D8h] [-A8h] BYREF
  idSWFScriptVar v53; // [sp+E0h] [-A0h] BYREF
  idSWFScriptVar v54; // [sp+E8h] [-98h] BYREF
  idSWFScriptVar v55; // [sp+F0h] [-90h] BYREF
  idSWFScriptVar v56; // [sp+F8h] [-88h] BYREF
  idSWFScriptVar v57; // [sp+100h] [-80h] BYREF
  idSWFScriptVar v58; // [sp+108h] [-78h] BYREF
  idSWFScriptVar v59; // [sp+110h] [-70h] BYREF
  idSWFScriptVar v60[13]; // [sp+118h] [-68h] BYREF

  if ( itemInfo == nullptr )
    return 0;
  index = (idDeclInventory *)itemInfo[3].index;
  if ( index->containerDecl != type )
    return 0;
  v10 = _RTDynamicCast(
          inptr: index,
          VfDelta: 0,
          SrcType: &idDeclInventory `RTTI Type Descriptor',
          TargetType: (void *)&idDeclAmmo `RTTI Type Descriptor',
          isReference: 0) != nullptr;
  v11 = _RTDynamicCast(
          inptr: index,
          VfDelta: 0,
          SrcType: &idDeclInventory `RTTI Type Descriptor',
          TargetType: (void *)&idDeclWeapon `RTTI Type Descriptor',
          isReference: 0) != nullptr;
  if ( v10
    || v11
    || index->isVehicleAmmo
    || !index->playerCanSeeInInventory
    || index->isContainer
    || index->recipe != nullptr )
  {
    return 0;
  }
  IsInventoryItemNew = idPlayer::IsInventoryItemNew(this: (idPlayer *)item->listeningToList, decl: index);
  v13 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x10u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v13 != nullptr )
  {
    listeningToList = item->listeningToList;
    v13[3].__vftable = (idSWFScriptFunction_vtbl *)index;
    v15 = v13;
    v13[1].__vftable = nullptr;
    v13->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`17'::idSWFScriptFunction_ClearNewItem::`vftable';
    v13[2].__vftable = (idSWFScriptFunction_vtbl *)listeningToList;
  }
  else
  {
    v15 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v57, nf: v15);
  idSWFScriptObject::Set(this: container, name: "clearNewItem", value: &v57);
  idSWFScriptVar::Free(this: &v57);
  idSWFScriptVar::idSWFScriptVar(this: &v49, b: IsInventoryItemNew);
  idSWFScriptObject::Set(this: container, name: "isNewItem", value: &v49);
  idSWFScriptVar::Free(this: &v49);
  DisplayName = idInventoryItem::GetDisplayName(this: &v39, result: itemInfo);
  idSWFScriptVar::idSWFScriptVar(this: (idSWFScriptVar *)&v39.coolDownTime, s: DisplayName);
  idSWFScriptObject::Set(this: container, name: "name", value: (idSWFScriptVar *)&v39.coolDownTime);
  idSWFScriptVar::Free(this: (idSWFScriptVar *)&v39.coolDownTime);
  idSWFScriptVar::idSWFScriptVar(this: &v55, s: index->name.str);
  idSWFScriptObject::Set(this: container, name: "decl", value: &v55);
  idSWFScriptVar::Free(this: &v55);
  if ( g_debugInvGUI.valueInteger != 0 )
  {
    str = index->name.str;
    v18 = idInventoryItem::GetDisplayName(this: &v39, result: itemInfo);
    LocalizedString = idStrId::GetLocalizedString(this: v18);
    idLib::Warning(fmt: "%s: %s", str, LocalizedString);
  }
  v39.__vftable = *(idInventoryItem_vtbl **)(itemInfo[3].index + 200);
  idSWFScriptVar::idSWFScriptVar(this: &v41, s: (idStrId *)&v39);
  idSWFScriptObject::Set(this: container, name: "description", value: &v41);
  idSWFScriptVar::Free(this: &v41);
  v39.__vftable = *(idInventoryItem_vtbl **)(itemInfo[3].index + 212);
  if ( v39.__vftable != nullptr )
  {
    idSWFScriptVar::idSWFScriptVar(this: &v51, s: (const char *)v39.CallEvent);
    idSWFScriptObject::Set(this: container, name: "icon", value: &v51);
    v20 = &v51;
  }
  else
  {
    idSWFScriptVar::idSWFScriptVar(this: &v43, s: &byte_8200D768);
    idSWFScriptObject::Set(this: container, name: "icon", value: &v43);
    v20 = &v43;
  }
  idSWFScriptVar::Free(this: v20);
  idSWFScriptVar::idSWFScriptVar(this: &v59, i: (idSWFScriptVar::swfScriptVarValue_t *)itemInfo[6].index);
  idSWFScriptObject::Set(this: container, name: "quickslot", value: &v59);
  idSWFScriptVar::Free(this: &v59);
  switch ( (unsigned int)a5 )
  {
    case 1u:
      idSWFScriptVar::idSWFScriptVar(this: &v45, s: "#str_swf_job_item");
      idSWFScriptObject::Set(this: container, name: "itemUseDesc", value: &v45);
      p_listeningToList = &v45;
      break;
    case 2u:
    case 6u:
    case 7u:
      idSWFScriptVar::idSWFScriptVar(this: &v53, s: "#str_swf_quickuse_item");
      idSWFScriptObject::Set(this: container, name: "itemUseDesc", value: &v53);
      p_listeningToList = &v53;
      break;
    case 3u:
      idSWFScriptVar::idSWFScriptVar(this: &v47, s: "#str_swf_ingredient_item");
      idSWFScriptObject::Set(this: container, name: "itemUseDesc", value: &v47);
      p_listeningToList = &v47;
      break;
    case 4u:
      idSWFScriptVar::idSWFScriptVar(this: (idSWFScriptVar *)&v39.listeningToList, s: "#str_swf_sellable_item");
      idSWFScriptObject::Set(this: container, name: "itemUseDesc", value: (idSWFScriptVar *)&v39.listeningToList);
      p_listeningToList = (idSWFScriptVar *)&v39.listeningToList;
      break;
    case 8u:
      idSWFScriptVar::idSWFScriptVar(this: (idSWFScriptVar *)&v39.count, s: "#str_swf_usable_item");
      idSWFScriptObject::Set(this: container, name: "itemUseDesc", value: (idSWFScriptVar *)&v39.count);
      p_listeningToList = (idSWFScriptVar *)&v39.count;
      break;
    case 0xAu:
      idSWFScriptVar::idSWFScriptVar(this: (idSWFScriptVar *)&v39.quickSlot, s: "#str_swf_vehicle_quickuse_item");
      idSWFScriptObject::Set(this: container, name: "itemUseDesc", value: (idSWFScriptVar *)&v39.quickSlot);
      p_listeningToList = (idSWFScriptVar *)&v39.quickSlot;
      break;
    default:
      idSWFScriptVar::idSWFScriptVar(this: &v40, s: &byte_8200D768);
      idSWFScriptObject::Set(this: container, name: "itemUseDesc", value: &v40);
      p_listeningToList = &v40;
      break;
  }
  idSWFScriptVar::Free(this: p_listeningToList);
  idSWFScriptVar::idSWFScriptVar(this: &v42, i: a5);
  idSWFScriptObject::Set(this: container, name: "itemsUse", value: &v42);
  idSWFScriptVar::Free(this: &v42);
  SellPrice = (idSWFScriptVar::swfScriptVarValue_t *)idInventoryItem::GetSellPrice(this: (idInventoryItem *)itemInfo);
  idSWFScriptVar::idSWFScriptVar(this: &v44, i: SellPrice);
  idSWFScriptObject::Set(this: container, name: "itemsValue", value: &v44);
  idSWFScriptVar::Free(this: &v44);
  if ( index->stackable )
  {
    v23 = (idSWFScriptVar::swfScriptVarValue_t *)(*(int (__fastcall **)(idStrId *))(itemInfo->index + 52))(a1: itemInfo);
    idSWFScriptVar::idSWFScriptVar(this: &v46, i: v23);
    idSWFScriptObject::Set(this: container, name: "count", value: &v46);
    v24 = &v46;
  }
  else
  {
    idSWFScriptVar::idSWFScriptVar(this: &v48, i: (idSWFScriptVar::swfScriptVarValue_t *)1);
    idSWFScriptObject::Set(this: container, name: "count", value: &v48);
    v24 = &v48;
  }
  idSWFScriptVar::Free(this: v24);
  if ( item->forSale )
  {
    v25 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x10u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v25 != nullptr )
    {
      v26 = item->listeningToList;
      v25[3].__vftable = (idSWFScriptFunction_vtbl *)itemInfo;
      v27 = v25;
      v25[1].__vftable = nullptr;
      v25->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`15'::idSWFScriptFunction_CanUseInVehicle::`vftable';
      v25[2].__vftable = (idSWFScriptFunction_vtbl *)v26;
    }
    else
    {
      v27 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v50, nf: v27);
    idSWFScriptObject::Set(this: container, name: "canUse", value: &v50);
    v28 = &v50;
  }
  else
  {
    v29 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x10u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v29 != nullptr )
    {
      v30 = item->listeningToList;
      v29[3].__vftable = (idSWFScriptFunction_vtbl *)itemInfo;
      v31 = v29;
      v29[1].__vftable = nullptr;
      v29->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`14'::idSWFScriptFunction_CanUse::`vftable';
      v29[2].__vftable = (idSWFScriptFunction_vtbl *)v30;
    }
    else
    {
      v31 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v52, nf: v31);
    idSWFScriptObject::Set(this: container, name: "canUse", value: &v52);
    v28 = &v52;
  }
  idSWFScriptVar::Free(this: v28);
  v32 = (idInventoryItem_vtbl *)idMem::AllocWithLocation(
                                  this: &mem,
                                  location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                  size: 0x10u,
                                  tag: TAG_SWF,
                                  zeroBuffer: false,
                                  align: ALIGN_16,
                                  heap: HEAP_DEFAULTHEAP);
  v39.__vftable = v32;
  if ( v32 != nullptr )
  {
    size = item->listeningToList[30].size;
    if ( size != 0 )
      v34 = (*(int (__fastcall **)(int))(*(_DWORD *)size + 104))(a1: size);
    else
      v34 = 0;
    v32->CallEvent = (idEventArg *(__fastcall *)(struct idInventoryItem *, idEventArg *, const idEventDef *, const idEventArg *))v34;
    v32->RespondsTo = (bool (__fastcall *)(struct idInventoryItem *, const idEventDef *))itemInfo;
    v35 = (idSWFScriptFunction *)v32;
    v32->dtr_idClass = nullptr;
    v32->GetType = (idTypeInfo *(__fastcall *)(struct idInventoryItem *))&`idPlayer::ShowInventory'::`16'::idSWFScriptFunction_Use::`vftable';
  }
  else
  {
    v35 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v54, nf: v35);
  idSWFScriptObject::Set(this: container, name: "use", value: &v54);
  idSWFScriptVar::Free(this: &v54);
  v36 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0xCu,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v36 != nullptr )
  {
    v36[2].__vftable = (idSWFScriptFunction_vtbl *)itemInfo;
    v36[1].__vftable = nullptr;
    v37 = v36;
    v36->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`18'::idSWFScriptFunction_CanEquip::`vftable';
  }
  else
  {
    v37 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v56, nf: v37);
  idSWFScriptObject::Set(this: container, name: "canEquip", value: &v56);
  idSWFScriptVar::Free(this: &v56);
  idSWFScriptVar::idSWFScriptVar(
    this: &v58,
    b: HIBYTE(itemInfo[6].index) + 1 - (itemInfo[6].index + (itemInfo[6].index == -1)));
  idSWFScriptObject::Set(this: container, name: "isEquipped", value: &v58);
  idSWFScriptVar::Free(this: &v58);
  idSWFScriptVar::idSWFScriptVar(this: v60, b: false);
  idSWFScriptObject::Set(this: container, name: "isEmpty", value: v60);
  idSWFScriptVar::Free(this: v60);
  return 1;
}


// ========================================================================
// __unwind$533327
// EA  : 0x82E6AE10
// RVA : 0x00E6AE10
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533327()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 256));
}


// ========================================================================
// __unwind$533328
// EA  : 0x82E6AE38
// RVA : 0x00E6AE38
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533328()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 192));
}


// ========================================================================
// __unwind$533329
// EA  : 0x82E6AE60
// RVA : 0x00E6AE60
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533329()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 112));
}


// ========================================================================
// __unwind$533330
// EA  : 0x82E6AE88
// RVA : 0x00E6AE88
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533330()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 240));
}


// ========================================================================
// __unwind$533331
// EA  : 0x82E6AEB0
// RVA : 0x00E6AEB0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533331()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 128));
}


// ========================================================================
// __unwind$533332
// EA  : 0x82E6AED8
// RVA : 0x00E6AED8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533332()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 208));
}


// ========================================================================
// __unwind$533333
// EA  : 0x82E6AF00
// RVA : 0x00E6AF00
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533333()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 144));
}


// ========================================================================
// __unwind$533334
// EA  : 0x82E6AF28
// RVA : 0x00E6AF28
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533334()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 272));
}


// ========================================================================
// __unwind$533335
// EA  : 0x82E6AF50
// RVA : 0x00E6AF50
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533335()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 160));
}


// ========================================================================
// __unwind$533336
// EA  : 0x82E6AF78
// RVA : 0x00E6AF78
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533336()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 224));
}


// ========================================================================
// __unwind$533337
// EA  : 0x82E6AFA0
// RVA : 0x00E6AFA0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533337()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 176));
}


// ========================================================================
// __unwind$533338
// EA  : 0x82E6AFC8
// RVA : 0x00E6AFC8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533338()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 88));
}


// ========================================================================
// __unwind$533339
// EA  : 0x82E6AFF0
// RVA : 0x00E6AFF0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533339()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 96));
}


// ========================================================================
// __unwind$533340
// EA  : 0x82E6B018
// RVA : 0x00E6B018
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533340()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 104));
}


// ========================================================================
// __unwind$533341_0
// EA  : 0x82E6B040
// RVA : 0x00E6B040
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533341_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 120));
}


// ========================================================================
// __unwind$533342
// EA  : 0x82E6B068
// RVA : 0x00E6B068
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533342()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 136));
}


// ========================================================================
// __unwind$533343
// EA  : 0x82E6B090
// RVA : 0x00E6B090
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533343()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 152));
}


// ========================================================================
// __unwind$533344
// EA  : 0x82E6B0B8
// RVA : 0x00E6B0B8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533344()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 168));
}


// ========================================================================
// __unwind$533345
// EA  : 0x82E6B0E0
// RVA : 0x00E6B0E0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533345()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 184));
}


// ========================================================================
// __unwind$533347
// EA  : 0x82E6B108
// RVA : 0x00E6B108
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533347()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 200));
}


// ========================================================================
// __unwind$533349
// EA  : 0x82E6B130
// RVA : 0x00E6B130
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533349()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 216));
}


// ========================================================================
// __unwind$533350
// EA  : 0x82E6B158
// RVA : 0x00E6B158
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533350()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 384 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533351
// EA  : 0x82E6B184
// RVA : 0x00E6B184
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533351()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 232));
}


// ========================================================================
// __unwind$533353
// EA  : 0x82E6B1AC
// RVA : 0x00E6B1AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533353()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 248));
}


// ========================================================================
// __unwind$533354
// EA  : 0x82E6B1D4
// RVA : 0x00E6B1D4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533354()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 264));
}


// ========================================================================
// __unwind$533355
// EA  : 0x82E6B1FC
// RVA : 0x00E6B1FC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533355()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 384 + 280));
}


// ========================================================================
// `idPlayer::ShowInventory'::`23'::idSWFScriptFunction_PlayerInventory_Refresh::Call
// EA  : 0x82E6B230
// RVA : 0x00E6B230
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_23_::idSWFScriptFunction_PlayerInventory_Refresh::Call(
        idSWFScriptVar *result,
        idInventoryItem *thisObject,
        __int64 parms,
        __int64 a4,
        __int64 a5)
{
  const idDeclInventory *v6; // r22
  int v7; // r11
  idStr *v8; // r4
  int v9; // r11
  const idDecl *v10; // r3
  int v11; // r3
  idInventoryCollection *v12; // r26
  int v13; // r30
  idInventoryItem *InventoryItem; // r3
  const idDeclInventory *decl; // r11
  idDeclInventory::inventoryUse_t itemUse; // r11
  idList<idVehicleState *,5> *v17; // r3
  int v18; // r25
  idVehicleState **list; // r28
  int i; // r27
  idStrId *v21; // r29
  idSWFScriptObject *v22; // r3
  idSWFScriptObject *v23; // r30
  idVehicleState **v25; // r28
  int j; // r27
  idStrId *v27; // r29
  idSWFScriptObject *v28; // r3
  idSWFScriptObject *v29; // r30
  int num; // r29
  idInventoryItem *v32; // r22
  idStateData *stateData; // r21
  idSWFScriptObject *v34; // r3
  idSWFScriptObject *v35; // r24
  char v36; // r30
  idSWFScriptVar::swfScriptVarValue_t v37; // r23
  int size; // r3
  int v39; // r3
  int v40; // r3
  int v41; // r3
  idJob *JobByDecl; // r3
  int v43; // r3
  int v44; // r3
  idSWFScriptVar::swfScriptVarValue_t v45; // r30
  int v46; // r3
  int v47; // r3
  idSWFScriptVar::swfScriptVarValue_t v48; // r30
  int v49; // r3
  int v50; // r3
  int v51; // r3
  int v52; // r3
  const char *v53; // r4
  const idStr *v54; // r29
  idStr *v55; // r3
  idStr *v56; // r30
  idSWFScriptVar::swfScriptVarValue_t v57; // r11
  idSWFScriptVar *v58; // r3
  const idStr *v59; // r29
  idStr *v60; // r3
  idStr *v61; // r30
  idSWFScriptVar::swfScriptVarValue_t v62; // r11
  int v63; // r3
  idSWFScriptVar::swfScriptVarValue_t v64; // r30
  int v65; // r3
  int v66; // r3
  idSWFScriptVar::swfScriptVarValue_t v67; // r30
  int v68; // r3
  int v69; // r3
  int v70; // r3
  int v71; // r3
  const char *v72; // r4
  const idStr *v73; // r29
  idStr *v74; // r3
  idStr *v75; // r30
  idSWFScriptVar::swfScriptVarValue_t v76; // r11
  const idStr *v77; // r29
  idStr *v78; // r3
  idStr *v79; // r30
  idSWFScriptVar::swfScriptVarValue_t v80; // r11
  const char *v81; // r4
  idStr *v82; // r29
  idStr *v83; // r3
  idStr *v84; // r30
  int len; // r28
  int allocedAndFlag; // r11
  int v87; // r4
  char *v88; // r10
  int v89; // r9
  char v90; // r11
  idSWFScriptVar::swfScriptVarValue_t v91; // r11
  idSWFScriptVar::swfScriptVarValue_t v92; // r30
  idStr *v93; // r29
  idStr *v94; // r3
  idStr *v95; // r30
  int v96; // r11
  int v97; // r28
  int v98; // r4
  char *v99; // r10
  int v100; // r9
  char v101; // r11
  idSWFScriptVar::swfScriptVarValue_t v102; // r11
  int SellPrice; // r3
  idSWFScriptVar::swfScriptVarValue_t v104; // r30
  _DWORD *v105; // r3
  int listeningToList; // r11
  idSWFScriptVar::swfScriptVarValue_t v107; // r30
  _DWORD *v108; // r3
  int v109; // r11
  idSWFScriptVar::swfScriptVarValue_t v110; // r30
  _DWORD *v111; // r30
  int v112; // r3
  int v113; // r3
  _DWORD *v114; // r3
  idSWFScriptVar::swfScriptVarValue_t v115; // r30
  int quickSlot; // r11
  bool v117; // r30
  int v118; // r10
  int v119; // r9
  int v120; // r8
  int v121; // r10
  bool v122; // r29
  _DWORD *v123; // r3
  int v124; // r11
  idSWFScriptVar::swfScriptVarValue_t v125; // r30
  int v126; // r30
  idVehicleState **v128; // r19
  int v129; // r26
  const idDeclInventory *v130; // r25
  idVehicleState **v131; // r28
  int k; // r27
  idStrId *v133; // r29
  idSWFScriptObject *v134; // r3
  idSWFScriptObject *v135; // r30
  idVehicleState **v137; // r21
  idVehicleState **v138; // r28
  int m; // r27
  idStrId *v140; // r29
  idSWFScriptObject *v141; // r3
  idSWFScriptObject *v142; // r30
  idVehicleState **v144; // r22
  idVehicleState **v145; // r28
  int n; // r27
  idStrId *v147; // r29
  idSWFScriptObject *v148; // r3
  idSWFScriptObject *v149; // r30
  idVehicleState **v151; // r23
  idVehicleState **v152; // r28
  int ii; // r27
  idStrId *v154; // r29
  idSWFScriptObject *v155; // r3
  idSWFScriptObject *v156; // r30
  idVehicleState **v158; // r24
  idVehicleState **v159; // r28
  int jj; // r27
  idStrId *v161; // r29
  idSWFScriptObject *v162; // r3
  idSWFScriptObject *v163; // r30
  int listStatic; // r25
  int v166; // r26
  int v167; // r27
  int v168; // r28
  int v169; // r30
  int v170; // r29
  void *v172; // [sp+50h] [-340h] BYREF
  int v173; // [sp+54h] [-33Ch]
  const idDeclInventory *v174; // [sp+58h] [-338h]
  idList<idVehicleState *,5> v175; // [sp+60h] [-330h] BYREF
  idSWFScriptVar v176; // [sp+70h] [-320h] BYREF
  idSWFScriptVar v177; // [sp+78h] [-318h] BYREF
  idSWFScriptVar v178; // [sp+80h] [-310h] BYREF
  idSWFScriptVar v179; // [sp+88h] [-308h] BYREF
  idSWFScriptVar v180; // [sp+90h] [-300h] BYREF
  idSWFScriptVar v181; // [sp+98h] [-2F8h] BYREF
  idSWFScriptVar v182; // [sp+A0h] [-2F0h] BYREF
  idSWFScriptVar v183; // [sp+A8h] [-2E8h] BYREF
  idSWFScriptVar v184; // [sp+B0h] [-2E0h] BYREF
  idSWFScriptVar v185; // [sp+B8h] [-2D8h] BYREF
  idSWFScriptVar v186[2]; // [sp+C0h] [-2D0h] BYREF
  idList<idVehicleState *,5> v187; // [sp+D0h] [-2C0h] BYREF
  idList<idVehicleState *,5> v188; // [sp+E0h] [-2B0h] BYREF
  idList<idVehicleState *,5> v189; // [sp+F0h] [-2A0h] BYREF
  idSWFScriptVar v190[2]; // [sp+100h] [-290h] BYREF
  idList<idVehicleState *,5> v191; // [sp+110h] [-280h] BYREF
  idSWFScriptVar v192[2]; // [sp+120h] [-270h] BYREF
  idList<idVehicleState *,5> v193; // [sp+130h] [-260h] BYREF
  idSWFScriptVar v194; // [sp+140h] [-250h] BYREF
  idSWFScriptVar v195; // [sp+148h] [-248h] BYREF
  idSWFScriptVar v196; // [sp+150h] [-240h] BYREF
  idSWFScriptVar v197; // [sp+158h] [-238h] BYREF
  idSWFScriptVar v198; // [sp+160h] [-230h] BYREF
  idSWFScriptVar v199; // [sp+168h] [-228h] BYREF
  idSWFScriptVar v200; // [sp+170h] [-220h] BYREF
  idSWFScriptVar v201; // [sp+178h] [-218h] BYREF
  idSWFScriptVar v202; // [sp+180h] [-210h] BYREF
  idSWFScriptVar v203; // [sp+188h] [-208h] BYREF
  idSWFScriptVar v204[2]; // [sp+190h] [-200h] BYREF
  idList<idVehicleState *,5> v205; // [sp+1A0h] [-1F0h] BYREF
  idSWFScriptVar v206; // [sp+1B0h] [-1E0h] BYREF
  idSWFScriptVar v207; // [sp+1B8h] [-1D8h] BYREF
  idSWFScriptVar v208; // [sp+1C0h] [-1D0h] BYREF
  idSWFScriptVar v209; // [sp+1C8h] [-1C8h] BYREF
  idSWFScriptVar v210; // [sp+1D0h] [-1C0h] BYREF
  __int64 v211; // [sp+1D8h] [-1B8h] BYREF
  idSWFScriptVar v212[2]; // [sp+1E0h] [-1B0h] BYREF
  idList<idVehicleState *,5> v213; // [sp+1F0h] [-1A0h] BYREF
  int v214; // [sp+200h] [-190h]
  idStr v215; // [sp+210h] [-180h] BYREF
  idStr v216; // [sp+230h] [-160h] BYREF
  idStr v217; // [sp+250h] [-140h] BYREF
  idStr v218; // [sp+270h] [-120h] BYREF
  idStr v219; // [sp+290h] [-100h] BYREF
  idStr v220; // [sp+2B0h] [-E0h] BYREF
  idStr v221[6]; // [sp+2D0h] [-C0h] BYREF

  v214 = 0;
  v6 = nullptr;
  v7 = *(_DWORD *)(parms + 4);
  v174 = nullptr;
  if ( v7 > 0 )
  {
    v8 = *(idStr **)parms;
    v9 = **(_DWORD **)parms;
    if ( v9 != 4 && v9 != 3 )
    {
      v172 = *(void **)parms;
      idSWFScriptVar::ToString(this: (idSWFScriptVar *)&v215, result: v8, a3: parms, a4, a5);
      if ( v215.len != 0 )
      {
        if ( v215.data != nullptr )
          v10 = idDeclInfo::FindWithInheritance(
                  this: &idDeclInventory::resourceList,
                  name: v215.data,
                  makeDefault: true);
        else
          v10 = nullptr;
        v6 = (const idDeclInventory *)v10;
        v174 = (const idDeclInventory *)v10;
      }
      idStr::FreeData(this: &v215);
    }
  }
  HIDWORD(v211) = 4;
  idSWFScriptVar::Free(this: (idSWFScriptVar *)&v211);
  v211 = 0x600000000LL;
  idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, name: "length", value: (idSWFScriptVar *)&v211);
  idSWFScriptVar::Free(this: (idSWFScriptVar *)&v211);
  v11 = (*((int (__fastcall **)(idList<idEventReceiver *,5> *))thisObject->listeningToList->list + 117))(a1: thisObject->listeningToList);
  memset(&v175, 0, 14);
  v12 = (idInventoryCollection *)v11;
  *(_WORD *)&v175.memTag = 1280;
  idList<idThread *,58>::Clear(this: &v175);
  memset(&v213, 0, 14);
  *(_WORD *)&v213.memTag = 1280;
  idList<idThread *,58>::Clear(this: &v213);
  memset(&v187, 0, 14);
  *(_WORD *)&v187.memTag = 1280;
  idList<idThread *,58>::Clear(this: &v187);
  memset(&v188, 0, 14);
  *(_WORD *)&v188.memTag = 1280;
  idList<idThread *,58>::Clear(this: &v188);
  memset(&v189, 0, 14);
  *(_WORD *)&v189.memTag = 1280;
  idList<idThread *,58>::Clear(this: &v189);
  memset(&v205, 0, 14);
  *(_WORD *)&v205.memTag = 1280;
  idList<idThread *,58>::Clear(this: &v205);
  memset(&v191, 0, 14);
  *(_WORD *)&v191.memTag = 1280;
  idList<idThread *,58>::Clear(this: &v191);
  memset(&v193, 0, 14);
  *(_WORD *)&v193.memTag = 1280;
  idList<idThread *,58>::Clear(this: &v193);
  v13 = 0;
  if ( (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v12) > 0 )
  {
    while ( 1 )
    {
      InventoryItem = idInventoryCollection::GetInventoryItem(this: v12, index: v13);
      decl = InventoryItem->decl;
      v172 = InventoryItem;
      itemUse = decl->itemUse;
      if ( itemUse == INVENTORY_USE_JOB )
        break;
      switch ( itemUse )
      {
        case INVENTORY_USE_QUICK:
        case INVENTORY_USE_AMMO:
        case INVENTORY_USE_WEAPON:
          v17 = &v187;
          goto LABEL_27;
        case INVENTORY_USE_ENGINEERING:
          v17 = &v188;
          goto LABEL_27;
        case INVENTORY_USE_SELLABLE:
          v17 = &v189;
          goto LABEL_27;
        case INVENTORY_USE_USABLE:
          v17 = &v205;
          goto LABEL_27;
        case INVENTORY_USE_VEHICLE:
          v17 = &v191;
          goto LABEL_27;
        case INVENTORY_USE_UNDEF:
          v17 = &v193;
          goto LABEL_27;
        default:
          break;
      }
LABEL_28:
      if ( ++v13 >= (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v12) )
        goto LABEL_29;
    }
    v17 = &v175;
LABEL_27:
    idList<idAnimWebBlendTree *,5>::Append(
      this: (idList<enum encounterGroupRole_t,5> *)v17,
      obj: (encounterGroupRole_t *)&v172);
    goto LABEL_28;
  }
LABEL_29:
  v172 = nullptr;
  v18 = 0;
  if ( v205.num > 0 )
  {
    list = v205.list;
    for ( i = v205.num; i != 0; --i )
    {
      v21 = (idStrId *)*list;
      v22 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x60u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
      v172 = v22;
      if ( v22 != nullptr )
        v23 = idSWFScriptObject::idSWFScriptObject(this: v22);
      else
        v23 = nullptr;
      if ( (unsigned __int8)_idPlayer::ShowInventory_::_23_::idSWFScriptFunction_PlayerInventory_Refresh::AddItem(
                              item: thisObject,
                              itemInfo: v21,
                              container: v23,
                              type: v6,
                              a5: (idSWFScriptVar::swfScriptVarValue_t *)8) != 0 )
      {
        v183.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v183);
        if ( v23 != nullptr )
        {
          v183.value.i = (int)v23;
          v183.type = SWF_VAR_OBJECT;
          ++v23->refCount;
        }
        else
        {
          v183.type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, index: v18++, value: &v183);
        idSWFScriptVar::Free(this: &v183);
      }
      if ( v23->refCount-- == 1 )
      {
        idSWFScriptObject::~idSWFScriptObject(this: v23);
        idMem::Free(this: &mem, ptr: v23, align: ALIGN_16);
      }
      ++list;
    }
    v172 = (void *)v18;
  }
  if ( v175.num > 0 )
  {
    v25 = v175.list;
    for ( j = v175.num; j != 0; --j )
    {
      v27 = (idStrId *)*v25;
      v28 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x60u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
      v172 = v28;
      if ( v28 != nullptr )
        v29 = idSWFScriptObject::idSWFScriptObject(this: v28);
      else
        v29 = nullptr;
      if ( (unsigned __int8)_idPlayer::ShowInventory_::_23_::idSWFScriptFunction_PlayerInventory_Refresh::AddItem(
                              item: thisObject,
                              itemInfo: v27,
                              container: v29,
                              type: v6,
                              a5: (idSWFScriptVar::swfScriptVarValue_t *)1) != 0 )
      {
        v185.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v185);
        if ( v29 != nullptr )
        {
          v185.type = SWF_VAR_OBJECT;
          v185.value.i = (int)v29;
          ++v29->refCount;
        }
        else
        {
          v185.type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, index: v18++, value: &v185);
        idSWFScriptVar::Free(this: &v185);
      }
      if ( v29->refCount-- == 1 )
      {
        idSWFScriptObject::~idSWFScriptObject(this: v29);
        idMem::Free(this: &mem, ptr: v29, align: ALIGN_16);
      }
      ++v25;
    }
    v172 = (void *)v18;
  }
  num = v213.num;
  if ( v213.num != 0 )
  {
    v32 = (idInventoryItem *)*v213.list;
    stateData = (*v213.list)->stateData;
    v34 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x60u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
    v173 = (int)v34;
    if ( v34 != nullptr )
      v35 = idSWFScriptObject::idSWFScriptObject(this: v34);
    else
      v35 = nullptr;
    v36 = 0;
    v37.i = num;
    size = thisObject->listeningToList[30].size;
    if ( size != 0 )
      v39 = (*(int (__fastcall **)(int))(*(_DWORD *)size + 104))(a1: size);
    else
      v39 = 0;
    if ( *(_DWORD *)(*(_DWORD *)(v39 + 16208) + 380) != 0 )
    {
      v40 = thisObject->listeningToList[30].size;
      v41 = v40 != 0 ? (*(int (__fastcall **)(int))(*(_DWORD *)v40 + 104))(a1: v40) : 0;
      JobByDecl = idJobManager::FindJobByDecl(
                    this: (idJobManager *)v12,
                    jobDecl: *(const idDeclJob **)(*(_DWORD *)(v41 + 16208) + 380));
      if ( JobByDecl != nullptr
        && ((int (__fastcall *)(idJob *))JobByDecl->__vftable[2].dtr_idClass)(a1: JobByDecl) >= 1 )
      {
        v36 = 1;
        v37.i = num - 1;
      }
    }
    v43 = thisObject->listeningToList[30].size;
    if ( v36 != 0 )
    {
      if ( v43 != 0 )
        v44 = (*(int (__fastcall **)(int))(*(_DWORD *)v43 + 104))(a1: v43);
      else
        v44 = 0;
      v45.f = *(float *)(*(_DWORD *)(v44 + 16208) + 396);
      v195.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v195);
      v195.value = v45;
      v195.type = SWF_VAR_STRINGID;
      idSWFScriptObject::Set(this: v35, name: "name", value: &v195);
      idSWFScriptVar::Free(this: &v195);
      v46 = thisObject->listeningToList[30].size;
      if ( v46 != 0 )
        v47 = (*(int (__fastcall **)(int))(*(_DWORD *)v46 + 104))(a1: v46);
      else
        v47 = 0;
      v48.f = *(float *)(*(_DWORD *)(v47 + 16208) + 400);
      v197.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v197);
      v197.value = v48;
      v197.type = SWF_VAR_STRINGID;
      idSWFScriptObject::Set(this: v35, name: "description", value: &v197);
      idSWFScriptVar::Free(this: &v197);
      v49 = thisObject->listeningToList[30].size;
      if ( v49 != 0 )
        v50 = (*(int (__fastcall **)(int))(*(_DWORD *)v49 + 104))(a1: v49);
      else
        v50 = 0;
      if ( *(_DWORD *)(*(_DWORD *)(v50 + 16208) + 404) != 0 )
      {
        v51 = thisObject->listeningToList[30].size;
        if ( v51 != 0 )
          v52 = (*(int (__fastcall **)(int))(*(_DWORD *)v51 + 104))(a1: v51);
        else
          v52 = 0;
        v53 = *(const char **)(*(_DWORD *)(*(_DWORD *)(v52 + 16208) + 404) + 8);
        v199.type = SWF_VAR_UNDEF;
        v54 = idStr::idStr(this: &v218, text: v53);
        idSWFScriptVar::Free(this: &v199);
        v199.type = SWF_VAR_STRING;
        v55 = (idStr *)idMem::AllocWithLocation(
                         this: &mem,
                         location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                         size: 0x24u,
                         tag: TAG_SWF,
                         zeroBuffer: false,
                         align: ALIGN_16,
                         heap: HEAP_DEFAULTHEAP);
        v56 = v55;
        v173 = (int)v55;
        if ( v55 != nullptr )
        {
          idStr::idStr(this: v55, text: v54);
          v57.i = (int)v56;
          v56[1].len = 1;
        }
        else
        {
          v57.i = 0;
        }
        v199.value = v57;
        idStr::FreeData(this: &v218);
        idSWFScriptObject::Set(this: v35, name: "icon", value: &v199);
        v58 = &v199;
      }
      else
      {
        v201.type = SWF_VAR_UNDEF;
        v59 = idStr::idStr(this: &v216, text: &byte_8200D768);
        idSWFScriptVar::Free(this: &v201);
        v201.type = SWF_VAR_STRING;
        v60 = (idStr *)idMem::AllocWithLocation(
                         this: &mem,
                         location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                         size: 0x24u,
                         tag: TAG_SWF,
                         zeroBuffer: false,
                         align: ALIGN_16,
                         heap: HEAP_DEFAULTHEAP);
        v61 = v60;
        v173 = (int)v60;
        if ( v60 != nullptr )
        {
          idStr::idStr(this: v60, text: v59);
          v62.i = (int)v61;
          v61[1].len = 1;
        }
        else
        {
          v62.i = 0;
        }
        v201.value = v62;
        idStr::FreeData(this: &v216);
        idSWFScriptObject::Set(this: v35, name: "icon", value: &v201);
        v58 = &v201;
      }
    }
    else
    {
      if ( v43 != 0 )
        v63 = (*(int (__fastcall **)(int))(*(_DWORD *)v43 + 104))(a1: v43);
      else
        v63 = 0;
      v64.f = *(float *)(*(_DWORD *)(v63 + 16208) + 384);
      v203.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v203);
      v203.value = v64;
      v203.type = SWF_VAR_STRINGID;
      idSWFScriptObject::Set(this: v35, name: "name", value: &v203);
      idSWFScriptVar::Free(this: &v203);
      v65 = thisObject->listeningToList[30].size;
      if ( v65 != 0 )
        v66 = (*(int (__fastcall **)(int))(*(_DWORD *)v65 + 104))(a1: v65);
      else
        v66 = 0;
      v67.f = *(float *)(*(_DWORD *)(v66 + 16208) + 388);
      v196.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v196);
      v196.value = v67;
      v196.type = SWF_VAR_STRINGID;
      idSWFScriptObject::Set(this: v35, name: "description", value: &v196);
      idSWFScriptVar::Free(this: &v196);
      v68 = thisObject->listeningToList[30].size;
      if ( v68 != 0 )
        v69 = (*(int (__fastcall **)(int))(*(_DWORD *)v68 + 104))(a1: v68);
      else
        v69 = 0;
      if ( *(_DWORD *)(*(_DWORD *)(v69 + 16208) + 392) != 0 )
      {
        v70 = thisObject->listeningToList[30].size;
        if ( v70 != 0 )
          v71 = (*(int (__fastcall **)(int))(*(_DWORD *)v70 + 104))(a1: v70);
        else
          v71 = 0;
        v72 = *(const char **)(*(_DWORD *)(*(_DWORD *)(v71 + 16208) + 392) + 8);
        v194.type = SWF_VAR_UNDEF;
        v73 = idStr::idStr(this: &v220, text: v72);
        idSWFScriptVar::Free(this: &v194);
        v194.type = SWF_VAR_STRING;
        v74 = (idStr *)idMem::AllocWithLocation(
                         this: &mem,
                         location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                         size: 0x24u,
                         tag: TAG_SWF,
                         zeroBuffer: false,
                         align: ALIGN_16,
                         heap: HEAP_DEFAULTHEAP);
        v75 = v74;
        v173 = (int)v74;
        if ( v74 != nullptr )
        {
          idStr::idStr(this: v74, text: v73);
          v76.i = (int)v75;
          v75[1].len = 1;
        }
        else
        {
          v76.i = 0;
        }
        v194.value = v76;
        idStr::FreeData(this: &v220);
        idSWFScriptObject::Set(this: v35, name: "icon", value: &v194);
        v58 = &v194;
      }
      else
      {
        v198.type = SWF_VAR_UNDEF;
        v77 = idStr::idStr(this: &v217, text: &byte_8200D768);
        idSWFScriptVar::Free(this: &v198);
        v198.type = SWF_VAR_STRING;
        v78 = (idStr *)idMem::AllocWithLocation(
                         this: &mem,
                         location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                         size: 0x24u,
                         tag: TAG_SWF,
                         zeroBuffer: false,
                         align: ALIGN_16,
                         heap: HEAP_DEFAULTHEAP);
        v79 = v78;
        v173 = (int)v78;
        if ( v78 != nullptr )
        {
          idStr::idStr(this: v78, text: v77);
          v80.i = (int)v79;
          v79[1].len = 1;
        }
        else
        {
          v80.i = 0;
        }
        v198.value = v80;
        idStr::FreeData(this: &v217);
        idSWFScriptObject::Set(this: v35, name: "icon", value: &v198);
        v58 = &v198;
      }
    }
    idSWFScriptVar::Free(this: v58);
    v81 = (const char *)stateData->transitions.num;
    v209.type = SWF_VAR_UNDEF;
    v82 = idStr::idStr(this: &v219, text: v81);
    idSWFScriptVar::Free(this: &v209);
    v209.type = SWF_VAR_STRING;
    v83 = (idStr *)idMem::AllocWithLocation(
                     this: &mem,
                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                     size: 0x24u,
                     tag: TAG_SWF,
                     zeroBuffer: false,
                     align: ALIGN_16,
                     heap: HEAP_DEFAULTHEAP);
    v84 = v83;
    v173 = (int)v83;
    if ( v83 != nullptr )
    {
      v83->allocedAndFlag = 20;
      v83->len = 0;
      v83->data = v83->baseBuffer;
      v83->baseBuffer[0] = 0;
      len = v82->len;
      allocedAndFlag = v83->allocedAndFlag;
      v87 = v82->len + 1;
      if ( allocedAndFlag >= 0 )
      {
        if ( v87 > (allocedAndFlag & 0x7FFFFFFF) )
          idStr::ReAllocate(this: v83, amount: v87, keepold: true);
      }
      else if ( v87 > (allocedAndFlag & 0x7FFFFFFF)
             && AssertFailed(
                  file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                  line: 463,
                  expression: "amount <= GetAlloced()",
                  inlineBreak: true) )
      {
        __trap();
      }
      v88 = v82->data - 1;
      v89 = (int)(v84->data - 1);
      do
      {
        v90 = *++v88;
        *(_BYTE *)++v89 = *v88;
      }
      while ( v90 != 0 );
      v84->len = len;
      v91.i = (int)v84;
      v84[1].len = 1;
    }
    else
    {
      v91.i = 0;
    }
    v209.value = v91;
    idStr::FreeData(this: &v219);
    idSWFScriptObject::Set(this: v35, name: "decl", value: &v209);
    idSWFScriptVar::Free(this: &v209);
    SLODWORD(v92.f) = v32->quickSlot;
    v200.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v200);
    v200.value = v92;
    v200.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: v35, name: "quickslot", value: &v200);
    idSWFScriptVar::Free(this: &v200);
    v207.type = SWF_VAR_UNDEF;
    v93 = idStr::idStr(this: v221, text: "#str_swf_card_item");
    idSWFScriptVar::Free(this: &v207);
    v207.type = SWF_VAR_STRING;
    v94 = (idStr *)idMem::AllocWithLocation(
                     this: &mem,
                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                     size: 0x24u,
                     tag: TAG_SWF,
                     zeroBuffer: false,
                     align: ALIGN_16,
                     heap: HEAP_DEFAULTHEAP);
    v95 = v94;
    v173 = (int)v94;
    if ( v94 != nullptr )
    {
      v94->allocedAndFlag = 20;
      v94->len = 0;
      v94->data = v94->baseBuffer;
      v94->baseBuffer[0] = 0;
      v96 = v94->allocedAndFlag;
      v97 = v93->len;
      v98 = v93->len + 1;
      if ( v96 >= 0 )
      {
        if ( v98 > (v96 & 0x7FFFFFFF) )
          idStr::ReAllocate(this: v94, amount: v98, keepold: true);
      }
      else if ( v98 > (v96 & 0x7FFFFFFF)
             && AssertFailed(
                  file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                  line: 463,
                  expression: "amount <= GetAlloced()",
                  inlineBreak: true) )
      {
        __trap();
      }
      v99 = v93->data - 1;
      v100 = (int)(v95->data - 1);
      do
      {
        v101 = *++v99;
        *(_BYTE *)++v100 = *v99;
      }
      while ( v101 != 0 );
      v95->len = v97;
      v102.i = (int)v95;
      v95[1].len = 1;
    }
    else
    {
      v102.i = 0;
    }
    v207.value = v102;
    idStr::FreeData(this: v221);
    idSWFScriptObject::Set(this: v35, name: "itemUseDesc", value: &v207);
    idSWFScriptVar::Free(this: &v207);
    v202.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v202);
    v202.type = SWF_VAR_INTEGER;
    v202.value.i = 1;
    idSWFScriptObject::Set(this: v35, name: "itemsUse", value: &v202);
    idSWFScriptVar::Free(this: &v202);
    SellPrice = idInventoryItem::GetSellPrice(this: v32);
    v208.type = SWF_VAR_UNDEF;
    v104.i = SellPrice;
    idSWFScriptVar::Free(this: &v208);
    v208.value = v104;
    v208.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: v35, name: "itemsValue", value: &v208);
    idSWFScriptVar::Free(this: &v208);
    v204[0].type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: v204);
    v204[0].value = v37;
    v204[0].type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: v35, name: "count", value: v204);
    idSWFScriptVar::Free(this: v204);
    if ( thisObject->forSale )
    {
      v105 = idMem::AllocWithLocation(
               this: &mem,
               location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
               size: 0x10u,
               tag: TAG_SWF,
               zeroBuffer: false,
               align: ALIGN_16,
               heap: HEAP_DEFAULTHEAP);
      if ( v105 != nullptr )
      {
        listeningToList = (int)thisObject->listeningToList;
        v105[3] = v32;
        v107.i = (int)v105;
        v105[1] = 0;
        *v105 = &`idPlayer::ShowInventory'::`15'::idSWFScriptFunction_CanUseInVehicle::`vftable';
        v105[2] = listeningToList;
      }
      else
      {
        v107.i = 0;
      }
      v178.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v178);
      if ( v107.i != 0 )
      {
        v178.type = SWF_VAR_FUNCTION;
        v178.value = v107;
        (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v107.i + 8))(a1: v107.i);
      }
      else
      {
        v178.type = SWF_VAR_NULL;
      }
      idSWFScriptObject::Set(this: v35, name: "canUse", value: &v178);
      idSWFScriptVar::Free(this: &v178);
    }
    else
    {
      v108 = idMem::AllocWithLocation(
               this: &mem,
               location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
               size: 0x10u,
               tag: TAG_SWF,
               zeroBuffer: false,
               align: ALIGN_16,
               heap: HEAP_DEFAULTHEAP);
      if ( v108 != nullptr )
      {
        v109 = (int)thisObject->listeningToList;
        v108[3] = v32;
        v110.i = (int)v108;
        v108[1] = 0;
        *v108 = &`idPlayer::ShowInventory'::`14'::idSWFScriptFunction_CanUse::`vftable';
        v108[2] = v109;
      }
      else
      {
        v110.i = 0;
      }
      v186[0].type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: v186);
      if ( v110.i != 0 )
      {
        v186[0].value = v110;
        v186[0].type = SWF_VAR_FUNCTION;
        (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v110.i + 8))(a1: v110.i);
      }
      else
      {
        v186[0].type = SWF_VAR_NULL;
      }
      idSWFScriptObject::Set(this: v35, name: "canUse", value: v186);
      idSWFScriptVar::Free(this: v186);
    }
    v111 = idMem::AllocWithLocation(
             this: &mem,
             location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
             size: 0x10u,
             tag: TAG_SWF,
             zeroBuffer: false,
             align: ALIGN_16,
             heap: HEAP_DEFAULTHEAP);
    v173 = (int)v111;
    if ( v111 != nullptr )
    {
      v112 = thisObject->listeningToList[30].size;
      if ( v112 != 0 )
        v113 = (*(int (__fastcall **)(int))(*(_DWORD *)v112 + 104))(a1: v112);
      else
        v113 = 0;
      v111[2] = v113;
      v111[3] = v32;
      v111[1] = 0;
      *v111 = &`idPlayer::ShowInventory'::`16'::idSWFScriptFunction_Use::`vftable';
    }
    else
    {
      v111 = nullptr;
    }
    v180.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v180);
    if ( v111 != nullptr )
    {
      v180.type = SWF_VAR_FUNCTION;
      v180.value.i = (int)v111;
      (*(void (__fastcall **)(_DWORD *))(*v111 + 8))(a1: v111);
    }
    else
    {
      v180.type = SWF_VAR_NULL;
    }
    idSWFScriptObject::Set(this: v35, name: "use", value: &v180);
    idSWFScriptVar::Free(this: &v180);
    v114 = idMem::AllocWithLocation(
             this: &mem,
             location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
             size: 0xCu,
             tag: TAG_SWF,
             zeroBuffer: false,
             align: ALIGN_16,
             heap: HEAP_DEFAULTHEAP);
    if ( v114 != nullptr )
    {
      v114[2] = v32;
      v114[1] = 0;
      v115.i = (int)v114;
      *v114 = &`idPlayer::ShowInventory'::`18'::idSWFScriptFunction_CanEquip::`vftable';
    }
    else
    {
      v115.i = 0;
    }
    v190[0].type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: v190);
    if ( v115.i != 0 )
    {
      v190[0].value = v115;
      v190[0].type = SWF_VAR_FUNCTION;
      (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v115.i + 8))(a1: v115.i);
    }
    else
    {
      v190[0].type = SWF_VAR_NULL;
    }
    idSWFScriptObject::Set(this: v35, name: "canEquip", value: v190);
    idSWFScriptVar::Free(this: v190);
    quickSlot = v32->quickSlot;
    v210.type = SWF_VAR_UNDEF;
    v117 = quickSlot != -1;
    idSWFScriptVar::Free(this: &v210);
    v210.value.b = v117;
    v210.type = SWF_VAR_BOOL;
    idSWFScriptObject::Set(this: v35, name: "isEquipped", value: &v210);
    idSWFScriptVar::Free(this: &v210);
    v206.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v206);
    v206.type = SWF_VAR_BOOL;
    v206.value.b = false;
    idSWFScriptObject::Set(this: v35, name: "isEmpty", value: &v206);
    idSWFScriptVar::Free(this: &v206);
    v118 = (int)thisObject->listeningToList;
    v119 = 0;
    v173 = *(_DWORD *)(v118 + 12812);
    if ( v173 <= 0 )
    {
LABEL_170:
      v122 = false;
    }
    else
    {
      v120 = *(_DWORD *)(v118 + 12808);
      v121 = 0;
      while ( *(idStateData **)(v121 + v120) != stateData )
      {
        ++v119;
        v121 += 12;
        if ( v119 >= v173 )
          goto LABEL_170;
      }
      v122 = (_cntlzw(*(unsigned __int8 *)(12 * v119 + v120 + 4)) & 0x20) != 0;
    }
    v123 = idMem::AllocWithLocation(
             this: &mem,
             location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
             size: 0x10u,
             tag: TAG_SWF,
             zeroBuffer: false,
             align: ALIGN_16,
             heap: HEAP_DEFAULTHEAP);
    if ( v123 != nullptr )
    {
      v124 = (int)thisObject->listeningToList;
      v123[3] = stateData;
      v125.i = (int)v123;
      v123[1] = 0;
      *v123 = &`idPlayer::ShowInventory'::`17'::idSWFScriptFunction_ClearNewItem::`vftable';
      v123[2] = v124;
    }
    else
    {
      v125.i = 0;
    }
    v182.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v182);
    if ( v125.i != 0 )
    {
      v182.type = SWF_VAR_FUNCTION;
      v182.value = v125;
      (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v125.i + 8))(a1: v125.i);
    }
    else
    {
      v182.type = SWF_VAR_NULL;
    }
    idSWFScriptObject::Set(this: v35, name: "clearNewItem", value: &v182);
    idSWFScriptVar::Free(this: &v182);
    v212[0].type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: v212);
    v212[0].value.b = v122;
    v212[0].type = SWF_VAR_BOOL;
    idSWFScriptObject::Set(this: v35, name: "isNewItem", value: v212);
    idSWFScriptVar::Free(this: v212);
    v176.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v176);
    if ( v35 != nullptr )
    {
      v176.value.i = (int)v35;
      v176.type = SWF_VAR_OBJECT;
      ++v35->refCount;
    }
    else
    {
      v176.type = SWF_VAR_NULL;
    }
    v126 = (int)v172;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, index: (int)v172, value: &v176);
    v172 = (void *)(v126 + 1);
    idSWFScriptVar::Free(this: &v176);
    if ( v35->refCount-- == 1 )
    {
      idSWFScriptObject::~idSWFScriptObject(this: v35);
      idMem::Free(this: &mem, ptr: v35, align: ALIGN_16);
    }
  }
  v128 = v187.list;
  v129 = (int)v172;
  v130 = v174;
  if ( v187.num > 0 )
  {
    v131 = v187.list;
    for ( k = v187.num; k != 0; --k )
    {
      v133 = (idStrId *)*v131;
      v134 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                    this: &mem,
                                    location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                    size: 0x60u,
                                    tag: TAG_SWF,
                                    zeroBuffer: false,
                                    align: ALIGN_16,
                                    heap: HEAP_DEFAULTHEAP);
      v173 = (int)v134;
      if ( v134 != nullptr )
        v135 = idSWFScriptObject::idSWFScriptObject(this: v134);
      else
        v135 = nullptr;
      if ( (unsigned __int8)_idPlayer::ShowInventory_::_23_::idSWFScriptFunction_PlayerInventory_Refresh::AddItem(
                              item: thisObject,
                              itemInfo: v133,
                              container: v135,
                              type: v130,
                              a5: (idSWFScriptVar::swfScriptVarValue_t *)2) != 0 )
      {
        v184.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v184);
        if ( v135 != nullptr )
        {
          v184.value.i = (int)v135;
          v184.type = SWF_VAR_OBJECT;
          ++v135->refCount;
        }
        else
        {
          v184.type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, index: v129++, value: &v184);
        idSWFScriptVar::Free(this: &v184);
      }
      if ( v135->refCount-- == 1 )
      {
        idSWFScriptObject::~idSWFScriptObject(this: v135);
        idMem::Free(this: &mem, ptr: v135, align: ALIGN_16);
      }
      ++v131;
    }
  }
  v137 = v188.list;
  if ( v188.num > 0 )
  {
    v138 = v188.list;
    for ( m = v188.num; m != 0; --m )
    {
      v140 = (idStrId *)*v138;
      v141 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                    this: &mem,
                                    location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                    size: 0x60u,
                                    tag: TAG_SWF,
                                    zeroBuffer: false,
                                    align: ALIGN_16,
                                    heap: HEAP_DEFAULTHEAP);
      v173 = (int)v141;
      if ( v141 != nullptr )
        v142 = idSWFScriptObject::idSWFScriptObject(this: v141);
      else
        v142 = nullptr;
      if ( (unsigned __int8)_idPlayer::ShowInventory_::_23_::idSWFScriptFunction_PlayerInventory_Refresh::AddItem(
                              item: thisObject,
                              itemInfo: v140,
                              container: v142,
                              type: v130,
                              a5: (idSWFScriptVar::swfScriptVarValue_t *)3) != 0 )
      {
        v192[0].type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: v192);
        if ( v142 != nullptr )
        {
          v192[0].value.i = (int)v142;
          v192[0].type = SWF_VAR_OBJECT;
          ++v142->refCount;
        }
        else
        {
          v192[0].type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, index: v129++, value: v192);
        idSWFScriptVar::Free(this: v192);
      }
      if ( v142->refCount-- == 1 )
      {
        idSWFScriptObject::~idSWFScriptObject(this: v142);
        idMem::Free(this: &mem, ptr: v142, align: ALIGN_16);
      }
      ++v138;
    }
  }
  v144 = v189.list;
  if ( v189.num > 0 )
  {
    v145 = v189.list;
    for ( n = v189.num; n != 0; --n )
    {
      v147 = (idStrId *)*v145;
      v148 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                    this: &mem,
                                    location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                    size: 0x60u,
                                    tag: TAG_SWF,
                                    zeroBuffer: false,
                                    align: ALIGN_16,
                                    heap: HEAP_DEFAULTHEAP);
      v173 = (int)v148;
      if ( v148 != nullptr )
        v149 = idSWFScriptObject::idSWFScriptObject(this: v148);
      else
        v149 = nullptr;
      if ( (unsigned __int8)_idPlayer::ShowInventory_::_23_::idSWFScriptFunction_PlayerInventory_Refresh::AddItem(
                              item: thisObject,
                              itemInfo: v147,
                              container: v149,
                              type: v130,
                              a5: (idSWFScriptVar::swfScriptVarValue_t *)4) != 0 )
      {
        v177.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v177);
        if ( v149 != nullptr )
        {
          v177.value.i = (int)v149;
          v177.type = SWF_VAR_OBJECT;
          ++v149->refCount;
        }
        else
        {
          v177.type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, index: v129++, value: &v177);
        idSWFScriptVar::Free(this: &v177);
      }
      if ( v149->refCount-- == 1 )
      {
        idSWFScriptObject::~idSWFScriptObject(this: v149);
        idMem::Free(this: &mem, ptr: v149, align: ALIGN_16);
      }
      ++v145;
    }
  }
  v151 = v191.list;
  if ( v191.num > 0 )
  {
    v152 = v191.list;
    for ( ii = v191.num; ii != 0; --ii )
    {
      v154 = (idStrId *)*v152;
      v155 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                    this: &mem,
                                    location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                    size: 0x60u,
                                    tag: TAG_SWF,
                                    zeroBuffer: false,
                                    align: ALIGN_16,
                                    heap: HEAP_DEFAULTHEAP);
      v173 = (int)v155;
      if ( v155 != nullptr )
        v156 = idSWFScriptObject::idSWFScriptObject(this: v155);
      else
        v156 = nullptr;
      if ( (unsigned __int8)_idPlayer::ShowInventory_::_23_::idSWFScriptFunction_PlayerInventory_Refresh::AddItem(
                              item: thisObject,
                              itemInfo: v154,
                              container: v156,
                              type: v130,
                              a5: (idSWFScriptVar::swfScriptVarValue_t *)0xA) != 0 )
      {
        v179.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v179);
        if ( v156 != nullptr )
        {
          v179.value.i = (int)v156;
          v179.type = SWF_VAR_OBJECT;
          ++v156->refCount;
        }
        else
        {
          v179.type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, index: v129++, value: &v179);
        idSWFScriptVar::Free(this: &v179);
      }
      if ( v156->refCount-- == 1 )
      {
        idSWFScriptObject::~idSWFScriptObject(this: v156);
        idMem::Free(this: &mem, ptr: v156, align: ALIGN_16);
      }
      ++v152;
    }
  }
  v158 = v193.list;
  if ( swf_inventoryShowUndefined.valueInteger != 0 && v193.num > 0 )
  {
    v159 = v193.list;
    for ( jj = v193.num; jj != 0; --jj )
    {
      v161 = (idStrId *)*v159;
      v162 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                    this: &mem,
                                    location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                    size: 0x60u,
                                    tag: TAG_SWF,
                                    zeroBuffer: false,
                                    align: ALIGN_16,
                                    heap: HEAP_DEFAULTHEAP);
      v173 = (int)v162;
      if ( v162 != nullptr )
        v163 = idSWFScriptObject::idSWFScriptObject(this: v162);
      else
        v163 = nullptr;
      if ( (unsigned __int8)_idPlayer::ShowInventory_::_23_::idSWFScriptFunction_PlayerInventory_Refresh::AddItem(
                              item: thisObject,
                              itemInfo: v161,
                              container: v163,
                              type: v130,
                              a5: nullptr) != 0 )
      {
        v181.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v181);
        if ( v163 != nullptr )
        {
          v181.value.i = (int)v163;
          v181.type = SWF_VAR_OBJECT;
          ++v163->refCount;
        }
        else
        {
          v181.type = SWF_VAR_NULL;
        }
        idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, index: v129++, value: &v181);
        idSWFScriptVar::Free(this: &v181);
      }
      if ( v163->refCount-- == 1 )
      {
        idSWFScriptObject::~idSWFScriptObject(this: v163);
        idMem::Free(this: &mem, ptr: v163, align: ALIGN_16);
      }
      ++v159;
    }
  }
  listStatic = v175.listStatic;
  if ( v175.listStatic == 0 || v175.listStatic == 2 )
  {
    if ( v175.list != nullptr )
      idMem::Free(this: &mem, ptr: v175.list, align: ALIGN_16);
    v175.list = nullptr;
    v175.size = 0;
  }
  v166 = v187.listStatic;
  v175.num = 0;
  if ( v187.listStatic == 0 || v187.listStatic == 2 )
  {
    if ( v128 != nullptr )
      idMem::Free(this: &mem, ptr: v128, align: ALIGN_16);
    v128 = nullptr;
    v187.size = 0;
    v187.list = nullptr;
  }
  v167 = v189.listStatic;
  v187.num = 0;
  if ( v189.listStatic == 0 || v189.listStatic == 2 )
  {
    if ( v144 != nullptr )
      idMem::Free(this: &mem, ptr: v144, align: ALIGN_16);
    v144 = nullptr;
    v189.size = 0;
    v189.list = nullptr;
  }
  v168 = v191.listStatic;
  v189.num = 0;
  if ( v191.listStatic == 0 || v191.listStatic == 2 )
  {
    if ( v151 != nullptr )
      idMem::Free(this: &mem, ptr: v151, align: ALIGN_16);
    v151 = nullptr;
    v191.size = 0;
    v191.list = nullptr;
  }
  v169 = v193.listStatic;
  v191.num = 0;
  if ( v193.listStatic == 0 || v193.listStatic == 2 )
  {
    if ( v158 != nullptr )
      idMem::Free(this: &mem, ptr: v158, align: ALIGN_16);
    v158 = nullptr;
    v193.size = 0;
    v193.list = nullptr;
  }
  v170 = v188.listStatic;
  v193.num = 0;
  if ( v188.listStatic == 0 || v188.listStatic == 2 )
  {
    if ( v137 != nullptr )
      idMem::Free(this: &mem, ptr: v137, align: ALIGN_16);
    v137 = nullptr;
    v188.size = 0;
    v188.list = nullptr;
  }
  v188.num = 0;
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value.b = true;
  result->type = SWF_VAR_BOOL;
  v214 = 1;
  if ( (v169 == 0 || v169 == 2) && v158 != nullptr )
    idMem::Free(this: &mem, ptr: v158, align: ALIGN_16);
  if ( (v168 == 0 || v168 == 2) && v151 != nullptr )
    idMem::Free(this: &mem, ptr: v151, align: ALIGN_16);
  if ( (v205.listStatic == 0 || v205.listStatic == 2) && v205.list != nullptr )
    idMem::Free(this: &mem, ptr: v205.list, align: ALIGN_16);
  if ( (v167 == 0 || v167 == 2) && v144 != nullptr )
    idMem::Free(this: &mem, ptr: v144, align: ALIGN_16);
  if ( (v170 == 0 || v170 == 2) && v137 != nullptr )
    idMem::Free(this: &mem, ptr: v137, align: ALIGN_16);
  if ( (v166 == 0 || v166 == 2) && v128 != nullptr )
    idMem::Free(this: &mem, ptr: v128, align: ALIGN_16);
  if ( (v213.listStatic == 0 || v213.listStatic == 2) && v213.list != nullptr )
    idMem::Free(this: &mem, ptr: v213.list, align: ALIGN_16);
  if ( (listStatic == 0 || listStatic == 2) && v175.list != nullptr )
    idMem::Free(this: &mem, ptr: v175.list, align: ALIGN_16);
  return result;
}


// ========================================================================
// __unwind$533840
// EA  : 0x82E6CCA8
// RVA : 0x00E6CCA8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533840()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 912 + 528));
}


// ========================================================================
// __unwind$533841
// EA  : 0x82E6CCD0
// RVA : 0x00E6CCD0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533841()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 472));
}


// ========================================================================
// __unwind$533842
// EA  : 0x82E6CCF8
// RVA : 0x00E6CCF8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533842()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 912 + 96));
}


// ========================================================================
// __unwind$533843
// EA  : 0x82E6CD20
// RVA : 0x00E6CD20
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533843()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 912 + 496));
}


// ========================================================================
// __unwind$533844
// EA  : 0x82E6CD48
// RVA : 0x00E6CD48
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533844()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 912 + 208));
}


// ========================================================================
// __unwind$533845
// EA  : 0x82E6CD70
// RVA : 0x00E6CD70
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533845()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 912 + 224));
}


// ========================================================================
// __unwind$533846
// EA  : 0x82E6CD98
// RVA : 0x00E6CD98
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533846()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 912 + 240));
}


// ========================================================================
// __unwind$533847
// EA  : 0x82E6CDC0
// RVA : 0x00E6CDC0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533847()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 912 + 416));
}


// ========================================================================
// __unwind$533848
// EA  : 0x82E6CDE8
// RVA : 0x00E6CDE8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533848()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 912 + 272));
}


// ========================================================================
// __unwind$533849
// EA  : 0x82E6CE10
// RVA : 0x00E6CE10
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533849()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 912 + 304));
}


// ========================================================================
// __unwind$533984
// EA  : 0x82E6CE38
// RVA : 0x00E6CE38
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533984()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533850
// EA  : 0x82E6CE64
// RVA : 0x00E6CE64
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533850()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 168));
}


// ========================================================================
// __unwind$534056
// EA  : 0x82E6CE8C
// RVA : 0x00E6CE8C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534056()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533851
// EA  : 0x82E6CEB8
// RVA : 0x00E6CEB8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533851()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 184));
}


// ========================================================================
// __unwind$534131
// EA  : 0x82E6CEE0
// RVA : 0x00E6CEE0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534131()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533852
// EA  : 0x82E6CF0C
// RVA : 0x00E6CF0C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533852()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 328));
}


// ========================================================================
// __unwind$533853
// EA  : 0x82E6CF34
// RVA : 0x00E6CF34
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533853()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 344));
}


// ========================================================================
// __unwind$534363
// EA  : 0x82E6CF5C
// RVA : 0x00E6CF5C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534363()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 912 + 624));
}


// ========================================================================
// __unwind$534370
// EA  : 0x82E6CF84
// RVA : 0x00E6CF84
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534370()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533854
// EA  : 0x82E6CFB0
// RVA : 0x00E6CFB0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533854()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 360));
}


// ========================================================================
// __unwind$534426
// EA  : 0x82E6CFD8
// RVA : 0x00E6CFD8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534426()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 912 + 560));
}


// ========================================================================
// __unwind$534433
// EA  : 0x82E6D000
// RVA : 0x00E6D000
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534433()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533855
// EA  : 0x82E6D02C
// RVA : 0x00E6D02C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533855()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 376));
}


// ========================================================================
// __unwind$533856
// EA  : 0x82E6D054
// RVA : 0x00E6D054
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533856()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 392));
}


// ========================================================================
// __unwind$533857
// EA  : 0x82E6D07C
// RVA : 0x00E6D07C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533857()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 336));
}


// ========================================================================
// __unwind$534656
// EA  : 0x82E6D0A4
// RVA : 0x00E6D0A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534656()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 912 + 688));
}


// ========================================================================
// __unwind$534663
// EA  : 0x82E6D0CC
// RVA : 0x00E6D0CC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534663()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533858
// EA  : 0x82E6D0F8
// RVA : 0x00E6D0F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533858()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 320));
}


// ========================================================================
// __unwind$534719_0
// EA  : 0x82E6D120
// RVA : 0x00E6D120
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534719_0()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 912 + 592));
}


// ========================================================================
// __unwind$534726_0
// EA  : 0x82E6D148
// RVA : 0x00E6D148
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534726_0()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533859
// EA  : 0x82E6D174
// RVA : 0x00E6D174
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533859()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 352));
}


// ========================================================================
// __unwind$534791
// EA  : 0x82E6D19C
// RVA : 0x00E6D19C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534791()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 912 + 656));
}


// ========================================================================
// __unwind$534798
// EA  : 0x82E6D1C4
// RVA : 0x00E6D1C4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_534798()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533860
// EA  : 0x82E6D1F0
// RVA : 0x00E6D1F0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533860()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 456));
}


// ========================================================================
// __unwind$533861
// EA  : 0x82E6D218
// RVA : 0x00E6D218
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533861()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 368));
}


// ========================================================================
// __unwind$535030
// EA  : 0x82E6D240
// RVA : 0x00E6D240
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_535030()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 912 + 720));
}


// ========================================================================
// __unwind$535037
// EA  : 0x82E6D268
// RVA : 0x00E6D268
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_535037()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533862
// EA  : 0x82E6D294
// RVA : 0x00E6D294
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533862()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 440));
}


// ========================================================================
// __unwind$533863
// EA  : 0x82E6D2BC
// RVA : 0x00E6D2BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533863()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 384));
}


// ========================================================================
// __unwind$533864
// EA  : 0x82E6D2E4
// RVA : 0x00E6D2E4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533864()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 448));
}


// ========================================================================
// __unwind$533865
// EA  : 0x82E6D30C
// RVA : 0x00E6D30C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533865()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 400));
}


// ========================================================================
// __unwind$533867
// EA  : 0x82E6D334
// RVA : 0x00E6D334
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533867()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 128));
}


// ========================================================================
// __unwind$533869
// EA  : 0x82E6D35C
// RVA : 0x00E6D35C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533869()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 192));
}


// ========================================================================
// __unwind$533870
// EA  : 0x82E6D384
// RVA : 0x00E6D384
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533870()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533871
// EA  : 0x82E6D3B0
// RVA : 0x00E6D3B0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533871()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 144));
}


// ========================================================================
// __unwind$533873
// EA  : 0x82E6D3D8
// RVA : 0x00E6D3D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533873()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 256));
}


// ========================================================================
// __unwind$533874
// EA  : 0x82E6D400
// RVA : 0x00E6D400
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533874()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 464));
}


// ========================================================================
// __unwind$533875
// EA  : 0x82E6D428
// RVA : 0x00E6D428
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533875()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 432));
}


// ========================================================================
// __unwind$533877
// EA  : 0x82E6D450
// RVA : 0x00E6D450
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533877()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 160));
}


// ========================================================================
// __unwind$533878
// EA  : 0x82E6D478
// RVA : 0x00E6D478
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533878()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 480));
}


// ========================================================================
// __unwind$533879
// EA  : 0x82E6D4A0
// RVA : 0x00E6D4A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533879()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 112));
}


// ========================================================================
// __unwind$535598
// EA  : 0x82E6D4C8
// RVA : 0x00E6D4C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_535598()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533880
// EA  : 0x82E6D4F4
// RVA : 0x00E6D4F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533880()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 176));
}


// ========================================================================
// __unwind$535670
// EA  : 0x82E6D51C
// RVA : 0x00E6D51C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_535670()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533881
// EA  : 0x82E6D548
// RVA : 0x00E6D548
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533881()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 288));
}


// ========================================================================
// __unwind$535742
// EA  : 0x82E6D570
// RVA : 0x00E6D570
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_535742()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533882
// EA  : 0x82E6D59C
// RVA : 0x00E6D59C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533882()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 120));
}


// ========================================================================
// __unwind$535814
// EA  : 0x82E6D5C4
// RVA : 0x00E6D5C4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_535814()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533883
// EA  : 0x82E6D5F0
// RVA : 0x00E6D5F0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533883()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 136));
}


// ========================================================================
// __unwind$535889
// EA  : 0x82E6D618
// RVA : 0x00E6D618
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_535889()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 912 + 84), tag: TAG_SWF);
}


// ========================================================================
// __unwind$533884
// EA  : 0x82E6D644
// RVA : 0x00E6D644
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533884()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 912 + 152));
}


// ========================================================================
// __unwind$533885
// EA  : 0x82E6D66C
// RVA : 0x00E6D66C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_533885()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 912;
  if ( (*(_DWORD *)(v0 - 912 + 512) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 512) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 932));
  }
}


// ========================================================================
// `idPlayer::ShowInventory'::`25'::idSWFScriptFunction_PlayerInventory_AvailQuickSlot::Call
// EA  : 0x82E6D6B0
// RVA : 0x00E6D6B0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_25_::idSWFScriptFunction_PlayerInventory_AvailQuickSlot::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int v4; // r31
  idSWFScriptVar::swfScriptVarValue_t v5; // r28
  idInventoryCollection *v6; // r29

  v4 = 0;
  v5.i = 0;
  v6 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
  while ( idInventoryCollection::GetInventoryItemForQuickSlot(
            this: v6,
            slotGroup: QUICKSLOTGROUP_ITEM,
            slot: v4,
            numSlots: 4) != nullptr )
  {
    if ( ++v4 >= 4 )
      goto LABEL_6;
  }
  v5.i = v4;
LABEL_6:
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v5;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`26'::idSWFScriptFunction_PlayerWeapons_Refresh::AddWeapon
// EA  : 0x82E6D740
// RVA : 0x00E6D740
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall _idPlayer::ShowInventory_::_26_::idSWFScriptFunction_PlayerWeapons_Refresh::AddWeapon(
        idInventoryItem *item,
        idWeapon *index,
        _DWORD *a3)
{
  int *v4; // r26
  _DWORD *v5; // r17
  idWeapon *v6; // r3
  idWeapon *v7; // r24
  const idDeclInventory *decl; // r28
  idSWFScriptObject *v9; // r15
  idMem *listenerList; // r21
  int v11; // r23
  int v12; // r29
  idSWFScriptObject *v13; // r30
  int v14; // r27
  char *IconName; // r3
  idSWFScriptVar::swfScriptVarValue_t v16; // r27
  idJobManager *v17; // r3
  idJob *JobByDecl; // r27
  const idAmmoItem *LoadedAmmo; // r3
  idSWFScriptVar::swfScriptVarValue_t *v20; // r27
  int v21; // r26
  const idAmmoItem *v22; // r3
  int v23; // r3
  bool v24; // zf
  bool IsInventoryItemNew; // r27
  idSWFScriptFunction *v26; // r3
  idSWFScriptFunction *v27; // r4
  idList<idEventReceiver *,5> *listeningToList; // r10
  void *(__fastcall **v29)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r9
  idSWFScriptFunction_vtbl *v30; // r8
  const idAmmoItem *v31; // r3
  int v32; // r9
  const idDeclInventory *v33; // r8
  bool v34; // r27
  idSWFScriptObject *v36; // r29
  int v37; // r27
  idJobManager *v38; // r23
  int v39; // r24
  int v40; // r26
  idJob *InventoryItemByDeclName; // r30
  idSWFScriptObject *v42; // r21
  char *v43; // r3
  idSWFScriptObject *v44; // r30
  bool v45; // r27
  idSWFScriptFunction *v47; // r3
  int v48; // r11
  idSWFScriptFunction *v49; // r4
  idList<idEventReceiver *,5> *v50; // r10
  void *(__fastcall **v51)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r9
  idSWFScriptVar::swfScriptVarValue_t *DisplayName; // r3
  idSWFScriptVar::swfScriptVarValue_t v53; // r29
  idSWFScriptVar::swfScriptVarValue_t v54; // r29
  int v55; // r11
  const char *v56; // r4
  idInventoryItem_vtbl *v57; // r11
  void (__fastcall *OnClone)(idInventoryItem *, const idInventoryItem *); // r10
  idSWFScriptVar *v59; // r3
  idSWFScriptVar::swfScriptVarValue_t v60; // r29
  int v61; // r4
  bool v64; // [sp+50h] [-1B0h]
  idInventoryItem v65; // [sp+54h] [-1ACh] BYREF
  idSWFScriptVar v66; // [sp+80h] [-180h] BYREF
  void *(__fastcall **v67)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // [sp+88h] [-178h]
  idSWFScriptVar v68; // [sp+90h] [-170h] BYREF
  char *v69; // [sp+98h] [-168h]
  idSWFScriptVar v70; // [sp+A0h] [-160h] BYREF
  idSWFScriptVar v71; // [sp+A8h] [-158h] BYREF
  idSWFScriptVar v72; // [sp+B0h] [-150h] BYREF
  const char *v73; // [sp+B8h] [-148h]
  idSWFScriptVar v74; // [sp+C0h] [-140h] BYREF
  idSWFScriptVar v75; // [sp+C8h] [-138h] BYREF
  idSWFScriptVar v76; // [sp+D0h] [-130h] BYREF
  idSWFScriptVar v77; // [sp+D8h] [-128h] BYREF
  idSWFScriptVar v78; // [sp+E0h] [-120h] BYREF
  idSWFScriptVar v79; // [sp+E8h] [-118h] BYREF
  idSWFScriptVar v80; // [sp+F0h] [-110h] BYREF
  idSWFScriptVar v81; // [sp+F8h] [-108h] BYREF
  idSWFScriptVar v82; // [sp+100h] [-100h] BYREF
  idSWFScriptVar v83; // [sp+108h] [-F8h] BYREF
  idSWFScriptVar v84; // [sp+110h] [-F0h] BYREF
  idSWFScriptVar v85; // [sp+118h] [-E8h] BYREF
  idSWFScriptVar v86; // [sp+120h] [-E0h] BYREF
  idSWFScriptVar v87; // [sp+128h] [-D8h] BYREF
  idSWFScriptVar v88; // [sp+130h] [-D0h] BYREF
  idSWFScriptVar v89; // [sp+138h] [-C8h] BYREF
  idSWFScriptVar v90; // [sp+140h] [-C0h] BYREF
  idSWFScriptVar v91; // [sp+148h] [-B8h] BYREF
  idSWFScriptVar v92; // [sp+150h] [-B0h] BYREF
  idSWFScriptVar v93[21]; // [sp+158h] [-A8h] BYREF

  v4 = (int *)index;
  v5 = a3;
  if ( index != nullptr )
  {
    v6 = idWeapon::CastTo(c: index);
    v7 = v6;
    if ( v6 != nullptr )
    {
      decl = v6->decl;
      if ( !decl->isVehicleAmmo )
      {
        v9 = idSWFScriptObject::Alloc();
        idSWFScriptObject::MakeArray(this: v9);
        v64 = false;
        listenerList = &mem;
        v65.listenerList = (idList<idEventReceiver *,5> *)&mem;
        v65.skinPreload = (const idDeclSkins *)"isNewItem";
        v69 = "clearNewItem";
        v67 = &`idPlayer::ShowInventory'::`17'::idSWFScriptFunction_ClearNewItem::`vftable';
        v73 = "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag";
        v65.listeningToList = (idList<idEventReceiver *,5> *)"icon";
        if ( idWeapon::IsMelee(this: v7) )
        {
          v64 = true;
          goto LABEL_24;
        }
        v11 = 0;
        if ( (int)decl[1].nextOnHashChain > 0 )
        {
          v12 = 0;
          while ( 1 )
          {
            v13 = idSWFScriptObject::Alloc();
            v14 = *(_DWORD *)(*(_DWORD *)&decl[1].name.str[v12] + 164);
            v65.decl = (const idDeclInventory *)4;
            idSWFScriptVar::Free(this: (idSWFScriptVar *)&v65.decl);
            v65.count = v14;
            v65.decl = nullptr;
            idSWFScriptObject::Set(this: v13, name: "name", value: (idSWFScriptVar *)&v65.decl);
            idSWFScriptVar::Free(this: (idSWFScriptVar *)&v65.decl);
            IconName = idDeclInventory::GetIconName(this: *(idDeclInventory **)&decl[1].name.str[v12]);
            idSWFScriptVar::idSWFScriptVar(this: &v75, s: IconName);
            idSWFScriptObject::Set(this: v13, name: (char *)v65.listeningToList, value: &v75);
            idSWFScriptVar::Free(this: &v75);
            v16.f = *(float *)(*(_DWORD *)&decl[1].name.str[v12] + 200);
            v71.type = SWF_VAR_UNDEF;
            idSWFScriptVar::Free(this: &v71);
            v71.value = v16;
            v71.type = SWF_VAR_STRINGID;
            idSWFScriptObject::Set(this: v13, name: "desc", value: &v71);
            idSWFScriptVar::Free(this: &v71);
            idSWFScriptVar::idSWFScriptVar(this: &v92, s: *(const char **)(*(_DWORD *)&decl[1].name.str[v12] + 8));
            idSWFScriptObject::Set(this: v13, name: "decl", value: &v92);
            idSWFScriptVar::Free(this: &v92);
            v17 = (idJobManager *)(*((int (__fastcall **)(idList<idEventReceiver *,5> *))item->listeningToList->list
                                   + 117))(a1: item->listeningToList);
            JobByDecl = idJobManager::FindJobByDecl(this: v17, jobDecl: *(const idDeclJob **)&decl[1].name.str[v12]);
            if ( JobByDecl != nullptr )
              break;
            if ( idWeapon::GetLoadedAmmo(this: v7, secondaryAmmo: false)->decl == *(const idDeclInventory **)&decl[1].name.str[v12] )
            {
              LoadedAmmo = idWeapon::GetLoadedAmmo(this: v7, secondaryAmmo: false);
              v20 = (idSWFScriptVar::swfScriptVarValue_t *)LoadedAmmo->GetCount(this: LoadedAmmo);
              idSWFScriptVar::idSWFScriptVar(this: &v78, i: v20);
              idSWFScriptObject::Set(this: v13, name: "count", value: &v78);
              idSWFScriptVar::Free(this: &v78);
              if ( (int)v20 > 0 )
                goto LABEL_15;
            }
            else
            {
              idSWFScriptVar::idSWFScriptVar(this: &v86, i: nullptr);
              idSWFScriptObject::Set(this: v13, name: "count", value: &v86);
              idSWFScriptVar::Free(this: &v86);
            }
LABEL_16:
            IsInventoryItemNew = idPlayer::IsInventoryItemNew(
                                   this: (idPlayer *)item->listeningToList,
                                   decl: *(const idDeclInventory **)&decl[1].name.str[v12]);
            v26 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                           this: (idMem *)v65.listenerList,
                                           location: v73,
                                           size: 0x10u,
                                           tag: TAG_SWF,
                                           zeroBuffer: false,
                                           align: ALIGN_16,
                                           heap: HEAP_DEFAULTHEAP);
            if ( v26 != nullptr )
            {
              v27 = v26;
              listeningToList = item->listeningToList;
              v29 = v67;
              v30 = *(idSWFScriptFunction_vtbl **)&decl[1].name.str[v12];
              v26[1].__vftable = nullptr;
              v26->__vftable = (idSWFScriptFunction_vtbl *)v29;
              v26[2].__vftable = (idSWFScriptFunction_vtbl *)listeningToList;
              v26[3].__vftable = v30;
            }
            else
            {
              v27 = nullptr;
            }
            idSWFScriptVar::idSWFScriptVar(this: &v90, nf: v27);
            idSWFScriptObject::Set(this: v13, name: v69, value: &v90);
            idSWFScriptVar::Free(this: &v90);
            *(_DWORD *)&v65.forSale = 4;
            idSWFScriptVar::Free(this: (idSWFScriptVar *)&v65.forSale);
            HIBYTE(v65.quickSlot) = IsInventoryItemNew;
            *(_DWORD *)&v65.forSale = 5;
            idSWFScriptObject::Set(this: v13, name: (char *)v65.skinPreload, value: (idSWFScriptVar *)&v65.forSale);
            idSWFScriptVar::Free(this: (idSWFScriptVar *)&v65.forSale);
            v31 = idWeapon::GetLoadedAmmo(this: v7, secondaryAmmo: false);
            v32 = *(_DWORD *)&decl[1].name.str[v12];
            v33 = v31->decl;
            v65.counttosave = 4;
            v34 = (_cntlzw(v32 - (_DWORD)v33) & 0x20) != 0;
            idSWFScriptVar::Free(this: (idSWFScriptVar *)&v65.counttosave);
            HIBYTE(v65.coolDownTime) = v34;
            v65.counttosave = 5;
            idSWFScriptObject::Set(this: v13, name: "selected", value: (idSWFScriptVar *)&v65.counttosave);
            idSWFScriptVar::Free(this: (idSWFScriptVar *)&v65.counttosave);
            idSWFScriptVar::idSWFScriptVar(this: &v82, o: v13);
            idSWFScriptObject::Set(this: v9, index: v11, value: &v82);
            idSWFScriptVar::Free(this: &v82);
            if ( v13->refCount-- == 1 )
            {
              idSWFScriptObject::~idSWFScriptObject(this: v13);
              idMem::Free(this: (idMem *)v65.listenerList, ptr: v13, align: ALIGN_16);
            }
            ++v11;
            v12 += 28;
            if ( v11 >= (int)decl[1].nextOnHashChain )
            {
              v5 = a3;
              listenerList = (idMem *)v65.listenerList;
              goto LABEL_24;
            }
          }
          v21 = 0;
          if ( idWeapon::GetLoadedAmmo(this: v7, secondaryAmmo: false)->decl == *(const idDeclInventory **)&decl[1].name.str[v12] )
          {
            v22 = idWeapon::GetLoadedAmmo(this: v7, secondaryAmmo: false);
            v21 = v22->GetCount(this: v22);
          }
          v23 = ((int (__fastcall *)(idJob *))JobByDecl->__vftable[2].dtr_idClass)(a1: JobByDecl);
          idSWFScriptVar::idSWFScriptVar(this: &v80, i: (idSWFScriptVar::swfScriptVarValue_t *)(v23 + v21));
          idSWFScriptObject::Set(this: v13, name: "count", value: &v80);
          idSWFScriptVar::Free(this: &v80);
          v24 = ((int (__fastcall *)(idJob *))JobByDecl->__vftable[2].dtr_idClass)(a1: JobByDecl) + v21 <= 0;
          v4 = (int *)index;
          if ( v24 )
            goto LABEL_16;
LABEL_15:
          v64 = true;
          goto LABEL_16;
        }
LABEL_24:
        v36 = idSWFScriptObject::Alloc();
        idSWFScriptObject::MakeArray(this: v36);
        v37 = 0;
        if ( (int)decl[3].nextOnHashChain > 0 )
        {
          v38 = (idJobManager *)(*((int (__fastcall **)(idList<idEventReceiver *,5> *))item->listeningToList->list + 117))(a1: item->listeningToList);
          if ( v38 != nullptr )
          {
            v39 = 0;
            if ( (int)decl[3].nextOnHashChain > 0 )
            {
              v40 = 0;
              do
              {
                InventoryItemByDeclName = idInventoryCollection::FindInventoryItemByDeclName(
                                            this: v38,
                                            jobName: *(const char **)&decl[3].name.str[v40 + 4]);
                if ( InventoryItemByDeclName != nullptr )
                {
                  v42 = idSWFScriptObject::Alloc();
                  v65.__vftable = *(idInventoryItem_vtbl **)&InventoryItemByDeclName->decl->readyRewards.granularity;
                  idSWFScriptVar::idSWFScriptVar(this: &v88, s: (idStrId *)&v65);
                  idSWFScriptObject::Set(this: v42, name: "name", value: &v88);
                  idSWFScriptVar::Free(this: &v88);
                  v65.__vftable = (idInventoryItem_vtbl *)InventoryItemByDeclName->decl->acceptedMiniMapTravelEnt.list;
                  idSWFScriptVar::idSWFScriptVar(this: &v84, s: (idStrId *)&v65);
                  idSWFScriptObject::Set(this: v42, name: "desc", value: &v84);
                  idSWFScriptVar::Free(this: &v84);
                  v43 = idDeclInventory::GetIconName(this: (idDeclInventory *)InventoryItemByDeclName->decl);
                  idSWFScriptVar::idSWFScriptVar(this: &v76, s: v43);
                  idSWFScriptObject::Set(this: v42, name: (char *)v65.listeningToList, value: &v76);
                  idSWFScriptVar::Free(this: &v76);
                  idSWFScriptVar::idSWFScriptVar(this: &v77, o: v42);
                  idSWFScriptObject::Set(this: v36, index: v37++, value: &v77);
                  idSWFScriptVar::Free(this: &v77);
                  idSWFScriptObject::Release(this: v42);
                }
                ++v39;
                v40 += 32;
              }
              while ( v39 < (int)decl[3].nextOnHashChain );
              v4 = (int *)index;
              v5 = a3;
              listenerList = (idMem *)v65.listenerList;
            }
          }
        }
        v44 = idSWFScriptObject::Alloc();
        v45 = idPlayer::IsInventoryItemNew(
                this: (idPlayer *)item->listeningToList,
                decl: (const idDeclInventory *)v4[3]);
        idSWFScriptVar::idSWFScriptVar(this: &v79, o: v36);
        idSWFScriptObject::Set(this: v44, name: "upgrades", value: &v79);
        idSWFScriptVar::Free(this: &v79);
        if ( v36->refCount-- == 1 )
        {
          idSWFScriptObject::~idSWFScriptObject(this: v36);
          idMem::Free(this: listenerList, ptr: v36, align: ALIGN_16);
        }
        v66.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v66);
        v66.type = SWF_VAR_BOOL;
        v66.value.b = v64;
        idSWFScriptObject::Set(this: v44, name: "hasAmmo", value: &v66);
        idSWFScriptVar::Free(this: &v66);
        v47 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                       this: listenerList,
                                       location: v73,
                                       size: 0x10u,
                                       tag: TAG_SWF,
                                       zeroBuffer: false,
                                       align: ALIGN_16,
                                       heap: HEAP_DEFAULTHEAP);
        if ( v47 != nullptr )
        {
          v48 = v4[3];
          v49 = v47;
          v50 = item->listeningToList;
          v51 = v67;
          v47[1].__vftable = nullptr;
          v47[3].__vftable = (idSWFScriptFunction_vtbl *)v48;
          v47[2].__vftable = (idSWFScriptFunction_vtbl *)v50;
          v47->__vftable = (idSWFScriptFunction_vtbl *)v51;
        }
        else
        {
          v49 = nullptr;
        }
        idSWFScriptVar::idSWFScriptVar(this: &v81, nf: v49);
        idSWFScriptObject::Set(this: v44, name: v69, value: &v81);
        idSWFScriptVar::Free(this: &v81);
        v68.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v68);
        v68.value.b = v45;
        v68.type = SWF_VAR_BOOL;
        idSWFScriptObject::Set(this: v44, name: (char *)v65.skinPreload, value: &v68);
        idSWFScriptVar::Free(this: &v68);
        DisplayName = (idSWFScriptVar::swfScriptVarValue_t *)idInventoryItem::GetDisplayName(
                                                               this: &v65,
                                                               result: (idStrId *)v4);
        v70.type = SWF_VAR_UNDEF;
        v53.f = DisplayName->f;
        idSWFScriptVar::Free(this: &v70);
        v70.value = v53;
        v70.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v44, name: "name", value: &v70);
        idSWFScriptVar::Free(this: &v70);
        idSWFScriptVar::idSWFScriptVar(this: &v83, s: decl->name.str);
        idSWFScriptObject::Set(this: v44, name: "decl", value: &v83);
        idSWFScriptVar::Free(this: &v83);
        v54.f = *(float *)(v4[3] + 200);
        v72.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v72);
        v72.value = v54;
        v72.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v44, name: "description", value: &v72);
        idSWFScriptVar::Free(this: &v72);
        v55 = *(_DWORD *)(v4[3] + 212);
        v56 = &byte_8200D768;
        if ( v55 != 0 )
          v56 = *(const char **)(v55 + 8);
        idSWFScriptVar::idSWFScriptVar(this: &v85, s: v56);
        idSWFScriptObject::Set(this: v44, name: (char *)v65.listeningToList, value: &v85);
        idSWFScriptVar::Free(this: &v85);
        v57 = (idInventoryItem_vtbl *)v4[3];
        OnClone = v57[2].OnClone;
        v65.__vftable = v57;
        if ( OnClone != nullptr )
        {
          v65.__vftable = v57;
          idSWFScriptVar::idSWFScriptVar(this: &v87, s: *((const char **)OnClone + 2));
          idSWFScriptObject::Set(this: v44, name: "largeIcon", value: &v87);
          v59 = &v87;
        }
        else
        {
          idSWFScriptVar::idSWFScriptVar(this: &v89, s: &byte_8200D768);
          idSWFScriptObject::Set(this: v44, name: "largeIcon", value: &v89);
          v59 = &v89;
        }
        idSWFScriptVar::Free(this: v59);
        v74.type = SWF_VAR_UNDEF;
        v60.i = v4[6];
        idSWFScriptVar::Free(this: &v74);
        v74.value = v60;
        v74.type = SWF_VAR_INTEGER;
        idSWFScriptObject::Set(this: v44, name: "quickslot", value: &v74);
        idSWFScriptVar::Free(this: &v74);
        idSWFScriptVar::idSWFScriptVar(this: &v91, o: v9);
        idSWFScriptObject::Set(this: v44, name: "ammo", value: &v91);
        idSWFScriptVar::Free(this: &v91);
        idSWFScriptVar::idSWFScriptVar(this: v93, o: v44);
        v61 = (*v5)++;
        idSWFScriptObject::Set(this: (idSWFScriptObject *)item->decl, index: v61, value: v93);
        idSWFScriptVar::Free(this: v93);
        if ( v9->refCount-- == 1 )
        {
          idSWFScriptObject::~idSWFScriptObject(this: v9);
          idMem::Free(this: listenerList, ptr: v9, align: ALIGN_16);
        }
        if ( v44->refCount-- == 1 )
        {
          idSWFScriptObject::~idSWFScriptObject(this: v44);
          idMem::Free(this: listenerList, ptr: v44, align: ALIGN_16);
        }
      }
    }
  }
}


// ========================================================================
// __unwind$536859
// EA  : 0x82E6E0AC
// RVA : 0x00E6E0AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536859()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 96));
}


// ========================================================================
// __unwind$536860
// EA  : 0x82E6E0D4
// RVA : 0x00E6E0D4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536860()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 200));
}


// ========================================================================
// __unwind$536861
// EA  : 0x82E6E0FC
// RVA : 0x00E6E0FC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536861()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 168));
}


// ========================================================================
// __unwind$536862
// EA  : 0x82E6E124
// RVA : 0x00E6E124
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536862()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 336));
}


// ========================================================================
// __unwind$536863
// EA  : 0x82E6E14C
// RVA : 0x00E6E14C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536863()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 224));
}


// ========================================================================
// __unwind$536864
// EA  : 0x82E6E174
// RVA : 0x00E6E174
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536864()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 288));
}


// ========================================================================
// __unwind$536865
// EA  : 0x82E6E19C
// RVA : 0x00E6E19C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536865()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 240));
}


// ========================================================================
// __unwind$536867_0
// EA  : 0x82E6E1C4
// RVA : 0x00E6E1C4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536867_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 320));
}


// ========================================================================
// __unwind$536868
// EA  : 0x82E6E1EC
// RVA : 0x00E6E1EC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536868()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 104));
}


// ========================================================================
// __unwind$536869
// EA  : 0x82E6E214
// RVA : 0x00E6E214
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536869()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 112));
}


// ========================================================================
// __unwind$536870
// EA  : 0x82E6E23C
// RVA : 0x00E6E23C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536870()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 256));
}


// ========================================================================
// __unwind$536871
// EA  : 0x82E6E264
// RVA : 0x00E6E264
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536871()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 304));
}


// ========================================================================
// __unwind$536872
// EA  : 0x82E6E28C
// RVA : 0x00E6E28C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536872()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 272));
}


// ========================================================================
// __unwind$536873
// EA  : 0x82E6E2B4
// RVA : 0x00E6E2B4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536873()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 208));
}


// ========================================================================
// __unwind$536874
// EA  : 0x82E6E2DC
// RVA : 0x00E6E2DC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536874()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 216));
}


// ========================================================================
// __unwind$536875
// EA  : 0x82E6E304
// RVA : 0x00E6E304
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536875()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 232));
}


// ========================================================================
// __unwind$536876
// EA  : 0x82E6E32C
// RVA : 0x00E6E32C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536876()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 128));
}


// ========================================================================
// __unwind$536878
// EA  : 0x82E6E354
// RVA : 0x00E6E354
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536878()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 248));
}


// ========================================================================
// __unwind$536879
// EA  : 0x82E6E37C
// RVA : 0x00E6E37C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536879()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 144));
}


// ========================================================================
// __unwind$536880
// EA  : 0x82E6E3A4
// RVA : 0x00E6E3A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536880()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 160));
}


// ========================================================================
// __unwind$536881
// EA  : 0x82E6E3CC
// RVA : 0x00E6E3CC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536881()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 264));
}


// ========================================================================
// __unwind$536882
// EA  : 0x82E6E3F4
// RVA : 0x00E6E3F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536882()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 176));
}


// ========================================================================
// __unwind$536883
// EA  : 0x82E6E41C
// RVA : 0x00E6E41C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536883()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 280));
}


// ========================================================================
// __unwind$536884
// EA  : 0x82E6E444
// RVA : 0x00E6E444
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536884()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 296));
}


// ========================================================================
// __unwind$536885
// EA  : 0x82E6E46C
// RVA : 0x00E6E46C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536885()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 312));
}


// ========================================================================
// __unwind$536886
// EA  : 0x82E6E494
// RVA : 0x00E6E494
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536886()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 192));
}


// ========================================================================
// __unwind$536887_0
// EA  : 0x82E6E4BC
// RVA : 0x00E6E4BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536887_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 328));
}


// ========================================================================
// __unwind$536888
// EA  : 0x82E6E4E4
// RVA : 0x00E6E4E4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_536888()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 512 + 344));
}


// ========================================================================
// `idPlayer::ShowInventory'::`31'::idSWFScriptFunction_GetActiveJob::Call
// EA  : 0x82E6E510
// RVA : 0x00E6E510
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_31_::idSWFScriptFunction_GetActiveJob::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int num; // r11
  bfx::Planner3D *v4; // r28
  char *v7; // r26
  idSWFScriptVar::swfScriptVarValue_t v8; // r22
  int v9; // r29
  int v10; // r27
  int v11; // r25
  _exception *v12; // r3
  char *v14; // r30
  idJob *JobByIndex; // r3
  idJob *v16; // r31
  missionStatus_t status; // r11
  char v18; // r11
  bool v19; // zf

  num = thisObject->variables.num;
  v4 = (bfx::Planner3D *)(num + 12412);
  v7 = *(char **)(num + 12536);
  v8.i = -1;
  v9 = -1;
  v10 = -1;
  v11 = 0;
  v12 = (_exception *)(num + 12412);
  if ( v7 == (char *)-1 )
  {
    if ( (unsigned __int8)idLobbyBackend360::StartArbitration(pexcept: v12) != 0 )
    {
      result->type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: result);
      result->value.i = 0;
      result->type = SWF_VAR_INTEGER;
      return result;
    }
  }
  else
  {
    v9 = ((unsigned __int8)idLobbyBackend360::StartArbitration(pexcept: v12) != 0) - 1;
  }
  v14 = (char *)&idScriptObject::GetTypeDef(this: v4)[-1].m_components.m_tag + 3;
  if ( (int)v14 < 0 )
    goto LABEL_20;
  while ( 1 )
  {
    JobByIndex = idJobManager::GetJobByIndex(this: (idJobManager *)v4, index: (int)v14);
    v16 = JobByIndex;
    if ( JobByIndex != nullptr && (unsigned __int8)idDeclJob::IsQuestJob(this: JobByIndex->decl) != 0 )
    {
      status = v16->status;
      if ( status == JOBSTATUS_READYTOTURNIN || (v19 = status != JOBSTATUS_ACCEPTED, v18 = 0, !v19) )
        v18 = 1;
      if ( v18 == 0 )
        goto LABEL_15;
      ++v9;
      if ( v7 == v14 )
        break;
      if ( v10 == -1 )
      {
        v10 = v9;
        v11 = (int)v14;
      }
    }
LABEL_15:
    if ( (int)--v14 < 0 )
      goto LABEL_18;
  }
  v8.i = v9;
  if ( v9 == -1 )
  {
LABEL_18:
    if ( v10 != -1 )
    {
      v8.i = v10;
      idJobManager::SetActiveJobIndex(
        this: (idJobManager *)(thisObject->variables.num + 12412),
        jobIndex: v11,
        checkImportance: false);
    }
  }
LABEL_20:
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v8;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`32'::idSWFScriptFunciton_MarkJobNoticed::Call
// EA  : 0x82E6E6A0
// RVA : 0x00E6E6A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_32_::idSWFScriptFunciton_MarkJobNoticed::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idJob::MarkJobNotesSeenInInv(this: (idJob *)thisObject->variables.num);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->type = SWF_VAR_BOOL;
  result->value.b = true;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`33'::idSWFScriptFunciton_MarkJobSeen::Call
// EA  : 0x82E6E6F8
// RVA : 0x00E6E6F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_33_::idSWFScriptFunciton_MarkJobSeen::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  *(_BYTE *)(thisObject->variables.num + 28) = 1;
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value.b = true;
  result->type = SWF_VAR_BOOL;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`36'::idSWFScriptFunction_PlayerInventory_GetVehicleCash::Call
// EA  : 0x82E6E750
// RVA : 0x00E6E750
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_36_::idSWFScriptFunction_PlayerInventory_GetVehicleCash::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idSWFScriptVar::swfScriptVarValue_t v4; // r30

  v4.i = idPlayer::GetVehicleCash(this: (idPlayer *)thisObject->variables.num);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v4;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::ShowInventory'::`37'::idSWFScriptFunction_PlayerSchematics_Refresh::Call
// EA  : 0x82E6E7B8
// RVA : 0x00E6E7B8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_37_::idSWFScriptFunction_PlayerSchematics_Refresh::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idSWFScriptVar *v3; // r29
  idInventoryCollection *v5; // r3
  const char *v6; // r25
  idInventoryItem *InventoryItem; // r3
  idInventoryItem *v8; // r15
  const idDeclInventory *decl; // r20
  _DWORD *v10; // r26
  int index; // r16
  const idDeclInventory *v12; // r21
  idSWFScriptObject *v13; // r17
  int v14; // r11
  int v15; // r27
  bool v16; // r24
  int v17; // r23
  int v18; // r22
  int v19; // r25
  int v20; // r28
  int v21; // r30
  idSWFScriptObject *v22; // r29
  char *IconName; // r3
  const idDeclInventory *v24; // r28
  idInventoryCollection *v25; // r3
  int TotalInventoryItemCount; // r28
  __int64 v27; // r6
  __int64 v28; // r10
  __int64 v29; // r8
  va *v30; // r3
  signed int v31; // r10
  int v32; // r11
  idInventoryCollection *v33; // r3
  idSWFScriptVar::swfScriptVarValue_t *v34; // r28
  idSWFScriptObject *v35; // r30
  const idMaterial *engineeringIcon; // r11
  idSWFScriptVar *v37; // r3
  bool IsInventoryItemNew; // r3
  idMem *v39; // r26
  bool v40; // r29
  idSWFScriptFunction *v41; // r3
  int num; // r11
  idSWFScriptFunction *v43; // r4
  void *(__fastcall **v44)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r10
  const char *str; // r4
  const idMaterial *icon; // r11
  idSWFScriptFunction *v47; // r3
  int v48; // r11
  idSWFScriptFunction *v49; // r4
  void *(__fastcall **v50)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r10
  idSWFScriptFunction *v51; // r29
  int v52; // r3
  int v53; // r3
  void *(__fastcall **v54)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // r11
  idSWFScriptFunction *v55; // r4
  int v56; // r29
  int v58; // [sp+8h] [-1238h]
  int v59; // [sp+Ch] [-1234h]
  int v60; // [sp+10h] [-1230h]
  int v61; // [sp+14h] [-122Ch]
  int v62; // [sp+18h] [-1228h]
  int v63; // [sp+1Ch] [-1224h]
  idStrId v64; // [sp+50h] [-11F0h] BYREF
  bool v65; // [sp+54h] [-11ECh]
  int v66; // [sp+58h] [-11E8h]
  char *v67; // [sp+5Ch] [-11E4h]
  int v68; // [sp+60h] [-11E0h]
  char *v69; // [sp+64h] [-11DCh]
  char *v70; // [sp+68h] [-11D8h]
  char *v71; // [sp+6Ch] [-11D4h]
  const char *v72; // [sp+70h] [-11D0h]
  idSWFScriptVar v73; // [sp+78h] [-11C8h] BYREF
  idSWFScriptVar v74; // [sp+80h] [-11C0h] BYREF
  char *v75; // [sp+88h] [-11B8h]
  const char *v76; // [sp+8Ch] [-11B4h]
  char *v77; // [sp+90h] [-11B0h]
  idMem *v78; // [sp+94h] [-11ACh]
  char *v79; // [sp+98h] [-11A8h]
  char *v80; // [sp+9Ch] [-11A4h]
  void *(__fastcall **v81)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // [sp+A0h] [-11A0h]
  char *v82; // [sp+A4h] [-119Ch]
  char *v83; // [sp+A8h] [-1198h]
  char *v84; // [sp+ACh] [-1194h]
  void *(__fastcall **v85)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // [sp+B0h] [-1190h]
  void *(__fastcall **v86)(idSWF::idSWFScriptFunction_floor *__hidden, unsigned int); // [sp+B4h] [-118Ch]
  char *v87; // [sp+B8h] [-1188h]
  char *v88; // [sp+BCh] [-1184h]
  idInventoryCollection *v89; // [sp+C0h] [-1180h]
  char *v90; // [sp+C4h] [-117Ch]
  char *v91; // [sp+C8h] [-1178h]
  char *v92; // [sp+CCh] [-1174h]
  const char *v93; // [sp+D0h] [-1170h]
  idSWFScriptVar v94; // [sp+D8h] [-1168h] BYREF
  idSWFScriptVar v95; // [sp+E0h] [-1160h] BYREF
  idSWFScriptVar v96; // [sp+E8h] [-1158h] BYREF
  idSWFScriptVar v97; // [sp+F0h] [-1150h] BYREF
  idSWFScriptVar v98; // [sp+F8h] [-1148h] BYREF
  idSWFScriptVar v99; // [sp+100h] [-1140h] BYREF
  idSWFScriptVar v100; // [sp+108h] [-1138h] BYREF
  idSWFScriptVar v101; // [sp+110h] [-1130h] BYREF
  idSWFScriptVar v102; // [sp+118h] [-1128h] BYREF
  idSWFScriptVar v103; // [sp+120h] [-1120h] BYREF
  idSWFScriptVar v104; // [sp+128h] [-1118h] BYREF
  idSWFScriptVar v105; // [sp+130h] [-1110h] BYREF
  idSWFScriptVar v106; // [sp+138h] [-1108h] BYREF
  idSWFScriptVar v107; // [sp+140h] [-1100h] BYREF
  idSWFScriptVar v108; // [sp+148h] [-10F8h] BYREF
  idSWFScriptVar v109; // [sp+150h] [-10F0h] BYREF
  idSWFScriptVar v110; // [sp+158h] [-10E8h] BYREF
  idSWFScriptVar v111; // [sp+160h] [-10E0h] BYREF
  idSWFScriptVar v112; // [sp+168h] [-10D8h] BYREF
  idSWFScriptVar v113; // [sp+170h] [-10D0h] BYREF
  idSWFScriptVar v114; // [sp+178h] [-10C8h] BYREF
  idSWFScriptVar v115; // [sp+180h] [-10C0h] BYREF
  idSWFScriptVar v116; // [sp+188h] [-10B8h] BYREF
  idSWFScriptVar v117[2]; // [sp+190h] [-10B0h] BYREF
  va v118; // [sp+1A0h] [-10A0h] BYREF

  v3 = result;
  v73.type = SWF_VAR_UNDEF;
  v67 = nullptr;
  idSWFScriptVar::Free(this: &v73);
  v73.value.i = 0;
  v73.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "length", value: &v73);
  idSWFScriptVar::Free(this: &v73);
  v5 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
  v89 = v5;
  if ( v5 != nullptr )
  {
    v68 = 0;
    v66 = (int)&idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v5)[-1].m_components.m_tag + 3;
    if ( v66 >= 0 )
    {
      v85 = &`idPlayer::ShowInventory'::`16'::idSWFScriptFunction_Use::`vftable';
      v86 = &`idPlayer::ShowInventory'::`17'::idSWFScriptFunction_ClearNewItem::`vftable';
      v79 = "ingredients";
      v81 = &`idPlayer::ShowInventory'::`14'::idSWFScriptFunction_CanUse::`vftable';
      v78 = &mem;
      v6 = "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag";
      v76 = "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag";
      v71 = "largeIcon";
      v67 = "maxed";
      v87 = "use";
      v83 = "canUse";
      v92 = "canBuild";
      v77 = "description";
      v69 = "countMet";
      v75 = "perkDesc";
      v84 = "prodDesc";
      v88 = "decl";
      v82 = "makeCount";
      v90 = "isNewItem";
      v80 = "clearNewItem";
      v72 = &byte_8200D768;
      v93 = "%d/%d";
      v91 = "desc";
      v70 = "icon";
      do
      {
        InventoryItem = idInventoryCollection::GetInventoryItem(this: v89, index: v66);
        v8 = InventoryItem;
        if ( InventoryItem != nullptr )
        {
          decl = InventoryItem->decl;
          if ( decl->recipe != nullptr && decl->playerCanSeeInInventory && !decl->isContainer )
          {
            v64.index = (int)InventoryItem->decl;
            v10 = &decl->recipe->__vftable;
            index = decl->description.index;
            v12 = (const idDeclInventory *)v10[16];
            if ( v12 != nullptr )
            {
              v13 = idSWFScriptObject::Alloc();
              idSWFScriptObject::MakeArray(this: v13);
              v15 = 0;
              v16 = true;
              v17 = 0;
              v18 = -1;
              v64.index = v10[23];
              v14 = v64.index;
              v65 = false;
              if ( v64.index > 0 )
              {
                v19 = 0;
                do
                {
                  v20 = 0;
                  if ( v15 >= 0 )
                  {
                    v64.index = v14;
                    if ( v15 <= v14 )
                    {
                      v21 = v10[22] + v19;
                      if ( v21 != 0 && *(_DWORD *)v21 != 0 )
                      {
                        v22 = idSWFScriptObject::Alloc();
                        IconName = idDeclInventory::GetIconName(this: *(idDeclInventory **)v21);
                        idSWFScriptVar::idSWFScriptVar(this: &v97, s: IconName);
                        idSWFScriptObject::Set(this: v22, name: v70, value: &v97);
                        idSWFScriptVar::Free(this: &v97);
                        v64.index = *(_DWORD *)(*(_DWORD *)v21 + 200);
                        idSWFScriptVar::idSWFScriptVar(this: &v107, s: &v64);
                        idSWFScriptObject::Set(this: v22, name: v91, value: &v107);
                        idSWFScriptVar::Free(this: &v107);
                        v64.index = *(_DWORD *)(*(_DWORD *)v21 + 164);
                        idSWFScriptVar::idSWFScriptVar(this: &v94, s: &v64);
                        idSWFScriptObject::Set(this: v22, name: "name", value: &v94);
                        idSWFScriptVar::Free(this: &v94);
                        v24 = *(const idDeclInventory **)v21;
                        v25 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num
                                                                                  + 468))(a1: thisObject->variables.num);
                        TotalInventoryItemCount = idInventoryCollection::FindTotalInventoryItemCount(
                                                    this: v25,
                                                    decl: v24);
                        HIDWORD(v27) = TotalInventoryItemCount;
                        LODWORD(v27) = *(_DWORD *)(v21 + 4);
                        v30 = va::va(
                                this: &v118,
                                fmt: v93,
                                a3: v27,
                                a4: v29,
                                a5: v28,
                                a6: v58,
                                a7: v59,
                                a8: v60,
                                a9: v61,
                                a10: v62,
                                a11: v63);
                        v74.type = SWF_VAR_UNDEF;
                        idSWFScriptVar::SetString(this: &v74, s: v30);
                        idSWFScriptObject::Set(this: v22, name: "count", value: &v74);
                        idSWFScriptVar::Free(this: &v74);
                        if ( TotalInventoryItemCount >= *(_DWORD *)(v21 + 4) )
                        {
                          idSWFScriptVar::idSWFScriptVar(this: &v99, b: true);
                          idSWFScriptObject::Set(this: v22, name: v69, value: &v99);
                          idSWFScriptVar::Free(this: &v99);
                          v31 = *(_DWORD *)(v21 + 4);
                          v32 = __ROL4__(TotalInventoryItemCount, 1) - 1;
                          v20 = TotalInventoryItemCount / v31;
                          __twllei(v31, 0);
                          __twlgei(v31 & ~v32, 0xFFFFFFFF);
                        }
                        else
                        {
                          idSWFScriptVar::idSWFScriptVar(this: &v113, b: false);
                          idSWFScriptObject::Set(this: v22, name: v69, value: &v113);
                          idSWFScriptVar::Free(this: &v113);
                          v16 = false;
                          v20 = 0;
                        }
                        idSWFScriptVar::idSWFScriptVar(this: &v109, o: v22);
                        idSWFScriptObject::Set(this: v13, index: v17, value: &v109);
                        idSWFScriptVar::Free(this: &v109);
                        idSWFScriptObject::Release(this: v22);
                        ++v17;
                      }
                    }
                  }
                  if ( v20 < v18 || v18 == -1 )
                    v18 = v20;
                  ++v15;
                  v19 += 12;
                  v64.index = v10[23];
                  v14 = v64.index;
                }
                while ( v15 < v64.index );
                v6 = v76;
              }
              v33 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
              v34 = (idSWFScriptVar::swfScriptVarValue_t *)idInventoryCollection::FindTotalInventoryItemCount(
                                                             this: v33,
                                                             decl: v12);
              if ( (int)&v34->f + 1 >= v12->maxCount )
              {
                v16 = false;
                v65 = true;
              }
              v35 = idSWFScriptObject::Alloc();
              idSWFScriptVar::idSWFScriptVar(this: &v101, b: v16);
              idSWFScriptObject::Set(this: v35, name: v92, value: &v101);
              idSWFScriptVar::Free(this: &v101);
              engineeringIcon = decl->engineeringIcon;
              if ( engineeringIcon != nullptr )
              {
                idSWFScriptVar::idSWFScriptVar(this: &v103, s: engineeringIcon->name.str);
                idSWFScriptObject::Set(this: v35, name: v71, value: &v103);
                v37 = &v103;
              }
              else
              {
                idSWFScriptVar::idSWFScriptVar(this: v117, s: v72);
                idSWFScriptObject::Set(this: v35, name: v71, value: v117);
                v37 = v117;
              }
              idSWFScriptVar::Free(this: v37);
              IsInventoryItemNew = idPlayer::IsInventoryItemNew(this: (idPlayer *)thisObject->variables.num, decl);
              v39 = v78;
              v40 = IsInventoryItemNew;
              v41 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                             this: v78,
                                             location: v6,
                                             size: 0x10u,
                                             tag: TAG_SWF,
                                             zeroBuffer: false,
                                             align: ALIGN_16,
                                             heap: HEAP_DEFAULTHEAP);
              if ( v41 != nullptr )
              {
                num = thisObject->variables.num;
                v43 = v41;
                v44 = v86;
                v41[3].__vftable = (idSWFScriptFunction_vtbl *)decl;
                v41[1].__vftable = nullptr;
                v41[2].__vftable = (idSWFScriptFunction_vtbl *)num;
                v41->__vftable = (idSWFScriptFunction_vtbl *)v44;
              }
              else
              {
                v43 = nullptr;
              }
              idSWFScriptVar::idSWFScriptVar(this: &v111, nf: v43);
              idSWFScriptObject::Set(this: v35, name: v80, value: &v111);
              idSWFScriptVar::Free(this: &v111);
              idSWFScriptVar::idSWFScriptVar(this: &v105, b: v40);
              idSWFScriptObject::Set(this: v35, name: v90, value: &v105);
              idSWFScriptVar::Free(this: &v105);
              idSWFScriptVar::idSWFScriptVar(this: &v115, i: v34);
              idSWFScriptObject::Set(this: v35, name: "count", value: &v115);
              idSWFScriptVar::Free(this: &v115);
              idSWFScriptVar::idSWFScriptVar(this: &v95, i: (idSWFScriptVar::swfScriptVarValue_t *)v18);
              idSWFScriptObject::Set(this: v35, name: v82, value: &v95);
              idSWFScriptVar::Free(this: &v95);
              v64.index = v12->displayName.index;
              idSWFScriptVar::idSWFScriptVar(this: &v96, s: &v64);
              idSWFScriptObject::Set(this: v35, name: "name", value: &v96);
              idSWFScriptVar::Free(this: &v96);
              idSWFScriptVar::idSWFScriptVar(this: &v98, s: decl->name.str);
              idSWFScriptObject::Set(this: v35, name: v88, value: &v98);
              idSWFScriptVar::Free(this: &v98);
              v64.index = v12->description.index;
              idSWFScriptVar::idSWFScriptVar(this: &v100, s: &v64);
              idSWFScriptObject::Set(this: v35, name: v84, value: &v100);
              idSWFScriptVar::Free(this: &v100);
              idSWFScriptVar::idSWFScriptVar(this: &v102, i: nullptr);
              idSWFScriptObject::Set(this: v35, name: v75, value: &v102);
              idSWFScriptVar::Free(this: &v102);
              v64.index = index;
              idSWFScriptVar::idSWFScriptVar(this: &v104, s: &v64);
              idSWFScriptObject::Set(this: v35, name: v77, value: &v104);
              idSWFScriptVar::Free(this: &v104);
              idSWFScriptVar::idSWFScriptVar(this: &v106, o: v13);
              idSWFScriptObject::Set(this: v35, name: v79, value: &v106);
              idSWFScriptVar::Free(this: &v106);
              str = v72;
              icon = v8->decl->icon;
              if ( icon != nullptr )
                str = icon->name.str;
              idSWFScriptVar::idSWFScriptVar(this: &v108, s: str);
              idSWFScriptObject::Set(this: v35, name: v70, value: &v108);
              idSWFScriptVar::Free(this: &v108);
              v47 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                             this: v39,
                                             location: v6,
                                             size: 0x10u,
                                             tag: TAG_SWF,
                                             zeroBuffer: false,
                                             align: ALIGN_16,
                                             heap: HEAP_DEFAULTHEAP);
              if ( v47 != nullptr )
              {
                v48 = thisObject->variables.num;
                v49 = v47;
                v50 = v81;
                v47[3].__vftable = (idSWFScriptFunction_vtbl *)v8;
                v47[1].__vftable = nullptr;
                v47[2].__vftable = (idSWFScriptFunction_vtbl *)v48;
                v47->__vftable = (idSWFScriptFunction_vtbl *)v50;
              }
              else
              {
                v49 = nullptr;
              }
              idSWFScriptVar::idSWFScriptVar(this: &v110, nf: v49);
              idSWFScriptObject::Set(this: v35, name: v83, value: &v110);
              idSWFScriptVar::Free(this: &v110);
              v51 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                             this: v39,
                                             location: v6,
                                             size: 0x10u,
                                             tag: TAG_SWF,
                                             zeroBuffer: false,
                                             align: ALIGN_16,
                                             heap: HEAP_DEFAULTHEAP);
              v64.index = (int)v51;
              if ( v51 != nullptr )
              {
                v52 = *(_DWORD *)(thisObject->variables.num + 488);
                if ( v52 != 0 )
                  v53 = (*(int (__fastcall **)(int))(*(_DWORD *)v52 + 104))(a1: v52);
                else
                  v53 = 0;
                v54 = v85;
                v55 = v51;
                v51[2].__vftable = (idSWFScriptFunction_vtbl *)v53;
                v51[3].__vftable = (idSWFScriptFunction_vtbl *)v8;
                v51[1].__vftable = nullptr;
                v51->__vftable = (idSWFScriptFunction_vtbl *)v54;
              }
              else
              {
                v55 = nullptr;
              }
              idSWFScriptVar::idSWFScriptVar(this: &v112, nf: v55);
              idSWFScriptObject::Set(this: v35, name: v87, value: &v112);
              idSWFScriptVar::Free(this: &v112);
              idSWFScriptVar::idSWFScriptVar(this: &v114, b: v65);
              idSWFScriptObject::Set(this: v35, name: v67, value: &v114);
              idSWFScriptVar::Free(this: &v114);
              idSWFScriptVar::idSWFScriptVar(this: &v116, o: v35);
              v56 = v68;
              idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, index: v68, value: &v116);
              v68 = v56 + 1;
              idSWFScriptVar::Free(this: &v116);
              idSWFScriptObject::Release(this: v35);
              idSWFScriptObject::Release(this: v13);
            }
          }
        }
        --v66;
      }
      while ( v66 >= 0 );
      v3 = result;
    }
  }
  v3->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: v3);
  v3->type = SWF_VAR_BOOL;
  v3->value.b = true;
  return v3;
}


// ========================================================================
// __unwind$537816
// EA  : 0x82E6F084
// RVA : 0x00E6F084
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537816()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 120));
}


// ========================================================================
// __unwind$537817
// EA  : 0x82E6F0AC
// RVA : 0x00E6F0AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537817()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 240));
}


// ========================================================================
// __unwind$537818
// EA  : 0x82E6F0D4
// RVA : 0x00E6F0D4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537818()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 320));
}


// ========================================================================
// __unwind$537819
// EA  : 0x82E6F0FC
// RVA : 0x00E6F0FC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537819()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 216));
}


// ========================================================================
// __unwind$537820
// EA  : 0x82E6F124
// RVA : 0x00E6F124
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537820()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 128));
}


// ========================================================================
// __unwind$537821
// EA  : 0x82E6F14C
// RVA : 0x00E6F14C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537821()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 368));
}


// ========================================================================
// __unwind$537822
// EA  : 0x82E6F174
// RVA : 0x00E6F174
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537822()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 256));
}


// ========================================================================
// __unwind$537823
// EA  : 0x82E6F19C
// RVA : 0x00E6F19C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537823()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 336));
}


// ========================================================================
// __unwind$537824
// EA  : 0x82E6F1C4
// RVA : 0x00E6F1C4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537824()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 272));
}


// ========================================================================
// __unwind$537825
// EA  : 0x82E6F1EC
// RVA : 0x00E6F1EC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537825()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 400));
}


// ========================================================================
// __unwind$537826
// EA  : 0x82E6F214
// RVA : 0x00E6F214
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537826()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 288));
}


// ========================================================================
// __unwind$537828
// EA  : 0x82E6F23C
// RVA : 0x00E6F23C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537828()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 352));
}


// ========================================================================
// __unwind$537829
// EA  : 0x82E6F264
// RVA : 0x00E6F264
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537829()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 304));
}


// ========================================================================
// __unwind$537830
// EA  : 0x82E6F28C
// RVA : 0x00E6F28C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537830()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 384));
}


// ========================================================================
// __unwind$537831_0
// EA  : 0x82E6F2B4
// RVA : 0x00E6F2B4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537831_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 224));
}


// ========================================================================
// __unwind$537832
// EA  : 0x82E6F2DC
// RVA : 0x00E6F2DC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537832()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 232));
}


// ========================================================================
// __unwind$537833
// EA  : 0x82E6F304
// RVA : 0x00E6F304
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537833()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 248));
}


// ========================================================================
// __unwind$537834
// EA  : 0x82E6F32C
// RVA : 0x00E6F32C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537834()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 264));
}


// ========================================================================
// __unwind$537835
// EA  : 0x82E6F354
// RVA : 0x00E6F354
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537835()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 280));
}


// ========================================================================
// __unwind$537836
// EA  : 0x82E6F37C
// RVA : 0x00E6F37C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537836()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 296));
}


// ========================================================================
// __unwind$537837
// EA  : 0x82E6F3A4
// RVA : 0x00E6F3A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537837()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 312));
}


// ========================================================================
// __unwind$537838
// EA  : 0x82E6F3CC
// RVA : 0x00E6F3CC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537838()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 328));
}


// ========================================================================
// __unwind$537840
// EA  : 0x82E6F3F4
// RVA : 0x00E6F3F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537840()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 344));
}


// ========================================================================
// __unwind$537841
// EA  : 0x82E6F41C
// RVA : 0x00E6F41C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537841()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 4672 + 80), tag: TAG_SWF);
}


// ========================================================================
// __unwind$537842
// EA  : 0x82E6F448
// RVA : 0x00E6F448
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537842()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 360));
}


// ========================================================================
// __unwind$537843
// EA  : 0x82E6F470
// RVA : 0x00E6F470
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537843()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 376));
}


// ========================================================================
// __unwind$537844
// EA  : 0x82E6F498
// RVA : 0x00E6F498
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_537844()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 4672 + 392));
}


// ========================================================================
// `idPlayer::ShowInventory'::`38'::idSWFScriptFunction_PlayerVehicles_Refresh::Call
// EA  : 0x82E6F4C8
// RVA : 0x00E6F4C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_38_::idSWFScriptFunction_PlayerVehicles_Refresh::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idSWFScriptVar *v3; // r25
  idSWFScriptObject *v4; // r30
  idInventoryCollection *v5; // r26
  int v6; // r14
  int v7; // r29
  idVehicleKey *InventoryItem; // r3
  idStrId *v9; // r27
  idSWFScriptObject *v10; // r24
  idSWFScriptObject *v11; // r23
  int v12; // r25
  int v13; // r26
  _DWORD *v14; // r29
  idSWFScriptObject *v15; // r3
  idSWFScriptVar::swfScriptVarValue_t v16; // r14
  idSWFScriptObject *v17; // r30
  int v18; // r11
  const char *v19; // r4
  const idStr *v20; // r14
  idSWFScriptVar::swfScriptVarValue_t v21; // r29
  idSWFScriptVar::swfScriptVarValue_t *DisplayName; // r3
  idSWFScriptVar::swfScriptVarValue_t v24; // r25
  const char *v25; // r4
  int v26; // r11
  const idStr *v27; // r25
  const char *v28; // r4
  int v29; // r11
  const idStr *v30; // r27
  idSWFScriptVar v34; // [sp+50h] [-180h] BYREF
  idSWFScriptVar v35; // [sp+58h] [-178h] BYREF
  idSWFScriptVar v36; // [sp+60h] [-170h] BYREF
  idSWFScriptVar v37; // [sp+68h] [-168h] BYREF
  idSWFScriptVar v38; // [sp+70h] [-160h] BYREF
  idSWFScriptVar v39; // [sp+78h] [-158h] BYREF
  char *v40; // [sp+80h] [-150h]
  idSWFScriptVar v41; // [sp+88h] [-148h] BYREF
  int v42; // [sp+90h] [-140h]
  idSWFScriptVar v43; // [sp+98h] [-138h] BYREF
  idSWFScriptVar v44; // [sp+A0h] [-130h] BYREF
  int v45; // [sp+A8h] [-128h]
  idSWFScriptVar v46; // [sp+B0h] [-120h] BYREF
  idInventoryCollection *v47; // [sp+B8h] [-118h]
  idSWFScriptObject *v48; // [sp+BCh] [-114h]
  char *v49; // [sp+C0h] [-110h]
  idInventoryItem v50; // [sp+C4h] [-10Ch] BYREF
  idStr v51; // [sp+F0h] [-E0h] BYREF
  idStr v52[6]; // [sp+110h] [-C0h] BYREF

  v3 = result;
  v48 = thisObject;
  v37.type = SWF_VAR_UNDEF;
  v4 = thisObject;
  v40 = nullptr;
  idSWFScriptVar::Free(this: &v37);
  v37.value.i = 0;
  v37.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: (idSWFScriptObject *)v4->variables.size, name: "length", value: &v37);
  idSWFScriptVar::Free(this: &v37);
  v5 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)v4->variables.num + 468))(a1: v4->variables.num);
  v47 = v5;
  v6 = 0;
  v42 = 0;
  v7 = 0;
  v45 = 0;
  if ( (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v5) > 0 )
  {
    v40 = "upgrades";
    v49 = "vehIcon";
    do
    {
      InventoryItem = (idVehicleKey *)idInventoryCollection::GetInventoryItem(this: v5, index: v6);
      if ( InventoryItem != nullptr )
      {
        v9 = (idStrId *)idVehicleKey::CastTo(c: InventoryItem);
        if ( v9 != nullptr )
        {
          v10 = idSWFScriptObject::Alloc();
          v11 = idSWFScriptObject::Alloc();
          idSWFScriptObject::MakeArray(this: v11);
          v12 = 0;
          if ( v9[22].index > 0 )
          {
            v13 = 0;
            do
            {
              v14 = *(_DWORD **)(v13 + v9[21].index);
              v15 = idSWFScriptObject::Alloc();
              LODWORD(v16.f) = (idSWFScriptVar::swfScriptVarValue_t)v14[41];
              v17 = v15;
              v38.type = SWF_VAR_UNDEF;
              idSWFScriptVar::Free(this: &v38);
              v38.value = v16;
              v38.type = SWF_VAR_STRINGID;
              idSWFScriptObject::Set(this: v17, name: "name", value: &v38);
              idSWFScriptVar::Free(this: &v38);
              v18 = v14[53];
              v19 = &byte_8200D768;
              if ( v18 != 0 )
                v19 = *(const char **)(v18 + 8);
              v39.type = SWF_VAR_UNDEF;
              v20 = idStr::idStr(this: (idStr *)&v50.decl, text: v19);
              idSWFScriptVar::Free(this: &v39);
              v39.type = SWF_VAR_STRING;
              v39.value.i = (int)idSWFScriptString::Alloc(s: v20);
              idStr::FreeData(this: (idStr *)&v50.decl);
              idSWFScriptObject::Set(this: v17, name: "icon", value: &v39);
              idSWFScriptVar::Free(this: &v39);
              LODWORD(v21.f) = (idSWFScriptVar::swfScriptVarValue_t)v14[126];
              v41.type = SWF_VAR_UNDEF;
              idSWFScriptVar::Free(this: &v41);
              v41.value = v21;
              v41.type = SWF_VAR_INTEGER;
              idSWFScriptObject::Set(this: v17, name: "upgradeType", value: &v41);
              idSWFScriptVar::Free(this: &v41);
              v36.type = SWF_VAR_UNDEF;
              idSWFScriptVar::Free(this: &v36);
              if ( v17 != nullptr )
              {
                v36.value.i = (int)v17;
                v36.type = SWF_VAR_OBJECT;
                ++v17->refCount;
              }
              else
              {
                v36.type = SWF_VAR_NULL;
              }
              idSWFScriptObject::Set(this: v11, index: v12, value: &v36);
              idSWFScriptVar::Free(this: &v36);
              if ( v17->refCount-- == 1 )
              {
                idSWFScriptObject::~idSWFScriptObject(this: v17);
                idMem::Free(this: &mem, ptr: v17, align: ALIGN_16);
              }
              ++v12;
              v13 += 4;
            }
            while ( v12 < v9[22].index );
            v7 = v45;
            v6 = v42;
            v5 = v47;
            v4 = v48;
          }
          DisplayName = (idSWFScriptVar::swfScriptVarValue_t *)idInventoryItem::GetDisplayName(this: &v50, result: v9);
          v44.type = SWF_VAR_UNDEF;
          v24.f = DisplayName->f;
          idSWFScriptVar::Free(this: &v44);
          v44.value = v24;
          v44.type = SWF_VAR_STRINGID;
          idSWFScriptObject::Set(this: v10, name: "name", value: &v44);
          idSWFScriptVar::Free(this: &v44);
          v25 = &byte_8200D768;
          v26 = *(_DWORD *)(v9[3].index + 212);
          if ( v26 != 0 )
            v25 = *(const char **)(v26 + 8);
          v46.type = SWF_VAR_UNDEF;
          v27 = idStr::idStr(this: &v51, text: v25);
          idSWFScriptVar::Free(this: &v46);
          v46.type = SWF_VAR_STRING;
          v46.value.i = (int)idSWFScriptString::Alloc(s: v27);
          idStr::FreeData(this: &v51);
          idSWFScriptObject::Set(this: v10, name: "icon", value: &v46);
          idSWFScriptVar::Free(this: &v46);
          v28 = &byte_8200D768;
          v29 = *(_DWORD *)(v9[3].index + 724);
          if ( v29 != 0 )
            v28 = *(const char **)(v29 + 8);
          v43.type = SWF_VAR_UNDEF;
          v30 = idStr::idStr(this: v52, text: v28);
          idSWFScriptVar::Free(this: &v43);
          v43.type = SWF_VAR_STRING;
          v43.value.i = (int)idSWFScriptString::Alloc(s: v30);
          idStr::FreeData(this: v52);
          idSWFScriptObject::Set(this: v10, name: v49, value: &v43);
          idSWFScriptVar::Free(this: &v43);
          v35.type = SWF_VAR_UNDEF;
          idSWFScriptVar::Free(this: &v35);
          if ( v11 != nullptr )
          {
            v35.value.i = (int)v11;
            v35.type = SWF_VAR_OBJECT;
            ++v11->refCount;
          }
          else
          {
            v35.type = SWF_VAR_NULL;
          }
          idSWFScriptObject::Set(this: v10, name: v40, value: &v35);
          idSWFScriptVar::Free(this: &v35);
          v34.type = SWF_VAR_UNDEF;
          idSWFScriptVar::Free(this: &v34);
          if ( v10 != nullptr )
          {
            v34.value.i = (int)v10;
            v34.type = SWF_VAR_OBJECT;
            ++v10->refCount;
          }
          else
          {
            v34.type = SWF_VAR_NULL;
          }
          idSWFScriptObject::Set(this: (idSWFScriptObject *)v4->variables.size, index: v7++, value: &v34);
          v45 = v7;
          idSWFScriptVar::Free(this: &v34);
          if ( v11->refCount-- == 1 )
          {
            idSWFScriptObject::~idSWFScriptObject(this: v11);
            idMem::Free(this: &mem, ptr: v11, align: ALIGN_16);
          }
          if ( v10->refCount-- == 1 )
          {
            idSWFScriptObject::~idSWFScriptObject(this: v10);
            idMem::Free(this: &mem, ptr: v10, align: ALIGN_16);
          }
          v3 = result;
        }
      }
      v42 = ++v6;
    }
    while ( v6 < (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v5) );
  }
  v3->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: v3);
  v3->value.b = true;
  v3->type = SWF_VAR_BOOL;
  return v3;
}


// ========================================================================
// __unwind$538316
// EA  : 0x82E6F990
// RVA : 0x00E6F990
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538316()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 464 + 104));
}


// ========================================================================
// __unwind$538317
// EA  : 0x82E6F9B8
// RVA : 0x00E6F9B8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538317()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 464 + 112));
}


// ========================================================================
// __unwind$538399
// EA  : 0x82E6F9E0
// RVA : 0x00E6F9E0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538399()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 464 + 208));
}


// ========================================================================
// __unwind$538318
// EA  : 0x82E6FA08
// RVA : 0x00E6FA08
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538318()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 464 + 120));
}


// ========================================================================
// __unwind$538319_1
// EA  : 0x82E6FA30
// RVA : 0x00E6FA30
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538319_1()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 464 + 136));
}


// ========================================================================
// __unwind$538320
// EA  : 0x82E6FA58
// RVA : 0x00E6FA58
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538320()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 464 + 96));
}


// ========================================================================
// __unwind$538321
// EA  : 0x82E6FA80
// RVA : 0x00E6FA80
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538321()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 464 + 160));
}


// ========================================================================
// __unwind$538529
// EA  : 0x82E6FAA8
// RVA : 0x00E6FAA8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538529()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 464 + 240));
}


// ========================================================================
// __unwind$538322
// EA  : 0x82E6FAD0
// RVA : 0x00E6FAD0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538322()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 464 + 176));
}


// ========================================================================
// __unwind$538563
// EA  : 0x82E6FAF8
// RVA : 0x00E6FAF8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538563()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 464 + 272));
}


// ========================================================================
// __unwind$538323
// EA  : 0x82E6FB20
// RVA : 0x00E6FB20
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538323()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 464 + 152));
}


// ========================================================================
// __unwind$538324
// EA  : 0x82E6FB48
// RVA : 0x00E6FB48
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538324()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 464 + 88));
}


// ========================================================================
// __unwind$538325
// EA  : 0x82E6FB70
// RVA : 0x00E6FB70
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538325()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 464 + 80));
}


// ========================================================================
// `idPlayer::ShowInventory'::`41'::idSWFScriptFunction_PlayerInventory_UseDeactivate::Call
// EA  : 0x82E6FBA0
// RVA : 0x00E6FBA0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_41_::idSWFScriptFunction_PlayerInventory_UseDeactivate::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  idSWFScriptVar *v4; // r28
  int num; // r11
  int v8; // r3
  int v9; // r3
  int v10; // r3
  int v11; // r3
  int v12; // r3
  idPresentablePlayer *v13; // r3
  __int64 v14; // r10
  __int64 v15; // r8
  __int64 v16; // r6
  char *data; // r29
  idJobManager *v18; // r3
  idAmmoItem *InventoryItemByDeclName; // r29
  int v20; // r3
  int v21; // r3
  idPresentablePlayer *v22; // r3
  bool v23; // r3
  idStr v24[2]; // [sp+60h] [-50h] BYREF

  v4 = result;
  num = thisObject->variables.num;
  if ( num != 0 )
  {
    v8 = *(_DWORD *)(num + 488);
    if ( v8 != 0 )
      v9 = (*(int (__fastcall **)(int))(*(_DWORD *)v8 + 104))(a1: v8);
    else
      v9 = 0;
    idView::ForceBlurValues(this: (idView *)(v9 + 16224), blurBegin: 0.5, blurEnd: 0.0, blurTime: 100.0);
    v10 = *(_DWORD *)(thisObject->variables.num + 488);
    if ( v10 != 0 )
      v11 = (*(int (__fastcall **)(int))(*(_DWORD *)v10 + 104))(a1: v10);
    else
      v11 = 0;
    idPlayerHud::SetHudState(this: (idPlayerHud *)(v11 + 35096), state: HUDSTATE_ALL);
    v12 = *(_DWORD *)(thisObject->variables.num + 488);
    if ( v12 != 0 )
      v13 = (idPresentablePlayer *)(*(int (__fastcall **)(int))(*(_DWORD *)v12 + 104))(a1: v12);
    else
      v13 = nullptr;
    idPresentablePlayer::InhibitFire(this: v13, inhibit: true);
    idSWF::Activate(this: (idSWF *)thisObject->variables.size, b: false);
    if ( *(_DWORD *)(a4 + 4) == 1 )
    {
      idSWFScriptVar::ToString(this: (idSWFScriptVar *)v24, result: *(idStr **)a4, a3: v16, a4: v15, a5: v14);
      data = v24[0].data;
      v18 = (idJobManager *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
      InventoryItemByDeclName = (idAmmoItem *)idInventoryCollection::FindInventoryItemByDeclName(
                                                this: v18,
                                                jobName: data);
      if ( InventoryItemByDeclName != nullptr
        && (v20 = *(_DWORD *)(thisObject->variables.num + 488)) != 0
        && (*(int (__fastcall **)(int))(*(_DWORD *)v20 + 104))(a1: v20) != 0 )
      {
        v21 = *(_DWORD *)(thisObject->variables.num + 488);
        if ( v21 != 0 )
          v22 = (idPresentablePlayer *)(*(int (__fastcall **)(int))(*(_DWORD *)v21 + 104))(a1: v21);
        else
          v22 = nullptr;
        v23 = idPresentablePlayer::UseItem(this: v22, item: InventoryItemByDeclName);
        idSWFScriptVar::idSWFScriptVar(this: v4, b: v23);
      }
      else
      {
        v4->type = SWF_VAR_UNDEF;
      }
      idStr::FreeData(this: v24);
      return v4;
    }
    else
    {
      idLib::Warning(fmt: "tried to use and deactivate inventory without passing decl to use function");
      v4->type = SWF_VAR_UNDEF;
      return v4;
    }
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
  }
  return result;
}


// ========================================================================
// __unwind$538780_0
// EA  : 0x82E6FD94
// RVA : 0x00E6FD94
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538780_0()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 176;
  if ( (*(_DWORD *)(v0 - 176 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 196));
  }
}


// ========================================================================
// __unwind$538783_0
// EA  : 0x82E6FDD8
// RVA : 0x00E6FDD8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_538783_0()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 176 + 96));
}


// ========================================================================
// ?AddStatToList@idPlayer@@QAAXPAVidSWFScriptObject@@HVidStr@@1_N@Z
// EA  : 0x82E6FEC8
// RVA : 0x00E6FEC8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::AddStatToList(
        idPlayer *this,
        idSWFScriptObject *obj,
        int index,
        idStr *stat,
        idStr *val,
        bool sub)
{
  idSWFScriptObject *v11; // r30
  idSWFScriptVar v13; // [sp+50h] [-70h] BYREF
  idSWFScriptVar v14; // [sp+58h] [-68h] BYREF
  idSWFScriptVar v15; // [sp+60h] [-60h] BYREF
  idSWFScriptVar v16[11]; // [sp+68h] [-58h] BYREF

  if ( obj != nullptr )
  {
    v11 = idSWFScriptObject::Alloc();
    v13.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v13);
    v13.type = SWF_VAR_STRING;
    v13.value.i = (int)idSWFScriptString::Alloc(s: stat);
    idSWFScriptObject::Set(this: v11, name: "stat", value: &v13);
    idSWFScriptVar::Free(this: &v13);
    v14.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v14);
    v14.type = SWF_VAR_STRING;
    v14.value.i = (int)idSWFScriptString::Alloc(s: val);
    idSWFScriptObject::Set(this: v11, name: "val", value: &v14);
    idSWFScriptVar::Free(this: &v14);
    v15.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v15);
    v15.value.b = sub;
    v15.type = SWF_VAR_BOOL;
    idSWFScriptObject::Set(this: v11, name: "sub", value: &v15);
    idSWFScriptVar::Free(this: &v15);
    idSWFScriptVar::idSWFScriptVar(this: v16, o: v11);
    idSWFScriptObject::Set(this: obj, index, value: v16);
    idSWFScriptVar::Free(this: v16);
    if ( v11->refCount-- == 1 )
    {
      idSWFScriptObject::~idSWFScriptObject(this: v11);
      idMem::Free(this: &mem, ptr: v11, align: ALIGN_16);
    }
  }
  idStr::FreeData(this: stat);
  idStr::FreeData(this: val);
}


// ========================================================================
// __unwind$539009
// EA  : 0x82E70018
// RVA : 0x00E70018
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539009()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 192 + 244));
}


// ========================================================================
// __unwind$539010
// EA  : 0x82E70040
// RVA : 0x00E70040
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539010()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 192 + 236));
}


// ========================================================================
// __unwind$539011
// EA  : 0x82E70068
// RVA : 0x00E70068
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539011()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 192 + 80));
}


// ========================================================================
// __unwind$539012
// EA  : 0x82E70090
// RVA : 0x00E70090
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539012()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 192 + 88));
}


// ========================================================================
// __unwind$539013_0
// EA  : 0x82E700B8
// RVA : 0x00E700B8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539013_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 192 + 96));
}


// ========================================================================
// __unwind$539014
// EA  : 0x82E700E0
// RVA : 0x00E700E0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539014()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 192 + 104));
}


// ========================================================================
// ?PopulateStatInformation@idPlayer@@QAAXPAVidSWFScriptObject@@@Z
// EA  : 0x82E70110
// RVA : 0x00E70110
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

// local variable allocation has failed, the output may be wrong!
void __fastcall idPlayer::PopulateStatInformation(idPlayer *this, idSWFScriptObject *obj)
{
  int v4; // r27
  int i; // r4
  __int64 v6; // r6
  __int64 v7; // r10
  __int64 v8; // r8
  va *v9; // r3
  idStr *v10; // r28
  idStr *v11; // r3
  __int64 v12; // r10
  __int64 v13; // r6
  __int64 v14; // r8
  va *v15; // r3
  idStr *v16; // r26
  idStr *v17; // r3
  __int64 v18; // r10
  __int64 v19; // r8
  __int64 v20; // r6
  idJobManager *v21; // r3
  idJob *InventoryItemByDeclName; // r3
  va *v23; // r3
  idStr *v24; // r27
  idStr *v25; // r3
  __int64 v26; // r10
  __int64 v27; // r6
  __int64 v28; // r8
  va *v29; // r3
  idStr *v30; // r27
  idStr *v31; // r3
  __int64 v32; // r8
  __int64 v33; // r6
  __int64 v34; // r10
  va *v35; // r3
  idStr *v36; // r27
  idStr *v37; // r3
  __int64 v38; // r10
  __int64 v39; // r8 OVERLAPPED
  __int64 v40; // r6 OVERLAPPED
  double v41; // fp1
  va *v42; // r3
  idStr *v43; // r26
  idStr *v44; // r3
  __int64 v45; // r8 OVERLAPPED
  __int64 v46; // r6 OVERLAPPED
  __int64 v47; // r10
  double v48; // fp1
  va *v49; // r3
  idStr *v50; // r25
  idStr *v51; // r3
  __int64 v52; // r8 OVERLAPPED
  __int64 v53; // r6 OVERLAPPED
  __int64 v54; // r10
  double v55; // fp1
  va *v56; // r3
  idStr *v57; // r26
  idStr *v58; // r3
  __int64 v59; // r10
  profileStatValue_t v60; // r26
  __int64 v61; // r6
  __int64 v62; // r8
  va *v63; // r3
  idStr *v64; // r25
  idStr *v65; // r3
  __int64 v66; // r8
  __int64 v67; // r6
  __int64 v68; // r10
  va *v69; // r3
  idStr *v70; // r25
  idStr *v71; // r3
  __int64 v72; // r10 OVERLAPPED
  __int64 v73; // r8 OVERLAPPED
  __int64 v74; // r6
  double v75; // fp1
  va *v76; // r3
  idStr *v77; // r26
  idStr *v78; // r3
  __int64 v79; // r10
  profileStatValue_t v80; // r26
  profileStatValue_t v81; // r25
  profileStatValue_t v82; // r24
  __int64 v83; // r6
  __int64 v84; // r8
  va *v85; // r3
  idStr *v86; // r22
  idStr *v87; // r3
  __int64 v88; // r8
  __int64 v89; // r6
  __int64 v90; // r10
  va *v91; // r3
  idStr *v92; // r24
  idStr *v93; // r3
  __int64 v94; // r6
  __int64 v95; // r10
  __int64 v96; // r8
  va *v97; // r3
  idStr *v98; // r26
  idStr *v99; // r3
  __int64 v100; // r6
  __int64 v101; // r10
  __int64 v102; // r8
  va *v103; // r3
  idStr *v104; // r26
  idStr *v105; // r3
  __int64 v106; // r10
  __int64 v107; // r6
  __int64 v108; // r8
  va *v109; // r3
  idStr *v110; // r26
  idStr *v111; // r3
  __int64 v112; // r8
  __int64 v113; // r6
  __int64 v114; // r10
  va *v115; // r3
  idStr *v116; // r26
  idStr *v117; // r3
  __int64 v118; // r6
  __int64 v119; // r10
  __int64 v120; // r8
  va *v121; // r3
  idStr *v122; // r26
  idStr *v123; // r3
  __int64 v124; // r6
  __int64 v125; // r10
  __int64 v126; // r8
  va *v127; // r3
  idStr *v128; // r26
  idStr *v129; // r3
  __int64 v130; // r10
  __int64 v131; // r6
  __int64 v132; // r8
  va *v133; // r3
  idStr *v134; // r26
  idStr *v135; // r3
  __int64 v136; // r8
  __int64 v137; // r6
  __int64 v138; // r10
  va *v139; // r3
  idStr *v140; // r28
  idStr *v141; // r3
  __int128 v142; // r6
  __int64 v143; // r10
  __int64 v144; // r8
  va *v145; // r3
  idStr *v146; // r28
  idStr *v147; // r3
  __int64 v148; // r6
  __int64 v149; // r10
  __int64 v150; // r8
  va *v151; // r3
  idStr *v152; // r28
  idStr *v153; // r3
  double AchievementCompletionPercent; // fp1
  __int64 v155; // r10
  __int64 v156; // r8
  va *v157; // r3
  idStr *v158; // r26
  idStr *v159; // r3
  double v160; // fp1
  __int64 v161; // r10
  __int64 v162; // r8
  va *v163; // r3
  idStr *v164; // r28
  idStr *v165; // r3
  int v166; // [sp+8h] [-1168h]
  int v167; // [sp+8h] [-1168h]
  int v168; // [sp+8h] [-1168h]
  int v169; // [sp+8h] [-1168h]
  int v170; // [sp+8h] [-1168h]
  int v171; // [sp+8h] [-1168h]
  int v172; // [sp+8h] [-1168h]
  int v173; // [sp+8h] [-1168h]
  int v174; // [sp+8h] [-1168h]
  int v175; // [sp+8h] [-1168h]
  int v176; // [sp+8h] [-1168h]
  int v177; // [sp+8h] [-1168h]
  int v178; // [sp+8h] [-1168h]
  int v179; // [sp+8h] [-1168h]
  int v180; // [sp+8h] [-1168h]
  int v181; // [sp+8h] [-1168h]
  int v182; // [sp+8h] [-1168h]
  int v183; // [sp+8h] [-1168h]
  int v184; // [sp+8h] [-1168h]
  int v185; // [sp+8h] [-1168h]
  int v186; // [sp+8h] [-1168h]
  int v187; // [sp+8h] [-1168h]
  int v188; // [sp+8h] [-1168h]
  int v189; // [sp+8h] [-1168h]
  int v190; // [sp+8h] [-1168h]
  int v191; // [sp+Ch] [-1164h]
  int v192; // [sp+Ch] [-1164h]
  int v193; // [sp+Ch] [-1164h]
  int v194; // [sp+Ch] [-1164h]
  int v195; // [sp+Ch] [-1164h]
  int v196; // [sp+Ch] [-1164h]
  int v197; // [sp+Ch] [-1164h]
  int v198; // [sp+Ch] [-1164h]
  int v199; // [sp+Ch] [-1164h]
  int v200; // [sp+Ch] [-1164h]
  int v201; // [sp+Ch] [-1164h]
  int v202; // [sp+Ch] [-1164h]
  int v203; // [sp+Ch] [-1164h]
  int v204; // [sp+Ch] [-1164h]
  int v205; // [sp+Ch] [-1164h]
  int v206; // [sp+Ch] [-1164h]
  int v207; // [sp+Ch] [-1164h]
  int v208; // [sp+Ch] [-1164h]
  int v209; // [sp+Ch] [-1164h]
  int v210; // [sp+Ch] [-1164h]
  int v211; // [sp+Ch] [-1164h]
  int v212; // [sp+Ch] [-1164h]
  int v213; // [sp+Ch] [-1164h]
  int v214; // [sp+Ch] [-1164h]
  int v215; // [sp+Ch] [-1164h]
  int v216; // [sp+10h] [-1160h]
  int v217; // [sp+10h] [-1160h]
  int v218; // [sp+10h] [-1160h]
  int v219; // [sp+10h] [-1160h]
  int v220; // [sp+10h] [-1160h]
  int v221; // [sp+10h] [-1160h]
  int v222; // [sp+10h] [-1160h]
  int v223; // [sp+10h] [-1160h]
  int v224; // [sp+10h] [-1160h]
  int v225; // [sp+10h] [-1160h]
  int v226; // [sp+10h] [-1160h]
  int v227; // [sp+10h] [-1160h]
  int v228; // [sp+10h] [-1160h]
  int v229; // [sp+10h] [-1160h]
  int v230; // [sp+10h] [-1160h]
  int v231; // [sp+10h] [-1160h]
  int v232; // [sp+10h] [-1160h]
  int v233; // [sp+10h] [-1160h]
  int v234; // [sp+10h] [-1160h]
  int v235; // [sp+10h] [-1160h]
  int v236; // [sp+10h] [-1160h]
  int v237; // [sp+10h] [-1160h]
  int v238; // [sp+10h] [-1160h]
  int v239; // [sp+10h] [-1160h]
  int v240; // [sp+10h] [-1160h]
  int v241; // [sp+14h] [-115Ch]
  int v242; // [sp+14h] [-115Ch]
  int v243; // [sp+14h] [-115Ch]
  int v244; // [sp+14h] [-115Ch]
  int v245; // [sp+14h] [-115Ch]
  int v246; // [sp+14h] [-115Ch]
  int v247; // [sp+14h] [-115Ch]
  int v248; // [sp+14h] [-115Ch]
  int v249; // [sp+14h] [-115Ch]
  int v250; // [sp+14h] [-115Ch]
  int v251; // [sp+14h] [-115Ch]
  int v252; // [sp+14h] [-115Ch]
  int v253; // [sp+14h] [-115Ch]
  int v254; // [sp+14h] [-115Ch]
  int v255; // [sp+14h] [-115Ch]
  int v256; // [sp+14h] [-115Ch]
  int v257; // [sp+14h] [-115Ch]
  int v258; // [sp+14h] [-115Ch]
  int v259; // [sp+14h] [-115Ch]
  int v260; // [sp+14h] [-115Ch]
  int v261; // [sp+14h] [-115Ch]
  int v262; // [sp+14h] [-115Ch]
  int v263; // [sp+14h] [-115Ch]
  int v264; // [sp+14h] [-115Ch]
  int v265; // [sp+14h] [-115Ch]
  int v266; // [sp+18h] [-1158h]
  int v267; // [sp+18h] [-1158h]
  int v268; // [sp+18h] [-1158h]
  int v269; // [sp+18h] [-1158h]
  int v270; // [sp+18h] [-1158h]
  int v271; // [sp+18h] [-1158h]
  int v272; // [sp+18h] [-1158h]
  int v273; // [sp+18h] [-1158h]
  int v274; // [sp+18h] [-1158h]
  int v275; // [sp+18h] [-1158h]
  int v276; // [sp+18h] [-1158h]
  int v277; // [sp+18h] [-1158h]
  int v278; // [sp+18h] [-1158h]
  int v279; // [sp+18h] [-1158h]
  int v280; // [sp+18h] [-1158h]
  int v281; // [sp+18h] [-1158h]
  int v282; // [sp+18h] [-1158h]
  int v283; // [sp+18h] [-1158h]
  int v284; // [sp+18h] [-1158h]
  int v285; // [sp+18h] [-1158h]
  int v286; // [sp+18h] [-1158h]
  int v287; // [sp+18h] [-1158h]
  int v288; // [sp+18h] [-1158h]
  int v289; // [sp+18h] [-1158h]
  int v290; // [sp+18h] [-1158h]
  int v291; // [sp+1Ch] [-1154h]
  int v292; // [sp+1Ch] [-1154h]
  int v293; // [sp+1Ch] [-1154h]
  int v294; // [sp+1Ch] [-1154h]
  int v295; // [sp+1Ch] [-1154h]
  int v296; // [sp+1Ch] [-1154h]
  int v297; // [sp+1Ch] [-1154h]
  int v298; // [sp+1Ch] [-1154h]
  int v299; // [sp+1Ch] [-1154h]
  int v300; // [sp+1Ch] [-1154h]
  int v301; // [sp+1Ch] [-1154h]
  int v302; // [sp+1Ch] [-1154h]
  int v303; // [sp+1Ch] [-1154h]
  int v304; // [sp+1Ch] [-1154h]
  int v305; // [sp+1Ch] [-1154h]
  int v306; // [sp+1Ch] [-1154h]
  int v307; // [sp+1Ch] [-1154h]
  int v308; // [sp+1Ch] [-1154h]
  int v309; // [sp+1Ch] [-1154h]
  int v310; // [sp+1Ch] [-1154h]
  int v311; // [sp+1Ch] [-1154h]
  int v312; // [sp+1Ch] [-1154h]
  int v313; // [sp+1Ch] [-1154h]
  int v314; // [sp+1Ch] [-1154h]
  int v315; // [sp+1Ch] [-1154h]
  __int64 v316; // [sp+54h] [-111Ch] BYREF
  idStr v317; // [sp+60h] [-1110h] BYREF
  unsigned __int64 v318; // [sp+80h] [-10F0h]
  idStr v319; // [sp+90h] [-10E0h] BYREF
  __int64 v320; // [sp+B0h] [-10C0h]
  idStr v321; // [sp+C0h] [-10B0h] BYREF
  idStr v322; // [sp+E0h] [-1090h] BYREF
  va v323; // [sp+100h] [-1070h] BYREF

  if ( obj != nullptr )
  {
    v4 = 0;
    i = this->stats[156].i;
    v316 = 0;
    HIDWORD(v6) = Sys_SecToStr(result: &v321, sec: i)->data;
    v9 = va::va(
           this: &v323,
           fmt: "%s",
           a3: v6,
           a4: v8,
           a5: v7,
           a6: v166,
           a7: v191,
           a8: v216,
           a9: v241,
           a10: v266,
           a11: v291);
    v10 = idStr::idStr(this: &v317, text: v9);
    v11 = idStr::idStr(this: &v319, text: "#str_swf_stats_timeplayed");
    idPlayer::AddStatToList(this, obj, index: 0, stat: v11, val: v10, sub: false);
    idStr::FreeData(this: &v321);
    HIDWORD(v12) = &v317;
    HIDWORD(v13) = this->stats[255].i;
    v15 = va::va(
            this: &v323,
            fmt: "%d",
            a3: v13,
            a4: v14,
            a5: v12,
            a6: v167,
            a7: v192,
            a8: v217,
            a9: v242,
            a10: v267,
            a11: v292);
    v16 = idStr::idStr(this: &v317, text: v15);
    v17 = idStr::idStr(this: &v319, text: "#str_swf_stats_cashcollected");
    idPlayer::AddStatToList(this, obj, index: 1, stat: v17, val: v16, sub: false);
    v21 = (idJobManager *)this->GetInventory_2(this);
    if ( v21 != nullptr )
    {
      InventoryItemByDeclName = idInventoryCollection::FindInventoryItemByDeclName(
                                  this: v21,
                                  jobName: "inventory/jobitems/data/posted");
      if ( InventoryItemByDeclName != nullptr )
        v4 = ((int (__fastcall *)(idJob *))InventoryItemByDeclName->__vftable[2].dtr_idClass)(a1: InventoryItemByDeclName);
    }
    HIDWORD(v20) = v4;
    v23 = va::va(
            this: &v323,
            fmt: "%d",
            a3: v20,
            a4: v19,
            a5: v18,
            a6: v168,
            a7: v193,
            a8: v218,
            a9: v243,
            a10: v268,
            a11: v293);
    v24 = idStr::idStr(this: &v317, text: v23);
    v25 = idStr::idStr(this: &v319, text: "#str_swf_stats_jobsboard");
    idPlayer::AddStatToList(this, obj, index: 2, stat: v25, val: v24, sub: false);
    HIDWORD(v26) = &v317;
    HIDWORD(v27) = this->stats[240].i;
    v29 = va::va(
            this: &v323,
            fmt: "%d",
            a3: v27,
            a4: v28,
            a5: v26,
            a6: v169,
            a7: v194,
            a8: v219,
            a9: v244,
            a10: v269,
            a11: v294);
    v30 = idStr::idStr(this: &v317, text: v29);
    v31 = idStr::idStr(this: &v319, text: "#str_swf_stats_itemscrafted");
    idPlayer::AddStatToList(this, obj, index: 3, stat: v31, val: v30, sub: false);
    HIDWORD(v32) = &v317;
    HIDWORD(v33) = this->stats[160].i;
    v35 = va::va(
            this: &v323,
            fmt: "%d",
            a3: v33,
            a4: v32,
            a5: v34,
            a6: v170,
            a7: v195,
            a8: v220,
            a9: v245,
            a10: v270,
            a11: v295);
    v36 = idStr::idStr(this: &v317, text: v35);
    v37 = idStr::idStr(this: &v319, text: "#str_swf_stats_itemslooted");
    idPlayer::AddStatToList(this, obj, index: 4, stat: v37, val: v36, sub: false);
    idAchievementManager::GetAchievementCompletionPercent(
      this: &this->achievementManager,
      id: GAME_ACHIEVEMENT_12,
      gained: (int *)&v316,
      required: (int *)&v316 + 1,
      isFulfilled: nullptr);
    v40 = v316;
    if ( (int)v316 <= 0 )
    {
      v41 = 0.0;
    }
    else
    {
      LODWORD(v38) = HIDWORD(v316);
      v318 = v38;
      v41 = (float)((float)((float)v38 / (float)v316) * (float)100.0);
    }
    *(__int64 *)((char *)&v39 + 4) = *(_QWORD *)&v41;
    v42 = va::va(
            this: &v323,
            fmt: "%d/%d - %.1f%%",
            a3: v40,
            a4: v39,
            a5: v38,
            a6: v171,
            a7: v196,
            a8: v221,
            a9: v246,
            a10: v271,
            a11: v296);
    v43 = idStr::idStr(this: &v317, text: v42);
    v44 = idStr::idStr(this: &v319, text: "#str_swf_stats_jumps");
    idPlayer::AddStatToList(this, obj, index: 5, stat: v44, val: v43, sub: false);
    idAchievementManager::GetAchievementCompletionPercent(
      this: &this->achievementManager,
      id: GAME_ACHIEVEMENT_13,
      gained: (int *)&v316,
      required: (int *)&v316 + 1,
      isFulfilled: nullptr);
    v46 = v316;
    HIDWORD(v47) = &v317;
    if ( (int)v316 <= 0 )
    {
      v48 = 0.0;
    }
    else
    {
      LODWORD(v47) = v316;
      v318 = v47;
      v48 = (float)((float)((float)__SPAIR64__(v316, HIDWORD(v316)) / (float)v47) * (float)100.0);
    }
    *(__int64 *)((char *)&v45 + 4) = *(_QWORD *)&v48;
    v49 = va::va(
            this: &v323,
            fmt: "%d/%d - %.0f%%",
            a3: v46,
            a4: v45,
            a5: v47,
            a6: v172,
            a7: v197,
            a8: v222,
            a9: v247,
            a10: v272,
            a11: v297);
    v50 = idStr::idStr(this: &v317, text: v49);
    v51 = idStr::idStr(this: &v319, text: "#str_swf_stats_cards");
    idPlayer::AddStatToList(this, obj, index: 6, stat: v51, val: v50, sub: false);
    idAchievementManager::GetAchievementCompletionPercent(
      this: &this->achievementManager,
      id: GAME_ACHIEVEMENT_14,
      gained: (int *)&v316,
      required: (int *)&v316 + 1,
      isFulfilled: nullptr);
    v53 = v316;
    LODWORD(v54) = &v317;
    if ( (int)v316 <= 0 )
    {
      v55 = 0.0;
    }
    else
    {
      LODWORD(v54) = v316;
      v318 = __PAIR64__(v316, HIDWORD(v316));
      v320 = v54;
      v55 = (float)((float)((float)__SPAIR64__(v316, HIDWORD(v316)) / (float)v54) * (float)100.0);
    }
    *(__int64 *)((char *)&v52 + 4) = *(_QWORD *)&v55;
    v56 = va::va(
            this: &v323,
            fmt: "%d/%d - %.0f%%",
            a3: v53,
            a4: v52,
            a5: v54,
            a6: v173,
            a7: v198,
            a8: v223,
            a9: v248,
            a10: v273,
            a11: v298);
    v57 = idStr::idStr(this: &v317, text: v56);
    v58 = idStr::idStr(this: &v319, text: "#str_swf_stats_recipes");
    idPlayer::AddStatToList(this, obj, index: 7, stat: v58, val: v57, sub: false);
    LODWORD(v59) = &v317;
    v60.i = (int)this->stats[159];
    HIDWORD(v61) = v60;
    v63 = va::va(
            this: &v323,
            fmt: "%d",
            a3: v61,
            a4: v62,
            a5: v59,
            a6: v174,
            a7: v199,
            a8: v224,
            a9: v249,
            a10: v274,
            a11: v299);
    v64 = idStr::idStr(this: &v317, text: v63);
    v65 = idStr::idStr(this: &v319, text: "#str_swf_stats_shotsfired");
    idPlayer::AddStatToList(this, obj, index: 8, stat: v65, val: v64, sub: false);
    LODWORD(v66) = &v317;
    HIDWORD(v67) = this->stats[162].i;
    v69 = va::va(
            this: &v323,
            fmt: "%d",
            a3: v67,
            a4: v66,
            a5: v68,
            a6: v175,
            a7: v200,
            a8: v225,
            a9: v250,
            a10: v275,
            a11: v300);
    v70 = idStr::idStr(this: &v317, text: v69);
    v71 = idStr::idStr(this: &v319, text: "#str_swf_stats_shotshit");
    idPlayer::AddStatToList(this, obj, index: 9, stat: v71, val: v70, sub: false);
    LODWORD(v74) = &v317;
    if ( v60.i <= 0 )
    {
      v75 = 0.0;
    }
    else
    {
      LODWORD(v72) = v60;
      HIDWORD(v72) = this->stats[167].i;
      v320 = v72;
      v318 = *(__int64 *)((char *)&v72 + 4);
      v75 = (float)((float)((float)*(__int64 *)((char *)&v72 + 4) / (float)v72) * (float)100.0);
    }
    HIDWORD(v74) = LODWORD(v75);
    v76 = va::va(
            this: &v323,
            fmt: (const char *)HIDWORD(v75),
            a3: v74,
            a4: v73,
            a5: v72,
            a6: v176,
            a7: v201,
            a8: v226,
            a9: v251,
            a10: v276,
            a11: v301);
    v77 = idStr::idStr(this: &v317, text: v76);
    v78 = idStr::idStr(this: &v319, text: "#str_swf_stats_accuracy");
    idPlayer::AddStatToList(this, obj, index: 10, stat: v78, val: v77, sub: false);
    HIDWORD(v79) = &v317;
    v80.i = (int)this->stats[148];
    v81.i = (int)this->stats[149];
    v82.i = (int)this->stats[147];
    HIDWORD(v83) = v81.i + v80.i + v82.i;
    v85 = va::va(
            this: &v323,
            fmt: "%d",
            a3: v83,
            a4: v84,
            a5: v79,
            a6: v177,
            a7: v202,
            a8: v227,
            a9: v252,
            a10: v277,
            a11: v302);
    v86 = idStr::idStr(this: &v317, text: v85);
    v87 = idStr::idStr(this: &v319, text: "#str_swf_kills");
    idPlayer::AddStatToList(this, obj, index: 11, stat: v87, val: v86, sub: false);
    HIDWORD(v88) = &v317;
    HIDWORD(v89) = v82;
    v91 = va::va(
            this: &v323,
            fmt: "%d",
            a3: v89,
            a4: v88,
            a5: v90,
            a6: v178,
            a7: v203,
            a8: v228,
            a9: v253,
            a10: v278,
            a11: v303);
    v92 = idStr::idStr(this: &v317, text: v91);
    v93 = idStr::idStr(this: &v319, text: "#str_swf_stats_banditkills");
    idPlayer::AddStatToList(this, obj, index: 12, stat: v93, val: v92, sub: true);
    HIDWORD(v94) = v80;
    v97 = va::va(
            this: &v323,
            fmt: "%d",
            a3: v94,
            a4: v96,
            a5: v95,
            a6: v179,
            a7: v204,
            a8: v229,
            a9: v254,
            a10: v279,
            a11: v304);
    v98 = idStr::idStr(this: &v317, text: v97);
    v99 = idStr::idStr(this: &v319, text: "#str_swf_stats_mutantkills");
    idPlayer::AddStatToList(this, obj, index: 13, stat: v99, val: v98, sub: true);
    HIDWORD(v100) = v81;
    v103 = va::va(
             this: &v323,
             fmt: "%d",
             a3: v100,
             a4: v102,
             a5: v101,
             a6: v180,
             a7: v205,
             a8: v230,
             a9: v255,
             a10: v280,
             a11: v305);
    v104 = idStr::idStr(this: &v317, text: v103);
    v105 = idStr::idStr(this: &v319, text: "#str_swf_stats_authoritykills");
    idPlayer::AddStatToList(this, obj, index: 14, stat: v105, val: v104, sub: true);
    LODWORD(v106) = &v317;
    HIDWORD(v107) = this->stats[146].i;
    v109 = va::va(
             this: &v323,
             fmt: "%d",
             a3: v107,
             a4: v108,
             a5: v106,
             a6: v181,
             a7: v206,
             a8: v231,
             a9: v256,
             a10: v281,
             a11: v306);
    v110 = idStr::idStr(this: &v317, text: v109);
    v111 = idStr::idStr(this: &v319, text: "#str_swf_stats_sniperheadshots");
    idPlayer::AddStatToList(this, obj, index: 15, stat: v111, val: v110, sub: false);
    LODWORD(v112) = &v317;
    HIDWORD(v113) = this->stats[242].i;
    v115 = va::va(
             this: &v323,
             fmt: "%d",
             a3: v113,
             a4: v112,
             a5: v114,
             a6: v182,
             a7: v207,
             a8: v232,
             a9: v257,
             a10: v282,
             a11: v307);
    v116 = idStr::idStr(this: &v317, text: v115);
    v117 = idStr::idStr(this: &v319, text: "#str_swf_stats_crossbow");
    idPlayer::AddStatToList(this, obj, index: 16, stat: v117, val: v116, sub: false);
    LODWORD(v118) = &v317;
    HIDWORD(v118) = this->stats[241].i;
    v121 = va::va(
             this: &v323,
             fmt: "%d",
             a3: v118,
             a4: v120,
             a5: v119,
             a6: v183,
             a7: v208,
             a8: v233,
             a9: v258,
             a10: v283,
             a11: v308);
    v122 = idStr::idStr(this: &v317, text: v121);
    v123 = idStr::idStr(this: &v319, text: "#str_swf_stats_engineeringkills");
    idPlayer::AddStatToList(this, obj, index: 17, stat: v123, val: v122, sub: false);
    HIDWORD(v124) = this->stats[161].i;
    v127 = va::va(
             this: &v323,
             fmt: "%d",
             a3: v124,
             a4: v126,
             a5: v125,
             a6: v184,
             a7: v209,
             a8: v234,
             a9: v259,
             a10: v284,
             a11: v309);
    v128 = idStr::idStr(this: &v317, text: v127);
    v129 = idStr::idStr(this: &v319, text: "#str_swf_stats_damagetaken");
    idPlayer::AddStatToList(this, obj, index: 18, stat: v129, val: v128, sub: false);
    HIDWORD(v130) = &v317;
    HIDWORD(v131) = this->stats[0].i;
    v133 = va::va(
             this: &v323,
             fmt: "%d",
             a3: v131,
             a4: v132,
             a5: v130,
             a6: v185,
             a7: v210,
             a8: v235,
             a9: v260,
             a10: v285,
             a11: v310);
    v134 = idStr::idStr(this: &v317, text: v133);
    v135 = idStr::idStr(this: &v319, text: "#str_swf_stats_carskilled");
    idPlayer::AddStatToList(this, obj, index: 19, stat: v135, val: v134, sub: false);
    HIDWORD(v136) = &v317;
    HIDWORD(v137) = this->stats[40].i;
    v139 = va::va(
             this: &v323,
             fmt: "%d",
             a3: v137,
             a4: v136,
             a5: v138,
             a6: v186,
             a7: v211,
             a8: v236,
             a9: v261,
             a10: v286,
             a11: v311);
    v140 = idStr::idStr(this: &v317, text: v139);
    v141 = idStr::idStr(this: &v319, text: "#str_swf_stats_roadkill");
    idPlayer::AddStatToList(this, obj, index: 20, stat: v141, val: v140, sub: false);
    *(double *)((char *)&v142 + 4) = (float)(this->stats[12].f * (float)0.000015782829);
    v145 = va::va(
             this: &v323,
             fmt: (const char *)DWORD1(v142),
             a3: v142,
             a4: v144,
             a5: v143,
             a6: v187,
             a7: v212,
             a8: v237,
             a9: v262,
             a10: v287,
             a11: v312);
    v146 = idStr::idStr(this: &v317, text: v145);
    v147 = idStr::idStr(this: &v319, text: "#str_swf_stats_milesdriven");
    idPlayer::AddStatToList(this, obj, index: 21, stat: v147, val: v146, sub: false);
    HIDWORD(v148) = Sys_SecToStr(result: &v322, sec: this->stats[16].i / 1000)->data;
    v151 = va::va(
             this: &v323,
             fmt: "%s",
             a3: v148,
             a4: v150,
             a5: v149,
             a6: v188,
             a7: v213,
             a8: v238,
             a9: v263,
             a10: v288,
             a11: v313);
    v152 = idStr::idStr(this: &v317, text: v151);
    v153 = idStr::idStr(this: &v319, text: "#str_swf_stats_airtime");
    idPlayer::AddStatToList(this, obj, index: 22, stat: v153, val: v152, sub: false);
    idStr::FreeData(this: &v322);
    AchievementCompletionPercent = idAchievementManager::GetAchievementCompletionPercent(
                                     this: &this->achievementManager,
                                     id: GAME_ACHIEVEMENT_23,
                                     gained: (int *)&v316,
                                     required: (int *)&v316 + 1,
                                     isFulfilled: nullptr);
    v157 = va::va(
             this: &v323,
             fmt: "%d/%d",
             a3: v316,
             a4: v156,
             a5: v155,
             a6: v189,
             a7: v214,
             a8: v239,
             a9: v264,
             a10: v289,
             a11: v314,
             AchievementCompletionPercent);
    v158 = idStr::idStr(this: &v317, text: v157);
    v159 = idStr::idStr(this: &v319, text: "#str_swf_stats_fieldgoals");
    idPlayer::AddStatToList(this, obj, index: 23, stat: v159, val: v158, sub: false);
    v160 = idAchievementManager::GetAchievementCompletionPercent(
             this: &this->achievementManager,
             id: GAME_ACHIEVEMENT_44,
             gained: (int *)&v316,
             required: (int *)&v316 + 1,
             isFulfilled: nullptr);
    LODWORD(v161) = &v317;
    v163 = va::va(
             this: &v323,
             fmt: "%d/%d",
             a3: v316,
             a4: v162,
             a5: v161,
             a6: v190,
             a7: v215,
             a8: v240,
             a9: v265,
             a10: v290,
             a11: v315,
             v160);
    v164 = idStr::idStr(this: &v317, text: v163);
    v165 = idStr::idStr(this: &v319, text: "#str_achievement_44_name");
    idPlayer::AddStatToList(this, obj, index: 24, stat: v165, val: v164, sub: false);
  }
}


// ========================================================================
// __unwind$539264
// EA  : 0x82E70C14
// RVA : 0x00E70C14
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539264()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4464 + 192));
}


// ========================================================================
// __unwind$539265
// EA  : 0x82E70C3C
// RVA : 0x00E70C3C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539265()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539267
// EA  : 0x82E70C64
// RVA : 0x00E70C64
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539267()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539269
// EA  : 0x82E70C8C
// RVA : 0x00E70C8C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539269()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539271
// EA  : 0x82E70CB4
// RVA : 0x00E70CB4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539271()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539273
// EA  : 0x82E70CDC
// RVA : 0x00E70CDC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539273()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539275
// EA  : 0x82E70D04
// RVA : 0x00E70D04
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539275()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539277
// EA  : 0x82E70D2C
// RVA : 0x00E70D2C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539277()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539279
// EA  : 0x82E70D54
// RVA : 0x00E70D54
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539279()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539281
// EA  : 0x82E70D7C
// RVA : 0x00E70D7C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539281()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539283
// EA  : 0x82E70DA4
// RVA : 0x00E70DA4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539283()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539285
// EA  : 0x82E70DCC
// RVA : 0x00E70DCC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539285()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539287
// EA  : 0x82E70DF4
// RVA : 0x00E70DF4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539287()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539289_0
// EA  : 0x82E70E1C
// RVA : 0x00E70E1C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539289_0()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539291
// EA  : 0x82E70E44
// RVA : 0x00E70E44
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539291()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539293
// EA  : 0x82E70E6C
// RVA : 0x00E70E6C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539293()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539295
// EA  : 0x82E70E94
// RVA : 0x00E70E94
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539295()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539297
// EA  : 0x82E70EBC
// RVA : 0x00E70EBC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539297()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539299
// EA  : 0x82E70EE4
// RVA : 0x00E70EE4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539299()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539301
// EA  : 0x82E70F0C
// RVA : 0x00E70F0C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539301()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539303
// EA  : 0x82E70F34
// RVA : 0x00E70F34
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539303()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539305
// EA  : 0x82E70F5C
// RVA : 0x00E70F5C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539305()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539307
// EA  : 0x82E70F84
// RVA : 0x00E70F84
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539307()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539309
// EA  : 0x82E70FAC
// RVA : 0x00E70FAC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539309()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4464 + 224));
}


// ========================================================================
// __unwind$539310
// EA  : 0x82E70FD4
// RVA : 0x00E70FD4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539310()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539312
// EA  : 0x82E70FFC
// RVA : 0x00E70FFC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539312()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// __unwind$539314
// EA  : 0x82E71024
// RVA : 0x00E71024
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539314()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 4464 + 80));
}


// ========================================================================
// ?ConstructJobMessage@idPlayer@@QAAXPBVidJob@@AAV?$idStaticList@VjobMessage_t@idPlayer@@$04@@@Z
// EA  : 0x82E71058
// RVA : 0x00E71058
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::ConstructJobMessage(
        idPlayer *this,
        const idJob *job,
        idStaticList<idPlayer::jobMessage_t,5> *messages)
{
  const idDeclJob *decl; // r25
  bool v7; // r20
  int i; // r24
  __int64 v9; // r10
  __int64 v10; // r8
  const idDeclJob::jobComplete_t *CompletionRequirement; // r3
  idDeclJob::jobCompleteType_t completion; // r11
  const idDeclJob::jobComplete_t *v13; // r30
  const idDeclJob *inventoryDecl; // r29
  idJobManager *v15; // r3
  __int64 v16; // r8
  idJob *JobByDecl; // r3
  __int64 v18; // r10
  idJob *v19; // r29
  int v20; // r3
  __int64 v21; // r6
  int v22; // r3
  va *v23; // r3
  char *String; // r3
  const char *LocalizedString; // r3
  __int64 v26; // r6
  va *v27; // r3
  char *v28; // r3
  int index; // r11
  idStrId *p_triggerMessage; // r3
  char *v31; // r3
  missionStatus_t v32; // r11
  int v33; // r11
  idStrId *v34; // r3
  char *v35; // r3
  bool v36; // cr56
  int v37; // r11
  idStrId *v38; // r3
  char *v39; // r3
  idJob *InventoryItemByDeclName; // r3
  int v41; // r11
  idStrId *v42; // r3
  char *v43; // r3
  idJob *v44; // r3
  int v45; // [sp+8h] [-10F8h]
  int v46; // [sp+Ch] [-10F4h]
  int v47; // [sp+10h] [-10F0h]
  int v48; // [sp+14h] [-10ECh]
  int v49; // [sp+18h] [-10E8h]
  int v50; // [sp+1Ch] [-10E4h]
  cuttableStateInfo_t v51; // [sp+50h] [-10B0h] BYREF
  missionStatus_t status; // [sp+74h] [-108Ch]
  va v53; // [sp+80h] [-1080h] BYREF

  decl = job->decl;
  v7 = job->status == JOBSTATUS_COMPLETED;
  for ( i = 0; i < idDeclJob::GetNumCompletionRequirements(this: decl); ++i )
  {
    v51.name.allocedAndFlag = 20;
    v51.name.data = v51.name.baseBuffer;
    v51.name.baseBuffer[0] = 0;
    v51.name.len = 0;
    v51.graphValid = false;
    CompletionRequirement = idDeclJob::GetCompletionRequirement(this: decl, idx: i);
    completion = CompletionRequirement->completion;
    v13 = CompletionRequirement;
    if ( CompletionRequirement->completion == JOBCOMPLETE_NONE || !CompletionRequirement->showTrackerMessage )
      goto LABEL_55;
    switch ( completion )
    {
      case JOBCOMPLETE_ITEM:
        inventoryDecl = (const idDeclJob *)CompletionRequirement->inventoryDecl;
        if ( inventoryDecl != nullptr )
        {
          v15 = (idJobManager *)this->GetInventory_2(this);
          JobByDecl = idJobManager::FindJobByDecl(this: v15, jobDecl: inventoryDecl);
          HIDWORD(v18) = job->status;
          v19 = JobByDecl;
          if ( HIDWORD(v18) == 5
            || JobByDecl != nullptr
            && (v20 = ((int (__fastcall *)(idJob *))JobByDecl->__vftable[2].dtr_idClass)(a1: JobByDecl),
                HIDWORD(v18) = v13->count,
                v20 >= SHIDWORD(v18)) )
          {
            v51.graphValid = true;
          }
          LODWORD(v21) = v13->count;
          if ( (int)v21 <= 1 )
          {
            if ( decl->jobType == JOBTYPE_REPEATING && v19 != nullptr )
              v19->__vftable[2].dtr_idClass(this: v19);
          }
          else
          {
            HIDWORD(v21) = 0;
            if ( v7
              || v19 != nullptr
              && (v22 = ((int (__fastcall *)(idJob *))v19->__vftable[2].dtr_idClass)(a1: v19),
                  LODWORD(v21) = v13->count,
                  HIDWORD(v21) = v22,
                  v22 > (int)v21) )
            {
              HIDWORD(v21) = v21;
            }
            v23 = va::va(
                    this: &v53,
                    fmt: "%d / %d ",
                    a3: v21,
                    a4: v16,
                    a5: v18,
                    a6: v45,
                    a7: v46,
                    a8: v47,
                    a9: v48,
                    a10: v49,
                    a11: v50);
            idStr::Append(this: &v51.name, text: v23);
          }
          if ( v13->triggerMessage.index < 0 )
          {
            LocalizedString = idStrId::GetLocalizedString(this: &v13->inventoryDecl->displayName);
            String = (char *)idLocalization::GetString(inString: LocalizedString);
          }
          else
          {
            String = (char *)idStrId::GetLocalizedString(this: &v13->triggerMessage);
          }
          idStr::Append(this: &v51.name, text: String);
        }
        else
        {
          idStr::Append(this: &v51.name, text: "Error in item decl!");
        }
        goto LABEL_53;
      case JOBCOMPLETE_TRIGGER:
        if ( CompletionRequirement->triggerMessage.index < 0 )
          goto LABEL_53;
        LODWORD(v26) = CompletionRequirement->count;
        if ( (int)v26 > 1 )
        {
          HIDWORD(v26) = job->triggeredCount;
          LODWORD(v9) = CompletionRequirement->showTrackerMessage;
          v27 = va::va(
                  this: &v53,
                  fmt: "%d / %d ",
                  a3: v26,
                  a4: v10,
                  a5: v9,
                  a6: v45,
                  a7: v46,
                  a8: v47,
                  a9: v48,
                  a10: v49,
                  a11: v50);
          idStr::Append(this: &v51.name, text: v27);
        }
        v28 = (char *)idStrId::GetLocalizedString(this: &v13->triggerMessage);
        idStr::Append(this: &v51.name, text: v28);
        status = job->status;
        if ( status != JOBSTATUS_READYTOTURNIN && status != JOBSTATUS_COMPLETED )
          goto LABEL_53;
        break;
      case JOBCOMPLETE_JUSTDISPLAY:
        index = CompletionRequirement->triggerMessage.index;
        p_triggerMessage = &CompletionRequirement->triggerMessage;
        if ( index < 0 )
          goto LABEL_53;
        v31 = (char *)idStrId::GetLocalizedString(this: p_triggerMessage);
        idStr::Append(this: &v51.name, text: v31);
        v32 = job->status;
        if ( v32 != JOBSTATUS_COMPLETED )
        {
          if ( !v13->justDisplayCountsReadyAsComplete )
            goto LABEL_53;
          status = job->status;
          if ( v32 != JOBSTATUS_READYTOTURNIN )
            goto LABEL_53;
        }
        break;
      case JOBCOMPLETE_GAMESTATEINT:
        v33 = CompletionRequirement->triggerMessage.index;
        v34 = &CompletionRequirement->triggerMessage;
        if ( v33 < 0 )
          goto LABEL_53;
        v35 = (char *)idStrId::GetLocalizedString(this: v34);
        idStr::Append(this: &v51.name, text: v35);
        v36 = idJobManager::GetGameStateIntValue(this: &this->jobManager, gameState: v13->gameStateIntDecl) < v13->count;
LABEL_51:
        if ( v36 )
          goto LABEL_53;
        break;
      case JOBCOMPLETE_JOB:
        v37 = CompletionRequirement->triggerMessage.index;
        v38 = &CompletionRequirement->triggerMessage;
        if ( v37 >= 0 )
        {
          v39 = (char *)idStrId::GetLocalizedString(this: v38);
          idStr::Append(this: &v51.name, text: v39);
        }
        InventoryItemByDeclName = idInventoryCollection::FindInventoryItemByDeclName(
                                    this: &this->jobManager,
                                    jobName: v13->jobDecl.data);
        if ( InventoryItemByDeclName == nullptr || InventoryItemByDeclName->status != JOBSTATUS_COMPLETED )
          goto LABEL_53;
        break;
      case JOBCOMPLETE_JOB_ACCEPTED:
        v41 = CompletionRequirement->triggerMessage.index;
        v42 = &CompletionRequirement->triggerMessage;
        if ( v41 >= 0 )
        {
          v43 = (char *)idStrId::GetLocalizedString(this: v42);
          idStr::Append(this: &v51.name, text: v43);
        }
        v44 = idInventoryCollection::FindInventoryItemByDeclName(this: &this->jobManager, jobName: v13->jobDecl.data);
        if ( v44 == nullptr )
          goto LABEL_53;
        v36 = v44->status < JOBSTATUS_ACCEPTED;
        goto LABEL_51;
      default:
        goto LABEL_53;
    }
    v51.graphValid = true;
LABEL_53:
    if ( v51.name.len != 0 )
      idList<idPlayer::jobMessage_t,5>::Append(this: messages, obj: &v51);
LABEL_55:
    idStr::FreeData(this: &v51.name);
  }
}


// ========================================================================
// __unwind$539598_0
// EA  : 0x82E7142C
// RVA : 0x00E7142C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539598_0()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4352 + 80));
}


// ========================================================================
// __unwind$539590
// EA  : 0x82E71454
// RVA : 0x00E71454
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539590()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4352 + 80));
}


// ========================================================================
// ?TakeViewNotes@idPlayer@@QAAXXZ
// EA  : 0x82E71488
// RVA : 0x00E71488
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

// local variable allocation has failed, the output may be wrong!
void __fastcall idPlayer::TakeViewNotes(idPlayer *this)
{
  int v2; // r28
  idPresentable *presentable; // r3
  int v4; // r3
  __int64 v5; // r6
  __int64 v6; // r10
  __int64 v7; // r8
  va *v8; // r3
  double v9; // fp31
  double v10; // fp30
  const char *v11; // r3
  __int128 v12; // r7 OVERLAPPED
  __int64 v13; // r10
  va *v14; // r3
  idPresentable *v15; // r3
  idPresentablePlayer *v16; // r3
  idSWF *PlayerGui; // r30
  char *v18; // r29
  idStr *v19; // r27
  idSWFScriptFunction *v20; // r4
  const char *v21; // r3
  __int64 v22; // fp31
  __int64 v23; // r10
  __int64 v24; // r8
  va *v25; // r3
  __int64 v26; // r10
  __int64 v27; // r6
  __int64 v28; // r8
  va *v29; // r3
  int valueInteger; // r26
  int v31; // r26
  int v32; // r26
  int v33; // r26
  idSWFScriptFunction *v34; // r3
  idSWFScriptFunction *v35; // r4
  idStr *v36; // r29
  idStr *v37; // r26
  idStr *v38; // r3
  idSWFScriptFunction *v39; // r3
  idSWFScriptFunction *v40; // r4
  idSWFScriptFunction *v41; // r3
  idSWFScriptFunction *v42; // r4
  const char **v43; // r29
  const idStr *v44; // r23
  __int64 v45; // r6
  __int64 v46; // r10
  __int64 v47; // r8
  va *v48; // r3
  int v49; // [sp+8h] [-3218h]
  int v50; // [sp+8h] [-3218h]
  int v51; // [sp+8h] [-3218h]
  int v52; // [sp+8h] [-3218h]
  int v53; // [sp+Ch] [-3214h]
  int v54; // [sp+Ch] [-3214h]
  int v55; // [sp+Ch] [-3214h]
  int v56; // [sp+Ch] [-3214h]
  int v57; // [sp+10h] [-3210h]
  int v58; // [sp+10h] [-3210h]
  int v59; // [sp+10h] [-3210h]
  int v60; // [sp+10h] [-3210h]
  int v61; // [sp+14h] [-320Ch]
  int v62; // [sp+14h] [-320Ch]
  int v63; // [sp+14h] [-320Ch]
  int v64; // [sp+14h] [-320Ch]
  int v65; // [sp+18h] [-3208h]
  int v66; // [sp+18h] [-3208h]
  int v67; // [sp+18h] [-3208h]
  int v68; // [sp+18h] [-3208h]
  int v69; // [sp+1Ch] [-3204h]
  int v70; // [sp+1Ch] [-3204h]
  int v71; // [sp+1Ch] [-3204h]
  int v72; // [sp+1Ch] [-3204h]
  idSWFScriptVar v73; // [sp+50h] [-31D0h] BYREF
  idSWFScriptVar v74; // [sp+58h] [-31C8h] BYREF
  idSWFScriptVar v75; // [sp+60h] [-31C0h] BYREF
  idSWFScriptVar v76; // [sp+68h] [-31B8h] BYREF
  idSWFScriptVar v77; // [sp+70h] [-31B0h] BYREF
  idStr *v78; // [sp+78h] [-31A8h]
  idSWFScriptVar v79; // [sp+80h] [-31A0h] BYREF
  idStr *v80; // [sp+88h] [-3198h]
  idSWFScriptVar v81; // [sp+90h] [-3190h] BYREF
  idSWFScriptVar v82; // [sp+98h] [-3188h] BYREF
  idSWFScriptVar v83; // [sp+A0h] [-3180h] BYREF
  idSWFScriptVar v84; // [sp+A8h] [-3178h] BYREF
  idSWFScriptVar v85; // [sp+B0h] [-3170h] BYREF
  idSWFScriptVar v86; // [sp+B8h] [-3168h] BYREF
  idSWFScriptVar v87; // [sp+C0h] [-3160h] BYREF
  idSWFScriptVar v88; // [sp+C8h] [-3158h] BYREF
  idSWFScriptVar v89; // [sp+D0h] [-3150h] BYREF
  idVec3 v90[2]; // [sp+D8h] [-3148h] BYREF
  idMat3 v91; // [sp+F0h] [-3130h] BYREF
  idStr v92; // [sp+120h] [-3100h] BYREF
  idStr v93; // [sp+140h] [-30E0h] BYREF
  idStr v94; // [sp+160h] [-30C0h] BYREF
  idStr v95; // [sp+180h] [-30A0h] BYREF
  idStr v96; // [sp+1A0h] [-3080h] BYREF
  va v97; // [sp+1C0h] [-3060h] BYREF
  va v98; // [sp+11C0h] [-2060h] BYREF
  va v99; // [sp+21C0h] [-1060h] BYREF

  v2 = 0;
  if ( (_S18_22 & 1) == 0 )
  {
    _S18_22 |= 1u;
    viewNoteTitle.len = 0;
    viewNoteTitle.allocedAndFlag = 20;
    viewNoteTitle.data = viewNoteTitle.baseBuffer;
    viewNoteTitle.baseBuffer[0] = 0;
    atexit(func: (void (__fastcall *)())_idPlayer::TakeViewNotes_::_2_::_dynamic_atexit_destructor_for__viewNoteTitle__);
  }
  if ( (_S18_22 & 2) == 0 )
  {
    _S18_22 |= 2u;
    viewNoteDescription.len = 0;
    viewNoteDescription.allocedAndFlag = 20;
    viewNoteDescription.data = viewNoteDescription.baseBuffer;
    viewNoteDescription.baseBuffer[0] = 0;
    atexit(func: (void (__fastcall *)())_idPlayer::TakeViewNotes_::_2_::_dynamic_atexit_destructor_for__viewNoteDescription__);
  }
  if ( (_S18_22 & 4) == 0 )
  {
    _S18_22 |= 4u;
    viewNoteDescriptionLine.len = 0;
    viewNoteDescriptionLine.allocedAndFlag = 20;
    viewNoteDescriptionLine.data = viewNoteDescriptionLine.baseBuffer;
    viewNoteDescriptionLine.baseBuffer[0] = 0;
    atexit(func: (void (__fastcall *)())_idPlayer::TakeViewNotes_::_2_::_dynamic_atexit_destructor_for__viewNoteDescriptionLine__);
  }
  if ( (_S18_22 & 8) == 0 )
  {
    _S18_22 |= 8u;
    viewNoteStepsToReproduce.len = 0;
    viewNoteStepsToReproduce.allocedAndFlag = 20;
    viewNoteStepsToReproduce.data = viewNoteStepsToReproduce.baseBuffer;
    viewNoteStepsToReproduce.baseBuffer[0] = 0;
    atexit(func: (void (__fastcall *)())_idPlayer::TakeViewNotes_::_2_::_dynamic_atexit_destructor_for__viewNoteStepsToReproduce__);
  }
  if ( (_S18_22 & 0x10) == 0 )
  {
    _S18_22 |= 0x10u;
    timeStampString.len = 0;
    timeStampString.allocedAndFlag = 20;
    timeStampString.data = timeStampString.baseBuffer;
    timeStampString.baseBuffer[0] = 0;
    atexit(func: (void (__fastcall *)())_idPlayer::TakeViewNotes_::_2_::_dynamic_atexit_destructor_for__timeStampString__);
  }
  presentable = this->presentable;
  if ( presentable != nullptr )
    v4 = (int)presentable->GetPlayerInterface_2(this: presentable);
  else
    v4 = 0;
  idView::GetViewPos(this: (idView *)(v4 + 16224), origin: v90, axis: &v91);
  idReportData::SetDefaults(this: &reportData);
  HIDWORD(v5) = reportData.mapPath.data;
  v8 = va::va(
         this: &v97,
         fmt: "viewnotes/%s/",
         a3: v5,
         a4: v7,
         a5: v6,
         a6: v49,
         a7: v53,
         a8: v57,
         a9: v61,
         a10: v65,
         a11: v69);
  idStr::idStr(this: &v92, text: v8);
  v9 = idVec3::ToPitch(this: v91.mat);
  v10 = idVec3::ToYaw(this: v91.mat);
  v11 = idVec3::ToString(this: (idAngles *)v90, precision: 2);
  *((double *)&v12 + 1) = v9;
  LODWORD(v13) = &unk_82360000;
  DWORD1(v12) = v11;
  v14 = va::va(
          this: &v98,
          fmt: "%s %.2f %.2f",
          a3: *(__int64 *)((char *)&v12 + 4),
          a4: *(__int64 *)((char *)&v12 - 4),
          a5: v13,
          a6: v50,
          a7: v54,
          a8: v58,
          a9: v62,
          a10: v66,
          a11: v70,
          v10,
          v9);
  idStr::idStr(this: &v93, text: v14);
  v15 = this->presentable;
  if ( v15 != nullptr )
    v16 = v15->GetPlayerInterface_2(this: v15);
  else
    v16 = nullptr;
  PlayerGui = idPresentablePlayer::GetPlayerGui(this: v16, g: GUI_VIEWNOTE);
  v18 = (char *)idMem::AllocWithLocation(
                  this: &mem,
                  location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                  size: 0x28u,
                  tag: TAG_SWF,
                  zeroBuffer: false,
                  align: ALIGN_16,
                  heap: HEAP_DEFAULTHEAP);
  v78 = (idStr *)v18;
  if ( v18 != nullptr )
  {
    v19 = idStr::idStr(this: &v94, text: &v92);
    v80 = v19;
    *((_DWORD *)v18 + 1) = 0;
    *(_DWORD *)v18 = &`idPlayer::TakeViewNotes'::`3'::idSWFScriptFunction_TakeViewNotes::`vftable';
    idStr::idStr(this: (idStr *)(v18 + 8), text: v19);
    idStr::FreeData(this: v19);
    v20 = (idSWFScriptFunction *)v18;
  }
  else
  {
    v20 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v87, nf: v20);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "takeViewNote", value: &v87);
  idSWFScriptVar::Free(this: &v87);
  v21 = idVec3::ToString(this: (idAngles *)v90, precision: 2);
  idSWFScriptVar::idSWFScriptVar(this: &v85, s: v21);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "playerOrigin", value: &v85);
  idSWFScriptVar::Free(this: &v85);
  *(double *)&v22 = idVec3::ToPitch(this: v91.mat);
  idVec3::ToYaw(this: v91.mat);
  HIDWORD(v23) = &unk_82360000;
  v25 = va::va(
          this: &v99,
          fmt: "%.2f %.2f",
          a3: v22,
          a4: v24,
          a5: v23,
          a6: v51,
          a7: v55,
          a8: v59,
          a9: v63,
          a10: v67,
          a11: v71);
  v79.type = SWF_VAR_UNDEF;
  idSWFScriptVar::SetString(this: &v79, s: v25);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "playerAngles", value: &v79);
  idSWFScriptVar::Free(this: &v79);
  if ( idIssueReport::ReportToHansoft() )
  {
    idSWFScriptVar::idSWFScriptVar(this: &v84, s: reportData.userName.data);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "reportedByVar", value: &v84);
    idSWFScriptVar::Free(this: &v84);
    LODWORD(v26) = 0x82000000;
    HIDWORD(v27) = reportData.buildNumberMinor;
    v29 = va::va(
            this: &v99,
            fmt: "%d",
            a3: v27,
            a4: v28,
            a5: v26,
            a6: v52,
            a7: v56,
            a8: v60,
            a9: v64,
            a10: v68,
            a11: v72);
    v81.type = SWF_VAR_UNDEF;
    idSWFScriptVar::SetString(this: &v81, s: v29);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "buildUsedVar", value: &v81);
    idSWFScriptVar::Free(this: &v81);
    idSWFScriptVar::idSWFScriptVar(this: &v89, s: reportData.mapPath.data);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "mapPathVar", value: &v89);
    idSWFScriptVar::Free(this: &v89);
    idSWFScriptVar::idSWFScriptVar(this: &v82, s: reportData.platform.data);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "platformVar", value: &v82);
    idSWFScriptVar::Free(this: &v82);
  }
  v74.type = SWF_VAR_UNDEF;
  valueInteger = g_viewNoteDevTrack.valueInteger;
  idSWFScriptVar::Free(this: &v74);
  v74.value.i = valueInteger;
  v74.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "sendToDevtrackSelection", value: &v74);
  idSWFScriptVar::Free(this: &v74);
  v75.type = SWF_VAR_UNDEF;
  v31 = g_viewNotePriority.valueInteger;
  idSWFScriptVar::Free(this: &v75);
  v75.value.i = v31;
  v75.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "prioritySelection", value: &v75);
  idSWFScriptVar::Free(this: &v75);
  v73.type = SWF_VAR_UNDEF;
  v32 = g_viewNoteType.valueInteger;
  idSWFScriptVar::Free(this: &v73);
  v73.value.i = v32;
  v73.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "typeSelection", value: &v73);
  idSWFScriptVar::Free(this: &v73);
  v77.type = SWF_VAR_UNDEF;
  v33 = g_viewNoteRepeat.valueInteger;
  idSWFScriptVar::Free(this: &v77);
  v77.value.i = v33;
  v77.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "repeatSelection", value: &v77);
  idSWFScriptVar::Free(this: &v77);
  v34 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 8u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v34 != nullptr )
  {
    v34[1].__vftable = nullptr;
    v35 = v34;
    v34->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::TakeViewNotes'::`5'::idSWFScriptFunction_CloseTakeViewNotes::`vftable';
  }
  else
  {
    v35 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v83, nf: v35);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "closeTakeViewNote", value: &v83);
  idSWFScriptVar::Free(this: &v83);
  v36 = (idStr *)idMem::AllocWithLocation(
                   this: &mem,
                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                   size: 0x48u,
                   tag: TAG_SWF,
                   zeroBuffer: false,
                   align: ALIGN_16,
                   heap: HEAP_DEFAULTHEAP);
  v80 = v36;
  if ( v36 != nullptr )
  {
    v78 = &v94;
    v37 = idStr::idStr(this: &v94, text: &v93);
    v38 = idStr::idStr(this: &v96, text: &v92);
    _idPlayer::TakeViewNotes_::_4_::idSWFScriptFunction_TakeViewNoteScreenCap::idSWFScriptFunction_TakeViewNoteScreenCap(
      _viewNoteDirectory: v36,
      _viewOrientation: v38,
      a3: v37);
    v40 = v39;
  }
  else
  {
    v40 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v86, nf: v40);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "takeScreenCap", value: &v86);
  idSWFScriptVar::Free(this: &v86);
  v41 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 8u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v41 != nullptr )
  {
    v41[1].__vftable = nullptr;
    v42 = v41;
    v41->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::TakeViewNotes'::`2'::idSWFScriptFunction_WriteScreenCap::`vftable';
  }
  else
  {
    v42 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v88, nf: v42);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "writeScreen", value: &v88);
  idSWFScriptVar::Free(this: &v88);
  v43 = idReportData::trackerSeverity;
  do
  {
    v76.type = SWF_VAR_UNDEF;
    v44 = idStr::idStr(this: &v95, text: *v43);
    idSWFScriptVar::Free(this: &v76);
    v76.type = SWF_VAR_STRING;
    v76.value.i = (int)idSWFScriptString::Alloc(s: v44);
    idStr::FreeData(this: &v95);
    HIDWORD(v45) = v2;
    v48 = va::va(
            this: &v99,
            fmt: "severity%d",
            a3: v45,
            a4: v47,
            a5: v46,
            a6: v52,
            a7: v56,
            a8: v60,
            a9: v64,
            a10: v68,
            a11: v72);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: v48->buffer, value: &v76);
    idSWFScriptVar::Free(this: &v76);
    ++v43;
    ++v2;
  }
  while ( (int)v43 < (int)idReportData::trackerReproduced );
  idSWF::Activate(this: PlayerGui, b: true);
  idStr::FreeData(this: &v93);
  idStr::FreeData(this: &v92);
}


// ========================================================================
// __unwind$539904
// EA  : 0x82E71C3C
// RVA : 0x00E71C3C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539904()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 12832 + 288));
}


// ========================================================================
// __unwind$539905
// EA  : 0x82E71C64
// RVA : 0x00E71C64
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539905()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 12832 + 320));
}


// ========================================================================
// __unwind$539906
// EA  : 0x82E71C8C
// RVA : 0x00E71C8C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539906()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 12832 + 120), tag: TAG_SWF);
}


// ========================================================================
// __unwind$540096
// EA  : 0x82E71CB8
// RVA : 0x00E71CB8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540096()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 12832 + 136));
}


// ========================================================================
// __unwind$540097
// EA  : 0x82E71CE0
// RVA : 0x00E71CE0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540097()
{
  int v0; // r12

  idMainMenu::idSWFScriptFunction_setUseVibrate::~idSWFScriptFunction_setUseVibrate(this: *(idSWFScriptFunction_RefCounted **)(v0 - 12832 + 120));
}


// ========================================================================
// __unwind$539908
// EA  : 0x82E71D08
// RVA : 0x00E71D08
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539908()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 192));
}


// ========================================================================
// __unwind$539909
// EA  : 0x82E71D30
// RVA : 0x00E71D30
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539909()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 176));
}


// ========================================================================
// __unwind$539910
// EA  : 0x82E71D58
// RVA : 0x00E71D58
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539910()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 128));
}


// ========================================================================
// __unwind$539911
// EA  : 0x82E71D80
// RVA : 0x00E71D80
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539911()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 168));
}


// ========================================================================
// __unwind$539912
// EA  : 0x82E71DA8
// RVA : 0x00E71DA8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539912()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 144));
}


// ========================================================================
// __unwind$539913
// EA  : 0x82E71DD0
// RVA : 0x00E71DD0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539913()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 208));
}


// ========================================================================
// __unwind$539914
// EA  : 0x82E71DF8
// RVA : 0x00E71DF8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539914()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 152));
}


// ========================================================================
// __unwind$539915
// EA  : 0x82E71E20
// RVA : 0x00E71E20
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539915()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 88));
}


// ========================================================================
// __unwind$539916
// EA  : 0x82E71E48
// RVA : 0x00E71E48
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539916()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 96));
}


// ========================================================================
// __unwind$539917
// EA  : 0x82E71E70
// RVA : 0x00E71E70
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539917()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 80));
}


// ========================================================================
// __unwind$539918
// EA  : 0x82E71E98
// RVA : 0x00E71E98
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539918()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 112));
}


// ========================================================================
// __unwind$539920
// EA  : 0x82E71EC0
// RVA : 0x00E71EC0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539920()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 160));
}


// ========================================================================
// __unwind$539921
// EA  : 0x82E71EE8
// RVA : 0x00E71EE8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539921()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 12832 + 136), tag: TAG_SWF);
}


// ========================================================================
// __unwind$539922
// EA  : 0x82E71F14
// RVA : 0x00E71F14
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539922()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: *(idStr **)(v0 - 12832 + 120));
}


// ========================================================================
// __unwind$539924_1
// EA  : 0x82E71F3C
// RVA : 0x00E71F3C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539924_1()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 184));
}


// ========================================================================
// __unwind$539926_0
// EA  : 0x82E71F64
// RVA : 0x00E71F64
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539926_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 200));
}


// ========================================================================
// __unwind$540318
// EA  : 0x82E71F8C
// RVA : 0x00E71F8C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540318()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 12832 + 384));
}


// ========================================================================
// __unwind$539927_0
// EA  : 0x82E71FB4
// RVA : 0x00E71FB4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_539927_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 12832 + 104));
}


// ========================================================================
// `idPlayer::TakeViewNotes'::`3'::idSWFScriptFunction_TakeViewNotes::Call
// EA  : 0x82E71FE8
// RVA : 0x00E71FE8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::TakeViewNotes_::_3_::idSWFScriptFunction_TakeViewNotes::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        idSWFScriptVar **a4)
{
  char v4; // r27
  idSWFScriptVar *v8; // r3
  bool v9; // zf
  int v10; // r4
  idCVar *v11; // r3
  int v12; // r3
  int v13; // r3
  int v14; // r3
  __int64 v15; // r10
  __int64 v16; // r8
  __int64 v17; // r6
  const char *i; // r4
  char *v19; // r3
  idStr *v20; // r3
  __int64 v21; // r8
  __int64 v22; // r10
  va *v23; // r3
  int v25; // [sp+8h] [-1138h]
  int v26; // [sp+Ch] [-1134h]
  int v27; // [sp+10h] [-1130h]
  int v28; // [sp+14h] [-112Ch]
  int v29; // [sp+18h] [-1128h]
  int v30; // [sp+1Ch] [-1124h]
  idStr v31; // [sp+60h] [-10E0h] BYREF
  idStr v32; // [sp+80h] [-10C0h] BYREF
  idStr v33; // [sp+A0h] [-10A0h] BYREF
  idStr v34; // [sp+C0h] [-1080h] BYREF
  idStr v35; // [sp+E0h] [-1060h] BYREF
  va v36; // [sp+100h] [-1040h] BYREF

  v4 = 0;
  v9 = !common->IsMultiplayer(this: common);
  v8 = *a4 + 4;
  if ( v9 )
  {
    v10 = idSWFScriptVar::ToInteger(this: v8);
    v11 = &g_viewNoteRepeat;
  }
  else
  {
    v10 = idSWFScriptVar::ToInteger(this: v8);
    v11 = &g_viewNoteComponent;
  }
  idCVar::SetInteger(this: v11, newValue: v10, force: true);
  v12 = idSWFScriptVar::ToInteger(this: *a4 + 2);
  idCVar::SetInteger(this: &g_viewNotePriority, newValue: v12, force: true);
  v13 = idSWFScriptVar::ToInteger(this: *a4 + 3);
  idCVar::SetInteger(this: &g_viewNoteType, newValue: v13, force: true);
  v14 = idSWFScriptVar::ToInteger(this: *a4 + 5);
  idCVar::SetInteger(this: &g_viewNoteDevTrack, newValue: v14, force: true);
  LODWORD(v17) = common->IsMultiplayer(this: common);
  if ( (_DWORD)v17 != 0 )
  {
    v4 = 1;
    i = (const char *)idSWFScriptVar::ToString(
                        this: (idSWFScriptVar *)&v33,
                        result: (idStr *)&(*a4)[6],
                        a3: v17,
                        a4: v16,
                        a5: v15)->value.i;
  }
  else
  {
    i = &byte_8200D768;
  }
  idStr::operator=(this: &viewNoteStepsToReproduce, text: i);
  if ( (v4 & 1) != 0 )
    idStr::FreeData(this: &v33);
  idStr::operator=(this: &timeStampString, text: "__");
  v19 = (char *)Sys_DateStr(padded: true);
  idStr::Append(this: &timeStampString, text: v19);
  idStr::ReplaceChar(this: &timeStampString, oldChar: 47, newChar: 95);
  idStr::ReplaceChar(this: &timeStampString, oldChar: 92, newChar: 95);
  idStr::ReplaceChar(this: &timeStampString, oldChar: 9, newChar: 95);
  idStr::ReplaceChar(this: &timeStampString, oldChar: 58, newChar: 95);
  idStr::ReplaceChar(this: &timeStampString, oldChar: 32, newChar: 95);
  operator+(result: &v32, a: &reportData.userName, b: &timeStampString);
  operator+(result: &v31, a: (const idStr *)&thisObject->variables.num, b: &reportData.userName);
  v20 = operator+(result: &v35, a: &viewNoteTitle, b: ": ");
  operator+(result: &v34, a: v20, b: &viewNoteDescriptionLine);
  idStr::FreeData(this: &v35);
  HIDWORD(v21) = viewNoteTitle.data;
  v23 = va::va(
          this: &v36,
          fmt: "recordViewNotes %s \"%s\" \"%s\"\n",
          a3: __SPAIR64__((unsigned int)v31.data, (unsigned int)v32.data),
          a4: v21,
          a5: v22,
          a6: v25,
          a7: v26,
          a8: v27,
          a9: v28,
          a10: v29,
          a11: v30);
  cmdSystem->ExecuteCommandText(this: cmdSystem, a2: v23->buffer);
  idCVar::SetBool(this: &g_showHud, newValue: true, force: true);
  idCVar::SetBool(this: &g_stopTime, newValue: false, force: true);
  idCVar::SetBool(this: &con_noPrint, newValue: false, force: true);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->type = SWF_VAR_BOOL;
  result->value.b = true;
  idStr::FreeData(this: &v34);
  idStr::FreeData(this: &v31);
  idStr::FreeData(this: &v32);
  return result;
}


// ========================================================================
// __unwind$540505
// EA  : 0x82E722D8
// RVA : 0x00E722D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540505()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 4416;
  if ( (*(_DWORD *)(v0 - 4416 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v1 + 160));
  }
}


// ========================================================================
// __unwind$540508
// EA  : 0x82E7231C
// RVA : 0x00E7231C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540508()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4416 + 128));
}


// ========================================================================
// __unwind$540509
// EA  : 0x82E72344
// RVA : 0x00E72344
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540509()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4416 + 96));
}


// ========================================================================
// __unwind$540510
// EA  : 0x82E7236C
// RVA : 0x00E7236C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540510()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4416 + 224));
}


// ========================================================================
// __unwind$540511
// EA  : 0x82E72394
// RVA : 0x00E72394
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540511()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 4416 + 192));
}


// ========================================================================
// __unwind$540512
// EA  : 0x82E723BC
// RVA : 0x00E723BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540512()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 4416;
  if ( (*(_DWORD *)(v0 - 4416 + 80) & 2) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~2u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 4436));
  }
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`3'::idSWFScriptFunction_PlayerGarage_RefreshQuickItems::Call
// EA  : 0x82E72408
// RVA : 0x00E72408
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_3_::idSWFScriptFunction_PlayerGarage_RefreshQuickItems::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idSWFScriptVar *v3; // r29
  int v5; // r15
  int v6; // r30
  bfx::Planner3D *v7; // r3
  idInventoryCollection *v8; // r3
  idVehicleQuickItem *InventoryItem; // r3
  idStrId *v10; // r29
  idSWFScriptObject *v11; // r30
  const char *v12; // r4
  int v13; // r11
  const idStr *v14; // r14
  idStrId *DisplayName; // r3
  int index; // r14
  int v17; // r14
  const char *v18; // r4
  const idStr *v19; // r14
  int v20; // r3
  idSWFScriptVar::swfScriptVarValue_t v21; // r14
  idSWFScriptVar::swfScriptVarValue_t v22; // r29
  bfx::Planner3D *v24; // r3
  int v26; // [sp+50h] [-120h]
  idInventoryItem v27; // [sp+54h] [-11Ch] BYREF
  idSWFScriptString *v28; // [sp+7Ch] [-F4h]
  idSWFScriptVar v29; // [sp+80h] [-F0h] BYREF
  idSWFScriptVar v30; // [sp+88h] [-E8h] BYREF
  idStr v31; // [sp+90h] [-E0h] BYREF
  idStr v32[6]; // [sp+B0h] [-C0h] BYREF

  v3 = result;
  v5 = 0;
  v6 = 0;
  v26 = 0;
  v7 = (bfx::Planner3D *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.size + 468))(a1: thisObject->variables.size);
  if ( (int)idScriptObject::GetTypeDef(this: v7) > 0 )
  {
    do
    {
      v8 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.size + 468))(a1: thisObject->variables.size);
      InventoryItem = (idVehicleQuickItem *)idInventoryCollection::GetInventoryItem(this: v8, index: v6);
      v10 = (idStrId *)idVehicleQuickItem::CastTo(c: InventoryItem);
      if ( v10 != nullptr )
      {
        v11 = idSWFScriptObject::Alloc();
        v12 = &byte_8200D768;
        v13 = *(_DWORD *)(v10[3].index + 212);
        if ( v13 != 0 )
          v12 = *(const char **)(v13 + 8);
        v27.decl = (const idDeclInventory *)4;
        v14 = idStr::idStr(this: &v31, text: v12);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v27.decl);
        v27.decl = (const idDeclInventory *)1;
        v27.count = (int)idSWFScriptString::Alloc(s: v14);
        idStr::FreeData(this: &v31);
        idSWFScriptObject::Set(this: v11, name: "icon", value: (idSWFScriptVar *)&v27.decl);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v27.decl);
        DisplayName = idInventoryItem::GetDisplayName(this: &v27, result: v10);
        *(_DWORD *)&v27.forSale = 4;
        index = DisplayName->index;
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v27.forSale);
        v27.quickSlot = index;
        *(_DWORD *)&v27.forSale = 0;
        idSWFScriptObject::Set(this: v11, name: "name", value: (idSWFScriptVar *)&v27.forSale);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v27.forSale);
        v17 = v10[6].index;
        v27.counttosave = 4;
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v27.counttosave);
        v27.coolDownTime = v17;
        v27.counttosave = 6;
        idSWFScriptObject::Set(this: v11, name: "slot", value: (idSWFScriptVar *)&v27.counttosave);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v27.counttosave);
        v18 = *(const char **)(v10[3].index + 8);
        v27.skinPreload = (const idDeclSkins *)4;
        v19 = idStr::idStr(this: v32, text: v18);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v27.skinPreload);
        v27.skinPreload = (const idDeclSkins *)1;
        v28 = idSWFScriptString::Alloc(s: v19);
        idStr::FreeData(this: v32);
        idSWFScriptObject::Set(this: v11, name: "decl", value: (idSWFScriptVar *)&v27.skinPreload);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v27.skinPreload);
        v20 = (*(int (__fastcall **)(idStrId *))(v10->index + 52))(a1: v10);
        v29.type = SWF_VAR_UNDEF;
        v21.i = v20;
        idSWFScriptVar::Free(this: &v29);
        v29.value = v21;
        v29.type = SWF_VAR_INTEGER;
        idSWFScriptObject::Set(this: v11, name: "count", value: &v29);
        idSWFScriptVar::Free(this: &v29);
        v22.f = *(float *)(v10[3].index + 200);
        v30.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v30);
        v30.value = v22;
        v30.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v11, name: "desc", value: &v30);
        idSWFScriptVar::Free(this: &v30);
        v27.listenerList = (idList<idEventReceiver *,5> *)4;
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v27.listenerList);
        if ( v11 != nullptr )
        {
          v27.listeningToList = (idList<idEventReceiver *,5> *)v11;
          v27.listenerList = (idList<idEventReceiver *,5> *)8;
          ++v11->refCount;
        }
        else
        {
          v27.listenerList = (idList<idEventReceiver *,5> *)3;
        }
        idSWFScriptObject::Set(
          this: (idSWFScriptObject *)thisObject->variables.num,
          index: v5++,
          value: (const idSWFScriptVar *)&v27.listenerList);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v27.listenerList);
        if ( v11->refCount-- == 1 )
        {
          idSWFScriptObject::~idSWFScriptObject(this: v11);
          idMem::Free(this: &mem, ptr: v11, align: ALIGN_16);
        }
        v6 = v26;
      }
      v26 = ++v6;
      v24 = (bfx::Planner3D *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.size + 468))(a1: thisObject->variables.size);
    }
    while ( v6 < (int)idScriptObject::GetTypeDef(this: v24) );
    v3 = result;
  }
  v3->type = SWF_VAR_UNDEF;
  return v3;
}


// ========================================================================
// __unwind$540673
// EA  : 0x82E7272C
// RVA : 0x00E7272C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540673()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 368 + 144));
}


// ========================================================================
// __unwind$540641
// EA  : 0x82E72754
// RVA : 0x00E72754
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540641()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 368 + 96));
}


// ========================================================================
// __unwind$540642
// EA  : 0x82E7277C
// RVA : 0x00E7277C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540642()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 368 + 104));
}


// ========================================================================
// __unwind$540643
// EA  : 0x82E727A4
// RVA : 0x00E727A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540643()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 368 + 112));
}


// ========================================================================
// __unwind$540750
// EA  : 0x82E727CC
// RVA : 0x00E727CC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540750()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 368 + 176));
}


// ========================================================================
// __unwind$540644
// EA  : 0x82E727F4
// RVA : 0x00E727F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540644()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 368 + 120));
}


// ========================================================================
// __unwind$540645
// EA  : 0x82E7281C
// RVA : 0x00E7281C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540645()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 368 + 128));
}


// ========================================================================
// __unwind$540646
// EA  : 0x82E72844
// RVA : 0x00E72844
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540646()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 368 + 136));
}


// ========================================================================
// __unwind$540647
// EA  : 0x82E7286C
// RVA : 0x00E7286C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540647()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 368 + 88));
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`5'::idSWFScriptFunction_PlayerGarage_IsItemEquipped::Call
// EA  : 0x82E728A0
// RVA : 0x00E728A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_5_::idSWFScriptFunction_PlayerGarage_IsItemEquipped::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        __int64 parms,
        __int64 a4,
        __int64 a5)
{
  idJobManager *v8; // r3
  idJob *InventoryItemByDeclName; // r11
  idStr v10[2]; // [sp+60h] [-40h] BYREF

  LODWORD(a5) = *(_DWORD *)(parms + 4);
  if ( (_DWORD)a5 == 1 )
  {
    idSWFScriptVar::ToString(this: (idSWFScriptVar *)v10, result: *(idStr **)parms, a3: parms, a4, a5);
    v8 = (idJobManager *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.size + 468))(a1: thisObject->variables.size);
    if ( v8 != nullptr
      && (InventoryItemByDeclName = idInventoryCollection::FindInventoryItemByDeclName(this: v8, jobName: v10[0].data)) != nullptr )
    {
      idSWFScriptVar::idSWFScriptVar(
        this: result,
        i: (idSWFScriptVar::swfScriptVarValue_t *)InventoryItemByDeclName->triggeredCount);
    }
    else
    {
      result->type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: result);
      result->type = SWF_VAR_INTEGER;
      result->value.i = -1;
    }
    idStr::FreeData(this: v10);
    return result;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->type = SWF_VAR_INTEGER;
    result->value.i = -1;
    return result;
  }
}


// ========================================================================
// __unwind$540934
// EA  : 0x82E72984
// RVA : 0x00E72984
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540934()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 160;
  if ( (*(_DWORD *)(v0 - 160 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 180));
  }
}


// ========================================================================
// __unwind$540937_0
// EA  : 0x82E729C8
// RVA : 0x00E729C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_540937_0()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 160 + 96));
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`6'::idSWFScriptFunction_PlayerGarage_UnequipItem::Call
// EA  : 0x82E729F8
// RVA : 0x00E729F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_6_::idSWFScriptFunction_PlayerGarage_UnequipItem::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        __int64 parms,
        __int64 a4,
        __int64 a5)
{
  idJobManager *v8; // r30
  const idDeclJob *v9; // r4
  idGuiListBox *JobByDecl; // r3
  idStr v11[2]; // [sp+60h] [-50h] BYREF

  if ( *(_DWORD *)(parms + 4) == 1 )
  {
    idSWFScriptVar::ToString(this: (idSWFScriptVar *)v11, result: *(idStr **)parms, a3: parms, a4, a5);
    v8 = (idJobManager *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.size + 468))(a1: thisObject->variables.size);
    if ( v11[0].data != nullptr )
    {
      v9 = (const idDeclJob *)idDeclInfo::FindWithInheritance(
                                this: &idDeclInventory::resourceList,
                                name: v11[0].data,
                                makeDefault: true);
      if ( v9 != nullptr )
      {
        JobByDecl = (idGuiListBox *)idJobManager::FindJobByDecl(this: v8, jobDecl: v9);
        if ( JobByDecl != nullptr )
          idGuiListBox::DidActionRow(this: JobByDecl, actionRow: -1);
      }
    }
    result->type = SWF_VAR_UNDEF;
    idStr::FreeData(this: v11);
    return result;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
    return result;
  }
}


// ========================================================================
// __unwind$541004
// EA  : 0x82E72AD0
// RVA : 0x00E72AD0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_541004()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 176;
  if ( (*(_DWORD *)(v0 - 176 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 196));
  }
}


// ========================================================================
// __unwind$541007
// EA  : 0x82E72B14
// RVA : 0x00E72B14
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_541007()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 176 + 96));
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`9'::idSWFScriptFunction_PlayerGarage_PreviousBay::Call
// EA  : 0x82E72B40
// RVA : 0x00E72B40
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_9_::idSWFScriptFunction_PlayerGarage_PreviousBay::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  bool v5; // r28
  idVehicleKey *CurrentKey; // r30
  idVehicle *VehicleFromKey; // r3
  idVehicle *v8; // r31

  v5 = false;
  idTownGarageCamera::PreviousTarget(this: (idTownGarageCamera *)thisObject->variables.num);
  if ( idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num) != nullptr )
    v5 = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num)->equippedUpgrades.num != 0;
  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num);
  VehicleFromKey = idVehicleKey::GetVehicleFromKey(this: CurrentKey);
  v8 = VehicleFromKey;
  if ( VehicleFromKey != nullptr )
  {
    idVehicle::RecalcMaxArmoredHealth(this: VehicleFromKey);
    idVehicle::SetArmorFromKey(this: v8, key: CurrentKey);
    idVehicle::SetWeaponsFromKey(this: v8, key: CurrentKey);
    idVehicle::SetThemeFromKey(this: v8, key: CurrentKey);
  }
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value.b = v5;
  result->type = SWF_VAR_BOOL;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`10'::idSWFScriptFunction_PlayerGarage_NextBay::Call
// EA  : 0x82E72BF0
// RVA : 0x00E72BF0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_10_::idSWFScriptFunction_PlayerGarage_NextBay::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  bool v5; // r28
  idVehicleKey *CurrentKey; // r30
  idVehicle *VehicleFromKey; // r3
  idVehicle *v8; // r31

  v5 = false;
  idTownGarageCamera::NextTarget(this: (idTownGarageCamera *)thisObject->variables.num);
  if ( idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num) != nullptr )
    v5 = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num)->equippedUpgrades.num != 0;
  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num);
  VehicleFromKey = idVehicleKey::GetVehicleFromKey(this: CurrentKey);
  v8 = VehicleFromKey;
  if ( VehicleFromKey != nullptr )
  {
    idVehicle::RecalcMaxArmoredHealth(this: VehicleFromKey);
    idVehicle::SetArmorFromKey(this: v8, key: CurrentKey);
    idVehicle::SetWeaponsFromKey(this: v8, key: CurrentKey);
    idVehicle::SetThemeFromKey(this: v8, key: CurrentKey);
  }
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value.b = v5;
  result->type = SWF_VAR_BOOL;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`14'::idSWFScriptFunction_PlayerGarage_CanRepairVehicle::Call
// EA  : 0x82E72CA0
// RVA : 0x00E72CA0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_14_::idSWFScriptFunction_PlayerGarage_CanRepairVehicle::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idVehicleKey *CurrentKey; // r29
  _DWORD *num; // r3
  const idDeclInventory *v7; // r30
  idInventoryCollection *v8; // r3
  int TotalInventoryItemCount; // r30
  int TotalRepairCost; // r3

  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.size);
  if ( CurrentKey != nullptr
    && (num = (_DWORD *)thisObject->variables.num,
        v7 = (const idDeclInventory *)num[5849],
        v8 = (idInventoryCollection *)(*(int (__fastcall **)(_DWORD *))(*num + 464))(a1: num),
        TotalInventoryItemCount = idInventoryCollection::FindTotalInventoryItemCount(this: v8, decl: v7),
        TotalRepairCost = idVehicleKey::GetTotalRepairCost(this: CurrentKey),
        TotalInventoryItemCount > 0)
    && TotalRepairCost > 0 )
  {
    idSWFScriptVar::idSWFScriptVar(this: result, b: true);
    return result;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
    return result;
  }
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`15'::idSWFScriptFunction_PlayerGarage_RepairVehicle::Call
// EA  : 0x82E72D48
// RVA : 0x00E72D48
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_15_::idSWFScriptFunction_PlayerGarage_RepairVehicle::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idVehicleKey *CurrentKey; // r30
  _DWORD *num; // r3
  const idDeclInventory *v8; // r29
  idInventoryCollection *v9; // r3
  int TotalInventoryItemCount; // r29
  int TotalRepairCost; // r4
  idPlayer *v12; // r3

  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.size);
  if ( CurrentKey != nullptr )
  {
    num = (_DWORD *)thisObject->variables.num;
    v8 = (const idDeclInventory *)num[5849];
    v9 = (idInventoryCollection *)(*(int (__fastcall **)(_DWORD *))(*num + 464))(a1: num);
    TotalInventoryItemCount = idInventoryCollection::FindTotalInventoryItemCount(this: v9, decl: v8);
    TotalRepairCost = idVehicleKey::GetTotalRepairCost(this: CurrentKey);
    v12 = (idPlayer *)thisObject->variables.num;
    if ( TotalInventoryItemCount < TotalRepairCost )
    {
      idPlayer::RemoveCash(this: v12, amount: TotalInventoryItemCount);
      idVehicleKey::DoPartialRepair(this: CurrentKey, cash: TotalInventoryItemCount);
    }
    else
    {
      idPlayer::RemoveCash(this: v12, amount: TotalRepairCost);
      idVehicleKey::DoTotalRepair(this: CurrentKey);
    }
    result->type = SWF_VAR_UNDEF;
    return result;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
    return result;
  }
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`17'::idSWFScriptFunction_PlayerGarage_GetVehicleDamage::Call
// EA  : 0x82E72E20
// RVA : 0x00E72E20
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_17_::idSWFScriptFunction_PlayerGarage_GetVehicleDamage::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idSWFScriptVar::swfScriptVarValue_t v4; // r30
  idVehicleKey *CurrentKey; // r3

  v4.i = 0;
  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num);
  if ( CurrentKey != nullptr )
    v4.i = idVehicleKey::GetDamagePercentInt(this: CurrentKey);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v4;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`18'::idSWFScriptFunction_PlayerGarage_GetVehicleRepairCost::Call
// EA  : 0x82E72E90
// RVA : 0x00E72E90
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_18_::idSWFScriptFunction_PlayerGarage_GetVehicleRepairCost::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idSWFScriptVar::swfScriptVarValue_t v4; // r30
  idVehicleKey *CurrentKey; // r3

  v4.i = 0;
  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num);
  if ( CurrentKey != nullptr )
    v4.i = idVehicleKey::GetTotalRepairCost(this: CurrentKey);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v4;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`19'::idSWFScriptFunction_PlayerGarage_CanTune::Call
// EA  : 0x82E72F00
// RVA : 0x00E72F00
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_19_::idSWFScriptFunction_PlayerGarage_CanTune::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idVehicleKey *CurrentKey; // r3
  idSWFScriptVar::swfScriptVarType v5; // r10
  bool v6; // r30

  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num);
  if ( CurrentKey != nullptr )
  {
    v6 = CurrentKey->validUpgrades.num > 0;
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    v5 = SWF_VAR_BOOL;
    result->value.b = v6;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    v5 = SWF_VAR_INTEGER;
    result->value.i = 0;
  }
  result->type = v5;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`20'::idSWFScriptFunction_PlayerGarage_GetVehicleName::Call
// EA  : 0x82E72F90
// RVA : 0x00E72F90
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_20_::idSWFScriptFunction_PlayerGarage_GetVehicleName::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idVehicleKey *CurrentKey; // r3
  idSWFScriptVar::swfScriptVarValue_t v6; // r29

  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num);
  if ( CurrentKey != nullptr )
  {
    SLODWORD(v6.f) = CurrentKey->decl->displayName.index;
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value = v6;
    result->type = SWF_VAR_STRINGID;
    return result;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.i = 0;
    result->type = SWF_VAR_INTEGER;
    return result;
  }
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`21'::idSWFScriptFunction_PlayerGarage_GetVehicleClass::Call
// EA  : 0x82E73008
// RVA : 0x00E73008
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_21_::idSWFScriptFunction_PlayerGarage_GetVehicleClass::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idSWFScriptVar::swfScriptVarValue_t v4; // r30
  idVehicleKey *CurrentKey; // r3

  v4.i = 0;
  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num);
  if ( CurrentKey != nullptr )
    *(idDeclInventory_vtbl **)&v4.f = CurrentKey->decl[1].__vftable;
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->type = SWF_VAR_INTEGER;
  result->value = v4;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`22'::idSWFScriptFunction_PlayerGarage_GetNumTargets::Call
// EA  : 0x82E73090
// RVA : 0x00E73090
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_22_::idSWFScriptFunction_PlayerGarage_GetNumTargets::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idTownGarageCamera *num; // r3
  idSWFScriptVar::swfScriptVarValue_t v5; // r30

  num = (idTownGarageCamera *)thisObject->variables.num;
  v5.i = 0;
  if ( num != nullptr )
    v5.i = idTownGarageCamera::GetNumVehicles(this: num);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v5;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`23'::idSWFScriptFunction_PlayerGarage_GetVehiclePrestige::Call
// EA  : 0x82E730F8
// RVA : 0x00E730F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_23_::idSWFScriptFunction_PlayerGarage_GetVehiclePrestige::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idVehicleKey *CurrentKey; // r3
  idVehicle *VehicleFromKey; // r3
  idSWFScriptVar::swfScriptVarValue_t *DifficultyRating; // r3

  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.num);
  if ( CurrentKey != nullptr && (VehicleFromKey = idVehicleKey::GetVehicleFromKey(this: CurrentKey)) != nullptr )
  {
    if ( VehicleFromKey->vehicleClass == VEHICLE_CLASS1 )
    {
      idSWFScriptVar::idSWFScriptVar(this: result, i: nullptr);
    }
    else
    {
      DifficultyRating = (idSWFScriptVar::swfScriptVarValue_t *)idVehicle::GetDifficultyRating(this: VehicleFromKey);
      idSWFScriptVar::idSWFScriptVar(this: result, i: DifficultyRating);
    }
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.i = 1;
    result->type = SWF_VAR_INTEGER;
  }
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`32'::idSWFScriptFunction_PlayerGarage_GetNumVehicleKills::Call
// EA  : 0x82E73190
// RVA : 0x00E73190
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_32_::idSWFScriptFunction_PlayerGarage_GetNumVehicleKills::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idSWFScriptVar::swfScriptVarValue_t v4; // r30
  idVehicleKey *CurrentKey; // r3

  v4.i = 0;
  CurrentKey = idTownGarageCamera::GetCurrentKey(this: (idTownGarageCamera *)thisObject->variables.size);
  if ( CurrentKey != nullptr )
    SLODWORD(v4.f) = CurrentKey->numVehicleKills;
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v4;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`2'::idSWFScriptFunction_PlayerGarage_RefreshUpgrades::ValidateItem
// EA  : 0x82E73200
// RVA : 0x00E73200
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall _idPlayer::ShowVehicleTuner_::_2_::idSWFScriptFunction_PlayerGarage_RefreshUpgrades::ValidateItem(
        int *index,
        const idDeclInventory *item,
        upgradeType_t *upgradeType,
        idVehicleKey *curKey,
        idVehicleKey *currentRow,
        idList<enum encounterGroupRole_t,5> *a6)
{
  idVehicleKey_vtbl *v11; // r11
  idVehicleKey_vtbl *v12; // r10
  int v13; // r6
  idList<idDeclVehicleUpgrade const *,5> *i; // r7
  int v15; // r8
  int v16; // r10
  int v17; // r11
  bool v18; // r26
  int v19; // r10
  int v20; // r11
  idSWFScriptObject *v21; // r3
  idSWFScriptVar::swfScriptVarValue_t v22; // r20
  idSWFScriptObject *v23; // r30
  const char *v24; // r4
  const idStr *v25; // r20
  idSWFScriptVar::swfScriptVarValue_t v26; // r20
  char *IconName; // r3
  const idStr *v28; // r20
  idSWFScriptVar::swfScriptVarValue_t v29; // r27
  bool IsUpgradeEquipped; // r3
  bool v31; // r25
  idDeclInventory_vtbl *v32; // r4
  int v34; // r8
  int v35; // r10
  int v36; // r11
  const idDeclVehicleUpgrade **num; // [sp+50h] [-100h]
  const idDeclVehicleUpgrade **v38; // [sp+50h] [-100h]
  idSWFScriptVar v39; // [sp+58h] [-F8h] BYREF
  idSWFScriptVar v40; // [sp+60h] [-F0h] BYREF
  idSWFScriptVar v41; // [sp+68h] [-E8h] BYREF
  idSWFScriptVar v42; // [sp+70h] [-E0h] BYREF
  idSWFScriptVar v43; // [sp+78h] [-D8h] BYREF
  idSWFScriptVar v44; // [sp+80h] [-D0h] BYREF
  idSWFScriptVar v45; // [sp+88h] [-C8h] BYREF
  idSWFScriptVar v46; // [sp+90h] [-C0h] BYREF
  upgradeType_t *v47; // [sp+98h] [-B8h] BYREF
  idStr v48; // [sp+A0h] [-B0h] BYREF
  idStr v49[4]; // [sp+C0h] [-90h] BYREF

  if ( upgradeType != nullptr )
  {
    v11 = *((idVehicleKey_vtbl **)upgradeType + 126);
    v12 = curKey->__vftable;
    v47 = upgradeType;
    if ( v11 == v12 )
    {
      v13 = 0;
      num = (const idDeclVehicleUpgrade **)currentRow->validUpgrades.num;
      if ( (int)num > 0 )
      {
        for ( i = currentRow->validUpgrades.list; ; ++i )
        {
          v15 = i->num;
          v16 = 0;
          if ( v15 > 0 )
          {
            v17 = 0;
            while ( (upgradeType_t *)i->list[v17] != upgradeType )
            {
              ++v16;
              ++v17;
              if ( v16 >= v15 )
                goto LABEL_11;
            }
            if ( v16 != -1 )
              break;
          }
LABEL_11:
          if ( ++v13 >= (int)num )
            return;
        }
        v18 = false;
        v19 = 0;
        v38 = (const idDeclVehicleUpgrade **)currentRow->baseParts.num;
        if ( (int)v38 > 0 )
        {
          v20 = 0;
          do
          {
            if ( upgradeType == (upgradeType_t *)currentRow->baseParts.list[v20] )
              v18 = true;
            ++v19;
            ++v20;
          }
          while ( v19 < (int)v38 );
        }
        v21 = idSWFScriptObject::Alloc();
        LODWORD(v22.f) = (idSWFScriptVar::swfScriptVarValue_t)upgradeType[41];
        v23 = v21;
        v42.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v42);
        v42.value = v22;
        v42.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v23, name: "name", value: &v42);
        idSWFScriptVar::Free(this: &v42);
        v24 = *((const char **)upgradeType + 2);
        v44.type = SWF_VAR_UNDEF;
        v25 = idStr::idStr(this: &v48, text: v24);
        idSWFScriptVar::Free(this: &v44);
        v44.type = SWF_VAR_STRING;
        v44.value.i = (int)idSWFScriptString::Alloc(s: v25);
        idStr::FreeData(this: &v48);
        idSWFScriptObject::Set(this: v23, name: "decl", value: &v44);
        idSWFScriptVar::Free(this: &v44);
        LODWORD(v26.f) = (idSWFScriptVar::swfScriptVarValue_t)upgradeType[50];
        v40.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v40);
        v40.value = v26;
        v40.type = SWF_VAR_STRINGID;
        idSWFScriptObject::Set(this: v23, name: "description", value: &v40);
        idSWFScriptVar::Free(this: &v40);
        IconName = idDeclInventory::GetIconName(this: (idDeclInventory *)upgradeType);
        v46.type = SWF_VAR_UNDEF;
        v28 = idStr::idStr(this: v49, text: IconName);
        idSWFScriptVar::Free(this: &v46);
        v46.type = SWF_VAR_STRING;
        v46.value.i = (int)idSWFScriptString::Alloc(s: v28);
        idStr::FreeData(this: v49);
        idSWFScriptObject::Set(this: v23, name: "icon", value: &v46);
        idSWFScriptVar::Free(this: &v46);
        LODWORD(v29.f) = (idSWFScriptVar::swfScriptVarValue_t)upgradeType[134];
        v41.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v41);
        v41.value = v29;
        v41.type = SWF_VAR_INTEGER;
        idSWFScriptObject::Set(this: v23, name: "stage", value: &v41);
        idSWFScriptVar::Free(this: &v41);
        IsUpgradeEquipped = idVehicleKey::IsUpgradeEquipped(
                              this: currentRow,
                              decl: (const idDeclVehicleUpgrade *)upgradeType);
        v43.type = SWF_VAR_UNDEF;
        v31 = IsUpgradeEquipped;
        idSWFScriptVar::Free(this: &v43);
        v43.value.b = v31;
        v43.type = SWF_VAR_BOOL;
        idSWFScriptObject::Set(this: v23, name: "isEqupped", value: &v43);
        idSWFScriptVar::Free(this: &v43);
        v45.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v45);
        v45.value.b = v18;
        v45.type = SWF_VAR_BOOL;
        idSWFScriptObject::Set(this: v23, name: "basePart", value: &v45);
        idSWFScriptVar::Free(this: &v45);
        v39.type = SWF_VAR_UNDEF;
        idSWFScriptVar::Free(this: &v39);
        if ( v23 != nullptr )
        {
          v39.value.i = (int)v23;
          v39.type = SWF_VAR_OBJECT;
          ++v23->refCount;
        }
        else
        {
          v39.type = SWF_VAR_NULL;
        }
        v32 = item->__vftable++;
        idSWFScriptObject::Set(this: (idSWFScriptObject *)index[4], index: (int)v32, value: &v39);
        idSWFScriptVar::Free(this: &v39);
        if ( v23->refCount-- == 1 )
        {
          idSWFScriptObject::~idSWFScriptObject(this: v23);
          idMem::Free(this: &mem, ptr: v23, align: ALIGN_16);
        }
        v34 = a6->num;
        v35 = 0;
        if ( v34 <= 0 )
          goto LABEL_29;
        v36 = 0;
        while ( (upgradeType_t *)a6->list[v36] != upgradeType )
        {
          ++v35;
          ++v36;
          if ( v35 >= v34 )
            goto LABEL_29;
        }
        if ( v35 < 0 )
LABEL_29:
          idList<idAnimWebBlendTree *,5>::Append(this: a6, obj: (encounterGroupRole_t *)&v47);
      }
    }
  }
}


// ========================================================================
// __unwind$542266
// EA  : 0x82E735A4
// RVA : 0x00E735A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542266()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 112));
}


// ========================================================================
// __unwind$542357
// EA  : 0x82E735CC
// RVA : 0x00E735CC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542357()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 336 + 160));
}


// ========================================================================
// __unwind$542267
// EA  : 0x82E735F4
// RVA : 0x00E735F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542267()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 128));
}


// ========================================================================
// __unwind$542268
// EA  : 0x82E7361C
// RVA : 0x00E7361C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542268()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 96));
}


// ========================================================================
// __unwind$542409
// EA  : 0x82E73644
// RVA : 0x00E73644
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542409()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 336 + 192));
}


// ========================================================================
// __unwind$542269
// EA  : 0x82E7366C
// RVA : 0x00E7366C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542269()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 144));
}


// ========================================================================
// __unwind$542270
// EA  : 0x82E73694
// RVA : 0x00E73694
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542270()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 104));
}


// ========================================================================
// __unwind$542271
// EA  : 0x82E736BC
// RVA : 0x00E736BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542271()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 120));
}


// ========================================================================
// __unwind$542272
// EA  : 0x82E736E4
// RVA : 0x00E736E4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542272()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 136));
}


// ========================================================================
// __unwind$542273
// EA  : 0x82E7370C
// RVA : 0x00E7370C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542273()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 336 + 88));
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`3'::idSWFScriptFunction_PlayerGarage_RefreshTypes::Call
// EA  : 0x82E73740
// RVA : 0x00E73740
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_3_::idSWFScriptFunction_PlayerGarage_RefreshTypes::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int num; // r11
  int v6; // r11
  int v7; // r18
  int v8; // r19
  int v9; // r17
  idDeclInventory *v10; // r29
  idSWFScriptObject *v11; // r30
  char *IconName; // r3
  idSWFScriptVar::swfScriptVarValue_t v13; // r14
  idSWFScriptVar::swfScriptVarValue_t v14; // r14
  idSWFScriptVar::swfScriptVarValue_t v15; // r14
  idDeclInventory_vtbl *v16; // r11
  idSWFScriptVar *v17; // r3
  idSWFScriptVar v20; // [sp+50h] [-E0h] BYREF
  idSWFScriptVar v21; // [sp+58h] [-D8h] BYREF
  idSWFScriptVar v22; // [sp+60h] [-D0h] BYREF
  idSWFScriptVar v23; // [sp+68h] [-C8h] BYREF
  idSWFScriptVar v24; // [sp+70h] [-C0h] BYREF
  idSWFScriptVar v25; // [sp+78h] [-B8h] BYREF
  idSWFScriptVar v26; // [sp+80h] [-B0h] BYREF
  idSWFScriptVar v27[21]; // [sp+88h] [-A8h] BYREF

  num = thisObject->variables.num;
  v20.type = SWF_VAR_STRINGID;
  if ( num != 0 )
  {
    v20.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v20);
    v20.value.i = 0;
    v20.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "length", value: &v20);
    idSWFScriptVar::Free(this: &v20);
    v6 = thisObject->variables.num;
    v7 = 0;
    v8 = 0;
    if ( *(int *)(v6 + 88) > 0 )
    {
      v9 = 0;
      do
      {
        v10 = *(idDeclInventory **)(*(_DWORD *)(v6 + 84) + v9);
        if ( v10 != nullptr && v10[1].__vftable != (idDeclInventory_vtbl *)12 )
        {
          v11 = idSWFScriptObject::Alloc();
          IconName = idDeclInventory::GetIconName(this: v10);
          idSWFScriptVar::idSWFScriptVar(this: &v25, s: IconName);
          idSWFScriptObject::Set(this: v11, name: "icon", value: &v25);
          idSWFScriptVar::Free(this: &v25);
          SLODWORD(v13.f) = v10[1].trackedMemory;
          v21.type = SWF_VAR_UNDEF;
          idSWFScriptVar::Free(this: &v21);
          v21.value = v13;
          v21.type = SWF_VAR_STRINGID;
          idSWFScriptObject::Set(this: v11, name: "type", value: &v21);
          idSWFScriptVar::Free(this: &v21);
          SLODWORD(v14.f) = v10->displayName.index;
          v22.type = SWF_VAR_UNDEF;
          idSWFScriptVar::Free(this: &v22);
          v22.value = v14;
          v22.type = SWF_VAR_STRINGID;
          idSWFScriptObject::Set(this: v11, name: "name", value: &v22);
          idSWFScriptVar::Free(this: &v22);
          *(idDeclInventory_vtbl **)&v15.f = v10[1].__vftable;
          v23.type = SWF_VAR_UNDEF;
          idSWFScriptVar::Free(this: &v23);
          v23.value = v15;
          v23.type = SWF_VAR_INTEGER;
          idSWFScriptObject::Set(this: v11, name: "typeIndex", value: &v23);
          idSWFScriptVar::Free(this: &v23);
          v16 = v10[1].__vftable;
          if ( v16 == (idDeclInventory_vtbl *)4 || v16 == (idDeclInventory_vtbl *)10 )
          {
            v24.type = SWF_VAR_UNDEF;
            idSWFScriptVar::Free(this: &v24);
            v24.type = SWF_VAR_BOOL;
            v24.value.b = true;
            idSWFScriptObject::Set(this: v11, name: "checkRepaired", value: &v24);
            v17 = &v24;
          }
          else
          {
            idSWFScriptVar::idSWFScriptVar(this: &v26, b: false);
            idSWFScriptObject::Set(this: v11, name: "checkRepaired", value: &v26);
            v17 = &v26;
          }
          idSWFScriptVar::Free(this: v17);
          idSWFScriptVar::idSWFScriptVar(this: v27, o: v11);
          idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, index: v7++, value: v27);
          idSWFScriptVar::Free(this: v27);
          if ( v11->refCount-- == 1 )
          {
            idSWFScriptObject::~idSWFScriptObject(this: v11);
            idMem::Free(this: &mem, ptr: v11, align: ALIGN_16);
          }
        }
        v6 = thisObject->variables.num;
        ++v8;
        v9 += 4;
      }
      while ( v8 < *(_DWORD *)(v6 + 88) );
    }
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->type = SWF_VAR_BOOL;
    result->value.b = true;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
  }
  return result;
}


// ========================================================================
// __unwind$542631
// EA  : 0x82E739E8
// RVA : 0x00E739E8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542631()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 304 + 80));
}


// ========================================================================
// __unwind$542632
// EA  : 0x82E73A10
// RVA : 0x00E73A10
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542632()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 304 + 120));
}


// ========================================================================
// __unwind$542633
// EA  : 0x82E73A38
// RVA : 0x00E73A38
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542633()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 304 + 88));
}


// ========================================================================
// __unwind$542634
// EA  : 0x82E73A60
// RVA : 0x00E73A60
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542634()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 304 + 96));
}


// ========================================================================
// __unwind$542635
// EA  : 0x82E73A88
// RVA : 0x00E73A88
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542635()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 304 + 104));
}


// ========================================================================
// __unwind$542637_0
// EA  : 0x82E73AB0
// RVA : 0x00E73AB0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542637_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 304 + 128));
}


// ========================================================================
// __unwind$542636
// EA  : 0x82E73AD8
// RVA : 0x00E73AD8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542636()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 304 + 112));
}


// ========================================================================
// __unwind$542638
// EA  : 0x82E73B00
// RVA : 0x00E73B00
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_542638()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 304 + 136));
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`6'::idSWFScriptFunction_PlayerGarage_ReturnToVendor::Call
// EA  : 0x82E73B28
// RVA : 0x00E73B28
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_6_::idSWFScriptFunction_PlayerGarage_ReturnToVendor::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idPlayer::OfferWares(
    this: (idPlayer *)thisObject->variables.num,
    interaction: (idSWFScriptFunction_vtbl *)thisObject->variables.size,
    offeringAI: *(idAI2 **)&thisObject->variables.granularity,
    skipInteraction: true);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`10'::idSWFScriptFunction_PlayerGarage_VehicleRating::Call
// EA  : 0x82E73B78
// RVA : 0x00E73B78
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_10_::idSWFScriptFunction_PlayerGarage_VehicleRating::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idVehicleKey *num; // r3
  idVehicle *VehicleFromKey; // r3
  idSWFScriptVar::swfScriptVarValue_t v6; // r30

  num = (idVehicleKey *)thisObject->variables.num;
  if ( num != nullptr && (VehicleFromKey = idVehicleKey::GetVehicleFromKey(this: num)) != nullptr )
  {
    v6.i = idVehicle::GetDifficultyRating(this: VehicleFromKey);
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value = v6;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.i = 1;
  }
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`11'::idSWFScriptFunction_PlayerGarage_NeedsRepairToInstall::Call
// EA  : 0x82E73C08
// RVA : 0x00E73C08
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_11_::idSWFScriptFunction_PlayerGarage_NeedsRepairToInstall::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idVehicleKey *num; // r3
  idSWFScriptVar *v5; // r3
  int DamagePercentInt; // r3
  bool v7; // zf

  num = (idVehicleKey *)thisObject->variables.num;
  if ( num != nullptr )
  {
    DamagePercentInt = idVehicleKey::GetDamagePercentInt(this: num);
    result->type = SWF_VAR_UNDEF;
    v7 = DamagePercentInt == 0;
    v5 = result;
    if ( !v7 )
    {
      idSWFScriptVar::Free(this: result);
      result->value.b = true;
      goto LABEL_6;
    }
  }
  else
  {
    v5 = result;
    result->type = SWF_VAR_UNDEF;
  }
  idSWFScriptVar::Free(this: v5);
  result->value.b = false;
LABEL_6:
  result->type = SWF_VAR_BOOL;
  return result;
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`12'::idSWFScriptFunction_PlayerGarage_VehicleName::Call
// EA  : 0x82E73C90
// RVA : 0x00E73C90
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_12_::idSWFScriptFunction_PlayerGarage_VehicleName::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int num; // r11
  idSWFScriptVar::swfScriptVarValue_t v6; // r29

  num = thisObject->variables.num;
  if ( num != 0 )
  {
    v6.f = *(float *)(*(_DWORD *)(num + 12) + 164);
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value = v6;
    result->type = SWF_VAR_STRINGID;
  }
  else
  {
    idSWFScriptVar::idSWFScriptVar(this: result, s: &byte_8200D768);
  }
  return result;
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`13'::idSWFScriptFunction_PlayerGarage_CanRepairVehicle::Call
// EA  : 0x82E73CF0
// RVA : 0x00E73CF0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_13_::idSWFScriptFunction_PlayerGarage_CanRepairVehicle::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  _DWORD *num; // r3
  const idDeclInventory *v6; // r28
  idInventoryCollection *v7; // r3
  int TotalInventoryItemCount; // r28
  int TotalRepairCost; // r3

  if ( thisObject->variables.size != 0
    && (num = (_DWORD *)thisObject->variables.num,
        v6 = (const idDeclInventory *)num[5849],
        v7 = (idInventoryCollection *)(*(int (__fastcall **)(_DWORD *))(*num + 464))(a1: num),
        TotalInventoryItemCount = idInventoryCollection::FindTotalInventoryItemCount(this: v7, decl: v6),
        TotalRepairCost = idVehicleKey::GetTotalRepairCost(this: (idVehicleKey *)thisObject->variables.size),
        TotalInventoryItemCount > 0)
    && TotalRepairCost > 0 )
  {
    idSWFScriptVar::idSWFScriptVar(this: result, b: true);
    return result;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
    return result;
  }
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`14'::idSWFScriptFunction_PlayerGarage_RepairVehicle::Call
// EA  : 0x82E73D90
// RVA : 0x00E73D90
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_14_::idSWFScriptFunction_PlayerGarage_RepairVehicle::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  _DWORD *num; // r3
  const idDeclInventory *v7; // r30
  idInventoryCollection *v8; // r3
  int TotalInventoryItemCount; // r30
  int TotalRepairCost; // r4
  idPlayer *v11; // r3

  if ( thisObject->variables.size != 0 )
  {
    num = (_DWORD *)thisObject->variables.num;
    v7 = (const idDeclInventory *)num[5849];
    v8 = (idInventoryCollection *)(*(int (__fastcall **)(_DWORD *))(*num + 464))(a1: num);
    TotalInventoryItemCount = idInventoryCollection::FindTotalInventoryItemCount(this: v8, decl: v7);
    TotalRepairCost = idVehicleKey::GetTotalRepairCost(this: (idVehicleKey *)thisObject->variables.size);
    v11 = (idPlayer *)thisObject->variables.num;
    if ( TotalInventoryItemCount < TotalRepairCost )
    {
      idPlayer::RemoveCash(this: v11, amount: TotalInventoryItemCount);
      idVehicleKey::DoPartialRepair(this: (idVehicleKey *)thisObject->variables.size, cash: TotalInventoryItemCount);
    }
    else
    {
      idPlayer::RemoveCash(this: v11, amount: TotalRepairCost);
      idVehicleKey::DoTotalRepair(this: (idVehicleKey *)thisObject->variables.size);
    }
    result->type = SWF_VAR_UNDEF;
    return result;
  }
  else
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
    return result;
  }
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`15'::idSWFScriptFunction_PlayerGarage_GetCash::Call
// EA  : 0x82E73E60
// RVA : 0x00E73E60
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_15_::idSWFScriptFunction_PlayerGarage_GetCash::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  _DWORD *num; // r3
  const idDeclInventory *v5; // r30
  idInventoryCollection *v6; // r3
  idSWFScriptVar::swfScriptVarValue_t v7; // r30

  num = (_DWORD *)thisObject->variables.num;
  v5 = (const idDeclInventory *)num[5849];
  v6 = (idInventoryCollection *)(*(int (__fastcall **)(_DWORD *))(*num + 464))(a1: num);
  v7.i = idInventoryCollection::FindTotalInventoryItemCount(this: v6, decl: v5);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v7;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`16'::idSWFScriptFunction_PlayerGarage_GetVehicleDamage::Call
// EA  : 0x82E73ED8
// RVA : 0x00E73ED8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_16_::idSWFScriptFunction_PlayerGarage_GetVehicleDamage::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idVehicleKey *num; // r3
  idSWFScriptVar::swfScriptVarValue_t v5; // r30

  num = (idVehicleKey *)thisObject->variables.num;
  v5.i = 0;
  if ( num != nullptr )
    v5.i = idVehicleKey::GetDamagePercentInt(this: num);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v5;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`17'::idSWFScriptFunction_PlayerGarage_GetVehicleRepairCost::Call
// EA  : 0x82E73F40
// RVA : 0x00E73F40
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_17_::idSWFScriptFunction_PlayerGarage_GetVehicleRepairCost::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idVehicleKey *num; // r3
  idSWFScriptVar::swfScriptVarValue_t v5; // r30

  num = (idVehicleKey *)thisObject->variables.num;
  v5.i = 0;
  if ( num != nullptr )
    v5.i = idVehicleKey::GetTotalRepairCost(this: num);
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->value = v5;
  result->type = SWF_VAR_INTEGER;
  return result;
}


// ========================================================================
// ?SetRenderTunerVehicle@idPlayer@@QAAX_NPBDHPAVidTownGarageCamera@@@Z
// EA  : 0x82E73FB0
// RVA : 0x00E73FB0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::SetRenderTunerVehicle(
        idPlayer *this,
        bool render,
        const char *tunerVehicle,
        idSWFScriptVar::swfScriptVarValue_t upgrade,
        idTownGarageCamera *camera)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v11; // r3
  idPresentable *v12; // r3
  idPresentablePlayer *v13; // r3
  idPresentable *v14; // r3
  idPresentablePlayer *v15; // r3
  idSWF *PlayerGui; // r3
  idSWF *v17; // r30
  idSWFScriptVar v18[8]; // [sp+50h] [-40h] BYREF

  presentable = this->presentable;
  if ( presentable != nullptr )
    v11 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v11 = nullptr;
  if ( (unsigned __int8)idPresentablePlayer::ClearPlayerGui(this: v11, g: GUI_TUNER_VEHICLE) != 0 && camera != nullptr )
    camera->tunerVehicleGui = nullptr;
  if ( render )
  {
    v12 = this->presentable;
    if ( v12 != nullptr )
      v13 = v12->GetPlayerInterface_2(this: v12);
    else
      v13 = nullptr;
    idPresentablePlayer::SetPlayerGuiFile(this: v13, g: GUI_TUNER_VEHICLE, filename: tunerVehicle, purgableImage: true);
    v14 = this->presentable;
    if ( v14 != nullptr )
      v15 = v14->GetPlayerInterface_2(this: v14);
    else
      v15 = nullptr;
    PlayerGui = idPresentablePlayer::GetPlayerGui(this: v15, g: GUI_TUNER_VEHICLE);
    v17 = PlayerGui;
    if ( camera != nullptr )
    {
      camera->tunerVehicleGui = PlayerGui;
      if ( PlayerGui != nullptr )
        idSWF::Activate(this: PlayerGui, b: true);
    }
    idSWF::Activate(this: v17, b: render);
    v18[0].type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: v18);
    v18[0].value = upgrade;
    v18[0].type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: v17->globals, name: "initialPart", value: v18);
    idSWFScriptVar::Free(this: v18);
  }
}


// ========================================================================
// __unwind$543143
// EA  : 0x82E740F4
// RVA : 0x00E740F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543143()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 144 + 80));
}


// ========================================================================
// ?ShowInfo@idPlayer@@QAAXVidStrId@@0W4infoPromptType_t@@PBVidMaterial@@PAVidSWFScriptFunction@@3_N4@Z
// EA  : 0x82E74128
// RVA : 0x00E74128
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::ShowInfo(
        idPlayer *this,
        idStrId *infoTitle,
        idStrId *infoBody,
        idSWFScriptVar::swfScriptVarValue_t type,
        const idMaterial *icon,
        idSWFScriptFunction *acceptCallback,
        idSWFScriptFunction *cancelCallback,
        bool large,
        bool acceptValid,
        int a10,
        int a11,
        int a12,
        int a13,
        int a14,
        int a15,
        int a16,
        int a17,
        int a18,
        int a19,
        int a20,
        int a21,
        int a22,
        int a23,
        int a24,
        int a25,
        int a26,
        int a27,
        bool a28)
{
  idPresentable *presentable; // r3
  idPresentable *v36; // r3
  idPresentablePlayer *v37; // r3
  idPresentablePlayer::playerGuis_t v38; // r4
  idSWF *PlayerGui; // r30
  idPresentable *v40; // r3
  int v41; // r3
  idLocalUser *LocalUserFromPlayerIndex; // r3
  int index; // r27
  int v44; // r27
  idSWFScriptVar v45; // [sp+50h] [-80h] BYREF
  idSWFScriptVar v46; // [sp+58h] [-78h] BYREF
  idSWFScriptVar v47; // [sp+60h] [-70h] BYREF
  idSWFScriptVar v48; // [sp+68h] [-68h] BYREF
  idSWFScriptVar v49; // [sp+70h] [-60h] BYREF
  idSWFScriptVar v50[11]; // [sp+78h] [-58h] BYREF

  if ( icon != nullptr )
    idLib::Warning(fmt: "ShowInfo was called with a non NULL icon.  currently not supported");
  presentable = this->presentable;
  if ( presentable != nullptr && presentable->GetPlayerInterface_2(this: presentable) != nullptr )
  {
    v36 = this->presentable;
    if ( large )
    {
      if ( v36 != nullptr )
        v37 = v36->GetPlayerInterface_2(this: v36);
      else
        v37 = nullptr;
      v38 = GUI_INFO_BIG_NO_PIC;
    }
    else
    {
      if ( v36 != nullptr )
        v37 = v36->GetPlayerInterface_2(this: v36);
      else
        v37 = nullptr;
      v38 = GUI_INFO_SMALL;
    }
    PlayerGui = idPresentablePlayer::GetPlayerGui(this: v37, g: v38);
    if ( PlayerGui != nullptr )
    {
      v40 = this->presentable;
      if ( v40 != nullptr )
        v41 = (int)v40->GetPlayerInterface_2(this: v40);
      else
        v41 = 0;
      LocalUserFromPlayerIndex = idClientGame::GetLocalUserFromPlayerIndex(
                                   this: clientGame,
                                   index: *(_DWORD *)(v41 + 180));
      if ( LocalUserFromPlayerIndex != nullptr )
        PlayerGui->userDeviceNumber = LocalUserFromPlayerIndex->GetInputDevice(this: LocalUserFromPlayerIndex);
      else
        PlayerGui->userDeviceNumber = 0;
      index = infoTitle->index;
      v45.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v45);
      v45.value.i = index;
      v45.type = SWF_VAR_STRINGID;
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "infoTitle", value: &v45);
      idSWFScriptVar::Free(this: &v45);
      v46.type = SWF_VAR_UNDEF;
      v44 = infoBody->index;
      idSWFScriptVar::Free(this: &v46);
      v46.value.i = v44;
      v46.type = SWF_VAR_STRINGID;
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "infoBody", value: &v46);
      idSWFScriptVar::Free(this: &v46);
      idSWFScriptVar::idSWFScriptVar(this: &v49, nf: acceptCallback);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "acceptCallback", value: &v49);
      idSWFScriptVar::Free(this: &v49);
      idSWFScriptVar::idSWFScriptVar(this: v50, nf: cancelCallback);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "cancelCallback", value: v50);
      idSWFScriptVar::Free(this: v50);
      v47.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v47);
      v47.value = type;
      v47.type = SWF_VAR_INTEGER;
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "Infotype", value: &v47);
      idSWFScriptVar::Free(this: &v47);
      v48.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v48);
      v48.type = SWF_VAR_BOOL;
      v48.value.b = a28;
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "canAccept", value: &v48);
      idSWFScriptVar::Free(this: &v48);
      idSWF::Activate(this: PlayerGui, b: true);
    }
  }
}


// ========================================================================
// __unwind$543250
// EA  : 0x82E74394
// RVA : 0x00E74394
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543250()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 208 + 80));
}


// ========================================================================
// __unwind$543251
// EA  : 0x82E743BC
// RVA : 0x00E743BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543251()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 208 + 88));
}


// ========================================================================
// __unwind$543252
// EA  : 0x82E743E4
// RVA : 0x00E743E4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543252()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 208 + 112));
}


// ========================================================================
// __unwind$543253
// EA  : 0x82E7440C
// RVA : 0x00E7440C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543253()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 208 + 120));
}


// ========================================================================
// __unwind$543254
// EA  : 0x82E74434
// RVA : 0x00E74434
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543254()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 208 + 96));
}


// ========================================================================
// __unwind$543255
// EA  : 0x82E7445C
// RVA : 0x00E7445C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543255()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 208 + 104));
}


// ========================================================================
// ?OfferInteraction@idPlayer@@QAAXW4offerType_t@1@PBVaiPlayerInteraction_t@@PAVidAI2@@@Z
// EA  : 0x82E74538
// RVA : 0x00E74538
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::OfferInteraction(
        idPlayer *this,
        idPlayer::offerType_t offerType,
        idSWFScriptFunction_vtbl *interaction,
        idAI2 *offeringEntity)
{
  int dtr_idSWFScriptFunction; // r30
  idPresentable *presentable; // r3
  idPresentablePlayer *v10; // r3
  idDeclJob *Call; // r3
  idPresentable *v12; // r3
  int v13; // r3

  if ( interaction == nullptr || offeringEntity == nullptr )
    idLib::Warning(fmt: "Invalid data in OfferInteraction");
  this->npcInteractionState.offerType = offerType;
  this->lastOfferChoice = OFFERCHOICE_UNKNOWN;
  idStr::operator=(this: &this->npcInteractionState.offeringEntity, text: offeringEntity->name.data);
  dtr_idSWFScriptFunction = (int)interaction->dtr_idSWFScriptFunction;
  idStr::EnsureAlloced(
    this: &this->npcInteractionState.interaction,
    amount: (int)interaction->dtr_idSWFScriptFunction + 1,
    keepold: false,
    geometricGrowth: false);
  memcpy(Dst: this->npcInteractionState.interaction.data, Src: interaction->Call, Size: dtr_idSWFScriptFunction);
  this->npcInteractionState.interaction.data[dtr_idSWFScriptFunction] = 0;
  this->npcInteractionState.interaction.len = dtr_idSWFScriptFunction;
  presentable = this->presentable;
  if ( presentable != nullptr )
    v10 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v10 = nullptr;
  if ( idPresentablePlayer::GuiIsActive(this: v10, g: GUI_INVENTORY) )
    idPlayer::ForceCloseInventory(this);
  Call = (idDeclJob *)interaction[8].Call;
  if ( Call == nullptr || idDeclJob::ShowsGUI(this: Call) )
  {
    v12 = this->presentable;
    if ( v12 != nullptr )
      v13 = (int)v12->GetPlayerInterface_2(this: v12);
    else
      v13 = 0;
    idPlayerHud::SetHudState(this: (idPlayerHud *)(v13 + 35096), state: HUDSTATE_NONE);
  }
  idEntity::StopSound(this, channel: SND_CHANNEL_BREATHE, peerMask: 0xFFu);
  if ( offerType == OFFERTYPE_JOB )
  {
    idPlayer::OfferJob(this, job: (idStrId *)interaction[8].Call, offeringEntity, skipActivate: false);
  }
  else if ( offerType == OFFERTYPE_VENDER )
  {
    idPlayer::OfferWares(this, interaction, offeringAI: offeringEntity, skipInteraction: false);
  }
  else
  {
    idLib::Warning(fmt: "Invalid offer type in OfferInteraction");
  }
}


// ========================================================================
// `idPlayer::ShowInventory'::`26'::idSWFScriptFunction_PlayerWeapons_Refresh::Call
// EA  : 0x82E746C8
// RVA : 0x00E746C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_26_::idSWFScriptFunction_PlayerWeapons_Refresh::Call(
        idSWFScriptVar *result,
        idInventoryItem *thisObject,
        const idSWFParmList *parms)
{
  int listeningToList; // r3
  bfx::Planner3D *v6; // r27
  char *i; // r30
  idWeapon *InventoryItem; // r29
  int v10; // [sp+50h] [-50h] BYREF
  idSWFScriptVar v11[9]; // [sp+58h] [-48h] BYREF

  v11[0].type = SWF_VAR_UNDEF;
  v10 = 0;
  idSWFScriptVar::Free(this: v11);
  v11[0].value.i = 0;
  v11[0].type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, name: "length", value: v11);
  idSWFScriptVar::Free(this: v11);
  listeningToList = (int)thisObject->listeningToList;
  v10 = 0;
  v6 = (bfx::Planner3D *)(*(int (__fastcall **)(int))(*(_DWORD *)listeningToList + 468))(a1: listeningToList);
  for ( i = (char *)&idScriptObject::GetTypeDef(this: v6)[-1].m_components.m_tag + 3; (int)i >= 0; --i )
  {
    InventoryItem = (idWeapon *)idInventoryCollection::GetInventoryItem(
                                  this: (idInventoryCollection *)v6,
                                  index: (int)i);
    if ( idWeapon::CastTo(c: InventoryItem) != nullptr )
      _idPlayer::ShowInventory_::_26_::idSWFScriptFunction_PlayerWeapons_Refresh::AddWeapon(
        item: thisObject,
        index: InventoryItem,
        a3: &v10);
  }
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->type = SWF_VAR_BOOL;
  result->value.b = true;
  return result;
}


// ========================================================================
// __unwind$543636
// EA  : 0x82E747A4
// RVA : 0x00E747A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543636()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 160 + 88));
}


// ========================================================================
// `idPlayer::ShowInventory'::`34'::idSWFScriptFunction_PlayerJobs_Refresh::AddJobToObject
// EA  : 0x82E747D8
// RVA : 0x00E747D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall _idPlayer::ShowInventory_::_34_::idSWFScriptFunction_PlayerJobs_Refresh::AddJobToObject(
        idJob *job,
        const int index,
        int allowNoteStateChange,
        char a4)
{
  idStrId *v4; // r23
  idSWFScriptObject *v7; // r19
  idDeclJob *JobName; // r3
  idSWFScriptVar::swfScriptVarValue_t v9; // r30
  bool v10; // r22
  int v11; // r30
  int i; // r26
  idMapPrimitive *JobNote; // r29
  idStr *list; // r11
  const char **v15; // r10
  const char *len; // r9
  char *LocalizedString; // r3
  int j; // r29
  idMapPrimitive *v19; // r30
  idStr *v20; // r11
  const char **v21; // r10
  const char *v22; // r9
  char *v23; // r3
  idStrId *JobSummary; // r3
  char *v25; // r3
  char *v26; // r3
  char *v27; // r3
  _DWORD *v28; // r3
  idSWFScriptVar::swfScriptVarValue_t v29; // r30
  char v30; // r30
  idStr *v31; // r30
  int allocedAndFlag; // r11
  int v33; // r29
  int v34; // r4
  int v35; // r9
  char *v36; // r10
  char v37; // r11
  idSWFScriptVar::swfScriptVarValue_t v38; // r11
  idDeclJob *JobRequirements; // r3
  idSWFScriptVar::swfScriptVarValue_t v40; // r30
  idDeclJob *JobReward; // r3
  idSWFScriptVar::swfScriptVarValue_t v42; // r30
  idSWFScriptVar::swfScriptVarValue_t v43; // r30
  int v44; // r30
  int v45; // r30
  int v46; // r30
  char IsQuestJob; // r3
  char IsOptionalQuestJob; // r3
  int v49; // r11
  _DWORD *v50; // r3
  idSWFScriptVar::swfScriptVarValue_t v51; // r30
  idList<idEventReceiver *,5> *listeningToList; // r8
  _DWORD *v53; // r3
  idSWFScriptVar::swfScriptVarValue_t v54; // r30
  idSWFScriptObject *v55; // r3
  idSWFScriptObject *v56; // r24
  idJob *v57; // r27
  int v58; // r20
  int v59; // r21
  int v60; // r26
  idSWFScriptObject *v61; // r3
  idSWFScriptObject *v62; // r28
  idPlayer::jobMessage_t *v63; // r29
  idStr *v64; // r3
  idStr *v65; // r30
  int v66; // r11
  int v67; // r27
  int v68; // r4
  char *v69; // r10
  int v70; // r9
  char v71; // r11
  idSWFScriptVar::swfScriptVarValue_t v72; // r11
  bool complete; // r30
  const char *v77; // [sp+50h] [-280h] BYREF
  const char *v78; // [sp+54h] [-27Ch] BYREF
  _DWORD v79[2]; // [sp+58h] [-278h] BYREF
  idSWFScriptVar v80; // [sp+60h] [-270h] BYREF
  idSWFScriptVar v81; // [sp+68h] [-268h] BYREF
  idSWFScriptVar v82; // [sp+70h] [-260h] BYREF
  idSWFScriptVar v83; // [sp+78h] [-258h] BYREF
  idSWFScriptVar v84; // [sp+80h] [-250h] BYREF
  idSWFScriptVar v85; // [sp+88h] [-248h] BYREF
  idSWFScriptVar v86; // [sp+90h] [-240h] BYREF
  idSWFScriptVar v87; // [sp+98h] [-238h] BYREF
  idSWFScriptVar v88; // [sp+A0h] [-230h] BYREF
  idStrId v89; // [sp+A8h] [-228h] BYREF
  idSWFScriptVar v90; // [sp+B0h] [-220h] BYREF
  idSWFScriptVar v91; // [sp+B8h] [-218h] BYREF
  idSWFScriptVar v92; // [sp+C0h] [-210h] BYREF
  idStrId v93[2]; // [sp+C8h] [-208h] BYREF
  idSWFScriptVar v94; // [sp+D0h] [-200h] BYREF
  idSWFScriptVar v95; // [sp+D8h] [-1F8h] BYREF
  idSWFScriptVar v96; // [sp+E0h] [-1F0h] BYREF
  idSWFScriptVar v97; // [sp+E8h] [-1E8h] BYREF
  idSWFScriptVar v98; // [sp+F0h] [-1E0h] BYREF
  idStrId v99[2]; // [sp+F8h] [-1D8h] BYREF
  idSWFScriptVar v100; // [sp+100h] [-1D0h] BYREF
  idSWFScriptVar v101; // [sp+108h] [-1C8h] BYREF
  idSWFScriptVar v102; // [sp+110h] [-1C0h] BYREF
  idStrId v103; // [sp+118h] [-1B8h] BYREF
  idSWFScriptVar v104; // [sp+120h] [-1B0h] BYREF
  idSWFScriptVar v105; // [sp+128h] [-1A8h] BYREF
  idStr v106; // [sp+130h] [-1A0h] BYREF
  idStr v107; // [sp+150h] [-180h] BYREF
  idStaticList<idPlayer::jobMessage_t,5> v108; // [sp+170h] [-160h] BYREF

  v4 = *(idStrId **)(index + 12);
  v7 = idSWFScriptObject::Alloc();
  JobName = idDeclJob::GetJobName(this: (idDeclJob *)&v77, result: v4);
  v91.type = SWF_VAR_UNDEF;
  *(idDeclJob_vtbl **)&v9.f = JobName->__vftable;
  idSWFScriptVar::Free(this: &v91);
  v91.value = v9;
  v91.type = SWF_VAR_STRINGID;
  idSWFScriptObject::Set(this: v7, name: "name", value: &v91);
  idSWFScriptVar::Free(this: &v91);
  v105.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v105);
  v105.value.b = false;
  v105.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: v7, name: "spacer", value: &v105);
  idSWFScriptVar::Free(this: &v105);
  v107.len = 0;
  v107.baseBuffer[0] = 0;
  v107.allocedAndFlag = 20;
  v107.data = v107.baseBuffer;
  v106.len = 0;
  v106.baseBuffer[0] = 0;
  v106.allocedAndFlag = 20;
  v106.data = v106.baseBuffer;
  v10 = false;
  v11 = *(_DWORD *)(index + 36) - 1;
  for ( i = 0; v11 >= 0; --v11 )
  {
    JobNote = idJob::GetJobNote(this: (idMapModel *)index, i: v11);
    if ( idJobNoteTracker::ShowOnInventory(this: (idJobNoteTracker *)JobNote) && JobNote->groupList.num < 3 )
    {
      idStr::Append(this: &v106, text: "<JOB_NOTE_EMPTY> ");
      list = JobNote->groupList.list;
      if ( list != nullptr )
      {
        len = (const char *)list[3].len;
        v15 = &v77;
        v103.index = (int)JobNote->groupList.list;
        v77 = len;
      }
      else
      {
        v15 = &v78;
        v78 = (const char *)-1;
      }
      v103.index = (int)*v15;
      LocalizedString = (char *)idStrId::GetLocalizedString(this: &v103);
      idStr::Append(this: &v106, text: LocalizedString);
      if ( JobNote->groupList.num < 2 )
        v10 = true;
      idStr::Append(this: &v106, text: "\n");
      ++i;
    }
  }
  for ( j = *(_DWORD *)(index + 36) - 1; j >= 0; --j )
  {
    v19 = idJob::GetJobNote(this: (idMapModel *)index, i: j);
    if ( idJobNoteTracker::ShowOnInventory(this: (idJobNoteTracker *)v19) && v19->groupList.num >= 3 )
    {
      idStr::Append(this: &v106, text: "<JOB_NOTE_COMPLETE> ");
      v20 = v19->groupList.list;
      if ( v20 != nullptr )
      {
        v22 = (const char *)v20[3].len;
        v21 = &v78;
        v89.index = (int)v19->groupList.list;
        v78 = v22;
      }
      else
      {
        v21 = &v77;
        v77 = (const char *)-1;
      }
      v89.index = (int)*v21;
      v23 = (char *)idStrId::GetLocalizedString(this: &v89);
      idStr::Append(this: &v106, text: v23);
      idStr::Append(this: &v106, text: "\n");
      ++i;
    }
  }
  if ( i > 0 )
  {
    idStr::Append(this: &v106, text: "_________________");
    idStr::Append(this: &v106, text: "\n");
    idStr::Append(this: &v106, text: "\n");
    idStr::Append(this: &v107, text: &v106);
  }
  JobSummary = (idStrId *)idDeclJob::GetJobSummary(this: (idDeclJob *)&v77, result: v4);
  v25 = (char *)idStrId::GetLocalizedString(this: JobSummary);
  idStr::Append(this: &v107, text: v25);
  idDeclJob::GetJobRequirements(this: (idDeclJob *)v93, result: v4);
  if ( v93[0].index >= 0 )
  {
    idStr::Append(this: &v107, text: "\n");
    idStr::Append(this: &v107, text: "\n");
    v26 = (char *)idStrId::GetLocalizedString(this: v93);
    idStr::Append(this: &v107, text: v26);
  }
  idDeclJob::GetJobReward(this: (idDeclJob *)v99, result: v4);
  if ( v99[0].index >= 0 )
  {
    idStr::Append(this: &v107, text: "\n");
    idStr::Append(this: &v107, text: "\n");
    v27 = (char *)idStrId::GetLocalizedString(this: v99);
    idStr::Append(this: &v107, text: v27);
  }
  v86.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v86);
  v86.value.b = v10;
  v86.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: v7, name: "noticeMyJobNotes", value: &v86);
  idSWFScriptVar::Free(this: &v86);
  if ( a4 != 0 )
  {
    v28 = idMem::AllocWithLocation(
            this: &mem,
            location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
            size: 0xCu,
            tag: TAG_SWF,
            zeroBuffer: false,
            align: ALIGN_16,
            heap: HEAP_DEFAULTHEAP);
    if ( v28 != nullptr )
    {
      v28[2] = index;
      v28[1] = 0;
      v29.i = (int)v28;
      *v28 = &`idPlayer::ShowInventory'::`32'::idSWFScriptFunciton_MarkJobNoticed::`vftable';
    }
    else
    {
      v29.i = 0;
    }
    v80.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v80);
    if ( v29.i != 0 )
    {
      v80.value = v29;
      v80.type = SWF_VAR_FUNCTION;
      (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v29.i + 8))(a1: v29.i);
    }
    else
    {
      v80.type = SWF_VAR_NULL;
    }
    idSWFScriptObject::Set(this: v7, name: "MarkJobNoticed", value: &v80);
    idSWFScriptVar::Free(this: &v80);
  }
  v101.type = SWF_VAR_UNDEF;
  v30 = *(_BYTE *)(index + 28);
  idSWFScriptVar::Free(this: &v101);
  v101.value.b = v30;
  v101.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: v7, name: "seen", value: &v101);
  idSWFScriptVar::Free(this: &v101);
  v95.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v95);
  v95.type = SWF_VAR_STRING;
  v31 = (idStr *)idMem::AllocWithLocation(
                   this: &mem,
                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                   size: 0x24u,
                   tag: TAG_SWF,
                   zeroBuffer: false,
                   align: ALIGN_16,
                   heap: HEAP_DEFAULTHEAP);
  v79[0] = v31;
  v78 = "w:\\tech5\\shared\\idlib\\text/Str.h";
  v77 = "amount <= GetAlloced()";
  if ( v31 != nullptr )
  {
    v31->allocedAndFlag = 20;
    v31->len = 0;
    v31->data = v31->baseBuffer;
    v31->baseBuffer[0] = 0;
    allocedAndFlag = v31->allocedAndFlag;
    v33 = v107.len;
    v34 = v107.len + 1;
    if ( allocedAndFlag >= 0 )
    {
      if ( v34 > (allocedAndFlag & 0x7FFFFFFF) )
        idStr::ReAllocate(this: v31, amount: v34, keepold: true);
    }
    else if ( v34 > (allocedAndFlag & 0x7FFFFFFF)
           && AssertFailed(
                file: "w:\\tech5\\shared\\idlib\\text/Str.h",
                line: 463,
                expression: "amount <= GetAlloced()",
                inlineBreak: true) )
    {
      __trap();
    }
    v35 = (int)(v31->data - 1);
    v36 = v107.data - 1;
    do
    {
      v37 = *++v36;
      *(_BYTE *)++v35 = *v36;
    }
    while ( v37 != 0 );
    v31->len = v33;
    v38.i = (int)v31;
    v31[1].len = 1;
  }
  else
  {
    v38.i = 0;
  }
  v95.value = v38;
  idSWFScriptObject::Set(this: v7, name: "summary", value: &v95);
  idSWFScriptVar::Free(this: &v95);
  JobRequirements = idDeclJob::GetJobRequirements(this: (idDeclJob *)v79, result: v4);
  v104.type = SWF_VAR_UNDEF;
  *(idDeclJob_vtbl **)&v40.f = JobRequirements->__vftable;
  idSWFScriptVar::Free(this: &v104);
  v104.value = v40;
  v104.type = SWF_VAR_STRINGID;
  idSWFScriptObject::Set(this: v7, name: "requirements", value: &v104);
  idSWFScriptVar::Free(this: &v104);
  JobReward = idDeclJob::GetJobReward(this: (idDeclJob *)v79, result: v4);
  v97.type = SWF_VAR_UNDEF;
  *(idDeclJob_vtbl **)&v42.f = JobReward->__vftable;
  idSWFScriptVar::Free(this: &v97);
  v97.value = v42;
  v97.type = SWF_VAR_STRINGID;
  idSWFScriptObject::Set(this: v7, name: "reward", value: &v97);
  idSWFScriptVar::Free(this: &v97);
  v87.type = SWF_VAR_UNDEF;
  v43.f = *(float *)(index + 16);
  idSWFScriptVar::Free(this: &v87);
  v87.value = v43;
  v87.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: v7, name: "status", value: &v87);
  idSWFScriptVar::Free(this: &v87);
  v88.type = SWF_VAR_UNDEF;
  v44 = *(_DWORD *)(index + 16);
  idSWFScriptVar::Free(this: &v88);
  v88.type = SWF_VAR_BOOL;
  v88.value.b = (_cntlzw(v44 - 3) & 0x20) != 0;
  idSWFScriptObject::Set(this: v7, name: "readyToTurnIn", value: &v88);
  idSWFScriptVar::Free(this: &v88);
  v90.type = SWF_VAR_UNDEF;
  v45 = *(_DWORD *)(index + 16);
  idSWFScriptVar::Free(this: &v90);
  v90.type = SWF_VAR_BOOL;
  v90.value.b = (_cntlzw(v45 - 1) & 0x20) != 0;
  idSWFScriptObject::Set(this: v7, name: "failed", value: &v90);
  idSWFScriptVar::Free(this: &v90);
  v92.type = SWF_VAR_UNDEF;
  v46 = *(_DWORD *)(index + 16);
  idSWFScriptVar::Free(this: &v92);
  v92.type = SWF_VAR_BOOL;
  v92.value.b = (_cntlzw(v46 - 5) & 0x20) != 0;
  idSWFScriptObject::Set(this: v7, name: "completed", value: &v92);
  idSWFScriptVar::Free(this: &v92);
  IsQuestJob = idDeclJob::IsQuestJob(this: (idDeclJob *)v4);
  v94.type = SWF_VAR_UNDEF;
  LOBYTE(v46) = IsQuestJob;
  idSWFScriptVar::Free(this: &v94);
  v94.value.b = v46;
  v94.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: v7, name: "isQuestJob", value: &v94);
  idSWFScriptVar::Free(this: &v94);
  IsOptionalQuestJob = idDeclJob::IsOptionalQuestJob(this: (idDeclJob *)v4);
  v96.type = SWF_VAR_UNDEF;
  LOBYTE(v46) = IsOptionalQuestJob;
  idSWFScriptVar::Free(this: &v96);
  v96.value.b = v46;
  v96.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: v7, name: "isOptional", value: &v96);
  idSWFScriptVar::Free(this: &v96);
  v49 = v4[25].index;
  v98.type = SWF_VAR_UNDEF;
  LOBYTE(v46) = (_cntlzw(v49 - 12) & 0x20) != 0;
  idSWFScriptVar::Free(this: &v98);
  v98.value.b = v46;
  v98.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: v7, name: "isInfo", value: &v98);
  idSWFScriptVar::Free(this: &v98);
  v50 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x10u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v50 != nullptr )
  {
    v51.i = (int)v50;
    listeningToList = job->listeningToList;
    v50[3] = v4;
    v50[1] = 0;
    *v50 = &`idPlayer::ShowInventory'::`29'::idSWFScriptFunction_SetActiveJob::`vftable';
    v50[2] = listeningToList;
  }
  else
  {
    v51.i = 0;
  }
  v84.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v84);
  if ( v51.i != 0 )
  {
    v84.value = v51;
    v84.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v51.i + 8))(a1: v51.i);
  }
  else
  {
    v84.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: v7, name: "setActive", value: &v84);
  idSWFScriptVar::Free(this: &v84);
  v53 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v53 != nullptr )
  {
    v53[2] = index;
    v53[1] = 0;
    v54.i = (int)v53;
    *v53 = &`idPlayer::ShowInventory'::`33'::idSWFScriptFunciton_MarkJobSeen::`vftable';
  }
  else
  {
    v54.i = 0;
  }
  v81.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v81);
  if ( v54.i != 0 )
  {
    v81.value = v54;
    v81.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v54.i + 8))(a1: v54.i);
  }
  else
  {
    v81.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: v7, name: "maskAsSeen", value: &v81);
  idSWFScriptVar::Free(this: &v81);
  v55 = (idSWFScriptObject *)idMem::AllocWithLocation(
                               this: &mem,
                               location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                               size: 0x60u,
                               tag: TAG_SWF,
                               zeroBuffer: false,
                               align: ALIGN_16,
                               heap: HEAP_DEFAULTHEAP);
  v79[0] = v55;
  if ( v55 != nullptr )
    v56 = idSWFScriptObject::idSWFScriptObject(this: v55);
  else
    v56 = nullptr;
  idSWFScriptObject::MakeArray(this: v56);
  idStaticList<idPlayer::jobMessage_t,5>::idStaticList<idPlayer::jobMessage_t,5>(this: &v108);
  v57 = job;
  idPlayer::ConstructJobMessage(this: (idPlayer *)job->listeningToList, job: (const idJob *)index, messages: &v108);
  v58 = 0;
  v59 = 0;
  if ( v108.num > 0 )
  {
    v60 = 0;
    do
    {
      v61 = (idSWFScriptObject *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x60u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
      v79[0] = v61;
      if ( v61 != nullptr )
        v62 = idSWFScriptObject::idSWFScriptObject(this: v61);
      else
        v62 = nullptr;
      v100.type = SWF_VAR_UNDEF;
      v63 = &v108.list[v60];
      idSWFScriptVar::Free(this: &v100);
      v100.type = SWF_VAR_STRING;
      v64 = (idStr *)idMem::AllocWithLocation(
                       this: &mem,
                       location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                       size: 0x24u,
                       tag: TAG_SWF,
                       zeroBuffer: false,
                       align: ALIGN_16,
                       heap: HEAP_DEFAULTHEAP);
      v65 = v64;
      v79[0] = v64;
      if ( v64 != nullptr )
      {
        v64->len = 0;
        v64->data = v64->baseBuffer;
        v64->allocedAndFlag = 20;
        v64->baseBuffer[0] = 0;
        v66 = v64->allocedAndFlag;
        v67 = v63->message.len;
        v68 = v63->message.len + 1;
        if ( v66 >= 0 )
        {
          if ( v68 > (v66 & 0x7FFFFFFF) )
            idStr::ReAllocate(this: v64, amount: v68, keepold: true);
        }
        else if ( v68 > (v66 & 0x7FFFFFFF) && AssertFailed(file: v78, line: 463, expression: v77, inlineBreak: true) )
        {
          __trap();
        }
        v69 = v63->message.data - 1;
        v70 = (int)(v65->data - 1);
        do
        {
          v71 = *++v69;
          *(_BYTE *)++v70 = *v69;
        }
        while ( v71 != 0 );
        v65->len = v67;
        v57 = job;
        v72.i = (int)v65;
        v65[1].len = 1;
      }
      else
      {
        v72.i = 0;
      }
      v100.value = v72;
      idSWFScriptObject::Set(this: v62, name: "message", value: &v100);
      idSWFScriptVar::Free(this: &v100);
      complete = v108.list[v60].complete;
      v102.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v102);
      v102.value.b = complete;
      v102.type = SWF_VAR_BOOL;
      idSWFScriptObject::Set(this: v62, name: "complete", value: &v102);
      idSWFScriptVar::Free(this: &v102);
      v83.type = SWF_VAR_UNDEF;
      idSWFScriptVar::Free(this: &v83);
      if ( v62 != nullptr )
      {
        v83.value.i = (int)v62;
        v83.type = SWF_VAR_OBJECT;
        ++v62->refCount;
      }
      else
      {
        v83.type = SWF_VAR_NULL;
      }
      idSWFScriptObject::Set(this: v56, index: v59++, value: &v83);
      idSWFScriptVar::Free(this: &v83);
      if ( v62->refCount-- == 1 )
      {
        idSWFScriptObject::~idSWFScriptObject(this: v62);
        idMem::Free(this: &mem, ptr: v62, align: ALIGN_16);
      }
      ++v58;
      ++v60;
    }
    while ( v58 < v108.num );
  }
  v85.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v85);
  if ( v56 != nullptr )
  {
    v85.value.i = (int)v56;
    v85.type = SWF_VAR_OBJECT;
    ++v56->refCount;
  }
  else
  {
    v85.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: v7, name: "objectives", value: &v85);
  idSWFScriptVar::Free(this: &v85);
  if ( v56->refCount-- == 1 )
  {
    idSWFScriptObject::~idSWFScriptObject(this: v56);
    idMem::Free(this: &mem, ptr: v56, align: ALIGN_16);
  }
  v82.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v82);
  if ( v7 != nullptr )
  {
    v82.value.i = (int)v7;
    v82.type = SWF_VAR_OBJECT;
    ++v7->refCount;
  }
  else
  {
    v82.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: (idSWFScriptObject *)v57->decl, index: allowNoteStateChange, value: &v82);
  idSWFScriptVar::Free(this: &v82);
  if ( v7->refCount-- == 1 )
  {
    idSWFScriptObject::~idSWFScriptObject(this: v7);
    idMem::Free(this: &mem, ptr: v7, align: ALIGN_16);
  }
  idStaticList<idPlayer::jobMessage_t,5>::~idStaticList<idPlayer::jobMessage_t,5>(this: &v108);
  idStr::FreeData(this: &v106);
  idStr::FreeData(this: &v107);
}


// ========================================================================
// __unwind$543721
// EA  : 0x82E75488
// RVA : 0x00E75488
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543721()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 184));
}


// ========================================================================
// __unwind$543722
// EA  : 0x82E754B0
// RVA : 0x00E754B0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543722()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 296));
}


// ========================================================================
// __unwind$543723
// EA  : 0x82E754D8
// RVA : 0x00E754D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543723()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 720 + 336));
}


// ========================================================================
// __unwind$543724
// EA  : 0x82E75500
// RVA : 0x00E75500
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543724()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 720 + 304));
}


// ========================================================================
// __unwind$543725
// EA  : 0x82E75528
// RVA : 0x00E75528
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543725()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 144));
}


// ========================================================================
// __unwind$543727
// EA  : 0x82E75550
// RVA : 0x00E75550
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543727()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 96));
}


// ========================================================================
// __unwind$543728
// EA  : 0x82E75578
// RVA : 0x00E75578
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543728()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 264));
}


// ========================================================================
// __unwind$544063
// EA  : 0x82E755A0
// RVA : 0x00E755A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_544063()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 720 + 88), tag: TAG_SWF);
}


// ========================================================================
// __unwind$543729
// EA  : 0x82E755CC
// RVA : 0x00E755CC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543729()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 216));
}


// ========================================================================
// __unwind$543730
// EA  : 0x82E755F4
// RVA : 0x00E755F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543730()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 288));
}


// ========================================================================
// __unwind$543731
// EA  : 0x82E7561C
// RVA : 0x00E7561C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543731()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 232));
}


// ========================================================================
// __unwind$543732
// EA  : 0x82E75644
// RVA : 0x00E75644
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543732()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 152));
}


// ========================================================================
// __unwind$543733
// EA  : 0x82E7566C
// RVA : 0x00E7566C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543733()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 160));
}


// ========================================================================
// __unwind$543734
// EA  : 0x82E75694
// RVA : 0x00E75694
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543734()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 176));
}


// ========================================================================
// __unwind$543735
// EA  : 0x82E756BC
// RVA : 0x00E756BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543735()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 192));
}


// ========================================================================
// __unwind$543736
// EA  : 0x82E756E4
// RVA : 0x00E756E4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543736()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 208));
}


// ========================================================================
// __unwind$543737
// EA  : 0x82E7570C
// RVA : 0x00E7570C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543737()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 224));
}


// ========================================================================
// __unwind$543738
// EA  : 0x82E75734
// RVA : 0x00E75734
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543738()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 240));
}


// ========================================================================
// __unwind$543740
// EA  : 0x82E7575C
// RVA : 0x00E7575C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543740()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 128));
}


// ========================================================================
// __unwind$543742
// EA  : 0x82E75784
// RVA : 0x00E75784
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543742()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 104));
}


// ========================================================================
// __unwind$544500
// EA  : 0x82E757AC
// RVA : 0x00E757AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_544500()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 720 + 88), tag: TAG_SWF);
}


// ========================================================================
// __unwind$543743
// EA  : 0x82E757D8
// RVA : 0x00E757D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543743()
{
  int v0; // r12

  idStaticList<idPlayer::jobMessage_t,5>::~idStaticList<idPlayer::jobMessage_t,5>(this: (idStaticList<idPlayer::jobMessage_t,5> *)(v0 - 720 + 368));
}


// ========================================================================
// __unwind$544521
// EA  : 0x82E75800
// RVA : 0x00E75800
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_544521()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 720 + 88), tag: TAG_SWF);
}


// ========================================================================
// __unwind$544544
// EA  : 0x82E7582C
// RVA : 0x00E7582C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_544544()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 720 + 88), tag: TAG_SWF);
}


// ========================================================================
// __unwind$543744
// EA  : 0x82E75858
// RVA : 0x00E75858
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543744()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 256));
}


// ========================================================================
// __unwind$543745
// EA  : 0x82E75880
// RVA : 0x00E75880
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543745()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 272));
}


// ========================================================================
// __unwind$543746
// EA  : 0x82E758A8
// RVA : 0x00E758A8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543746()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 120));
}


// ========================================================================
// __unwind$543747
// EA  : 0x82E758D0
// RVA : 0x00E758D0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543747()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 136));
}


// ========================================================================
// __unwind$543748
// EA  : 0x82E758F8
// RVA : 0x00E758F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_543748()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 720 + 112));
}


// ========================================================================
// `idPlayer::ShowInventory'::`34'::idSWFScriptFunction_PlayerJobs_Refresh::Call
// EA  : 0x82E75928
// RVA : 0x00E75928
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_34_::idSWFScriptFunction_PlayerJobs_Refresh::Call(
        idSWFScriptVar *result,
        idJob *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  char v7; // r16
  _exception *p_granularity; // r18
  idSWFScriptVar::swfScriptVarValue_t v9; // r29
  idSWFScriptObject *v10; // r3
  idSWFScriptObject *v11; // r30
  idSWFScriptVar::swfScriptVarValue_t v12; // r29
  idSWFScriptFunction *v13; // r3
  int listeningToList; // r11
  idSWFScriptFunction *v15; // r4
  idSWFScriptObject *v16; // r28
  idSWFScriptObject *v17; // r3
  idSWFScriptObject *v18; // r29
  char *i; // r28
  idJob *JobByIndex; // r3
  int v24; // r30
  char v25; // r11
  int v26; // r11
  char v27; // r11
  bool v28; // zf
  idSWFScriptObject *v29; // r3
  idSWFScriptObject *v30; // r30
  char *j; // r28
  idJob *v33; // r3
  idJob *v34; // r30
  char v35; // r11
  idSWFScriptVar v37; // [sp+58h] [-148h] BYREF
  idSWFScriptVar v38; // [sp+60h] [-140h] BYREF
  idSWFScriptVar v39; // [sp+68h] [-138h] BYREF
  idSWFScriptVar v40; // [sp+70h] [-130h] BYREF
  idSWFScriptVar v41; // [sp+78h] [-128h] BYREF
  idSWFScriptVar v42; // [sp+80h] [-120h] BYREF
  idSWFScriptVar v43; // [sp+88h] [-118h] BYREF
  idSWFScriptVar v44; // [sp+90h] [-110h] BYREF
  idSWFScriptVar v45; // [sp+98h] [-108h] BYREF
  idSWFScriptVar v46; // [sp+A0h] [-100h] BYREF
  idSWFScriptVar v47; // [sp+A8h] [-F8h] BYREF
  idSWFScriptVar v48; // [sp+B0h] [-F0h] BYREF
  idSWFScriptVar v49; // [sp+B8h] [-E8h] BYREF
  idSWFScriptVar v50; // [sp+C0h] [-E0h] BYREF
  int v51; // [sp+C8h] [-D8h]
  idSWFScriptVar v52; // [sp+D0h] [-D0h] BYREF
  idSWFScriptVar v53; // [sp+D8h] [-C8h] BYREF
  idSWFScriptVar v54; // [sp+E0h] [-C0h] BYREF
  idSWFScriptVar v55; // [sp+E8h] [-B8h] BYREF
  idSWFScriptVar v56; // [sp+F0h] [-B0h] BYREF
  idSWFScriptVar v57; // [sp+F8h] [-A8h] BYREF
  idSWFScriptVar v58; // [sp+100h] [-A0h] BYREF
  idSWFScriptVar v59[19]; // [sp+108h] [-98h] BYREF

  v40.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v40);
  v40.value.i = 0;
  v40.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, name: "length", value: &v40);
  idSWFScriptVar::Free(this: &v40);
  v7 = 0;
  p_granularity = (_exception *)&thisObject->listeningToList[775].granularity;
  if ( *(int *)(a4 + 4) > 0 )
    v7 = idSWFScriptVar::ToBool(this: *(idSWFScriptVar **)a4);
  v51 = -1;
  v9.i = 0;
  if ( (unsigned __int8)idLobbyBackend360::StartArbitration(pexcept: p_granularity) != 0 )
  {
    v10 = idSWFScriptObject::Alloc();
    v47.type = SWF_VAR_UNDEF;
    v11 = v10;
    v12.i = v51;
    idSWFScriptVar::Free(this: &v47);
    v47.value = v12;
    v47.type = SWF_VAR_STRINGID;
    idSWFScriptObject::Set(this: v11, name: "name", value: &v47);
    idSWFScriptVar::Free(this: &v47);
    v42.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v42);
    v42.type = SWF_VAR_BOOL;
    v42.value.b = false;
    idSWFScriptObject::Set(this: v11, name: "spacer", value: &v42);
    idSWFScriptVar::Free(this: &v42);
    idSWFScriptVar::idSWFScriptVar(this: &v53, s: &byte_8200D768);
    idSWFScriptObject::Set(this: v11, name: "summary", value: &v53);
    idSWFScriptVar::Free(this: &v53);
    idSWFScriptVar::idSWFScriptVar(this: &v58, s: &byte_8200D768);
    idSWFScriptObject::Set(this: v11, name: "requirements", value: &v58);
    idSWFScriptVar::Free(this: &v58);
    idSWFScriptVar::idSWFScriptVar(this: &v56, s: &byte_8200D768);
    idSWFScriptObject::Set(this: v11, name: "reward", value: &v56);
    idSWFScriptVar::Free(this: &v56);
    v48.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v48);
    v48.type = SWF_VAR_INTEGER;
    v48.value.i = 2;
    idSWFScriptObject::Set(this: v11, name: "status", value: &v48);
    idSWFScriptVar::Free(this: &v48);
    v44.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v44);
    v44.type = SWF_VAR_BOOL;
    v44.value.b = false;
    idSWFScriptObject::Set(this: v11, name: "readyToTurnIn", value: &v44);
    idSWFScriptVar::Free(this: &v44);
    v50.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v50);
    v50.type = SWF_VAR_BOOL;
    v50.value.b = false;
    idSWFScriptObject::Set(this: v11, name: "failed", value: &v50);
    idSWFScriptVar::Free(this: &v50);
    v46.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v46);
    v46.type = SWF_VAR_BOOL;
    v46.value.b = false;
    idSWFScriptObject::Set(this: v11, name: "completed", value: &v46);
    idSWFScriptVar::Free(this: &v46);
    v52.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v52);
    v52.type = SWF_VAR_BOOL;
    v52.value.b = true;
    idSWFScriptObject::Set(this: v11, name: "isQuestJob", value: &v52);
    idSWFScriptVar::Free(this: &v52);
    v38.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v38);
    v38.type = SWF_VAR_BOOL;
    v38.value.b = false;
    idSWFScriptObject::Set(this: v11, name: "isOptional", value: &v38);
    idSWFScriptVar::Free(this: &v38);
    v13 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0xCu,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v13 != nullptr )
    {
      listeningToList = (int)thisObject->listeningToList;
      v13[1].__vftable = nullptr;
      v15 = v13;
      v13->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`30'::idSWFScriptFunction_ClearActiveJob::`vftable';
      v13[2].__vftable = (idSWFScriptFunction_vtbl *)listeningToList;
    }
    else
    {
      v15 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v54, nf: v15);
    idSWFScriptObject::Set(this: v11, name: "setActive", value: &v54);
    idSWFScriptVar::Free(this: &v54);
    v16 = idSWFScriptObject::Alloc();
    idSWFScriptObject::MakeArray(this: v16);
    v17 = idSWFScriptObject::Alloc();
    v49.type = SWF_VAR_UNDEF;
    v18 = v17;
    idSWFScriptVar::Free(this: &v49);
    v49.value.i = -1;
    v49.type = SWF_VAR_STRINGID;
    idSWFScriptObject::Set(this: v18, name: "message", value: &v49);
    idSWFScriptVar::Free(this: &v49);
    v39.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v39);
    v39.type = SWF_VAR_BOOL;
    v39.value.b = false;
    idSWFScriptObject::Set(this: v18, name: "complete", value: &v39);
    idSWFScriptVar::Free(this: &v39);
    idSWFScriptVar::idSWFScriptVar(this: &v55, o: v18);
    idSWFScriptObject::Set(this: v16, index: 0, value: &v55);
    idSWFScriptVar::Free(this: &v55);
    if ( v18->refCount-- == 1 )
    {
      idSWFScriptObject::~idSWFScriptObject(this: v18);
      idMem::Free(this: &mem, ptr: v18, align: ALIGN_16);
    }
    idSWFScriptVar::idSWFScriptVar(this: &v57, o: v16);
    idSWFScriptObject::Set(this: v11, name: "objectives", value: &v57);
    idSWFScriptVar::Free(this: &v57);
    if ( v16->refCount-- == 1 )
    {
      idSWFScriptObject::~idSWFScriptObject(this: v16);
      idMem::Free(this: &mem, ptr: v16, align: ALIGN_16);
    }
    idSWFScriptVar::idSWFScriptVar(this: v59, o: v11);
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, index: 0, value: v59);
    idSWFScriptVar::Free(this: v59);
    if ( v11->refCount-- == 1 )
    {
      idSWFScriptObject::~idSWFScriptObject(this: v11);
      idMem::Free(this: &mem, ptr: v11, align: ALIGN_16);
    }
    v9.i = 1;
  }
  for ( i = (char *)&idScriptObject::GetTypeDef(this: (bfx::Planner3D *)p_granularity)[-1].m_components.m_tag + 3;
        (int)i >= 0;
        --i )
  {
    JobByIndex = idJobManager::GetJobByIndex(this: (idJobManager *)p_granularity, index: (int)i);
    v24 = (int)JobByIndex;
    if ( JobByIndex != nullptr )
    {
      if ( !idDeclJob::IsJobHidden(this: JobByIndex->decl) || (v25 = 1, jobDebug_ShowHidden.valueInteger != 0) )
        v25 = 0;
      if ( v25 == 0 )
      {
        v26 = *(_DWORD *)(v24 + 16);
        if ( v26 == 3 || (v28 = v26 != 2, v27 = 0, !v28) )
          v27 = 1;
        if ( v27 != 0
          && (unsigned __int8)idDeclJob::UseDynamicJobHud(this: *(idDeclJob **)(v24 + 12)) == 0
          && !idJob::FailsDLCCriteria(this: (idJob *)v24) )
        {
          _idPlayer::ShowInventory_::_34_::idSWFScriptFunction_PlayerJobs_Refresh::AddJobToObject(
            job: thisObject,
            index: v24,
            allowNoteStateChange: v9.i++,
            a4: v7);
        }
      }
    }
  }
  if ( v9.i <= 0 )
  {
    v45.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v45);
    v45.type = SWF_VAR_INTEGER;
    v45.value.i = -1;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, name: "spacer", value: &v45);
    idSWFScriptVar::Free(this: &v45);
  }
  else
  {
    v29 = idSWFScriptObject::Alloc();
    v41.type = SWF_VAR_UNDEF;
    v30 = v29;
    idSWFScriptVar::Free(this: &v41);
    v41.type = SWF_VAR_BOOL;
    v41.value.b = true;
    idSWFScriptObject::Set(this: v30, name: "spacer", value: &v41);
    idSWFScriptVar::Free(this: &v41);
    v43.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v43);
    v43.value = v9;
    v43.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, name: "spacer", value: &v43);
    idSWFScriptVar::Free(this: &v43);
    v37.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v37);
    if ( v30 != nullptr )
    {
      v37.value.i = (int)v30;
      v37.type = SWF_VAR_OBJECT;
      ++v30->refCount;
    }
    else
    {
      v37.type = SWF_VAR_NULL;
    }
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->decl, index: v9.i++, value: &v37);
    idSWFScriptVar::Free(this: &v37);
    if ( v30->refCount-- == 1 )
    {
      idSWFScriptObject::~idSWFScriptObject(this: v30);
      idMem::Free(this: &mem, ptr: v30, align: ALIGN_16);
    }
  }
  for ( j = (char *)&idScriptObject::GetTypeDef(this: (bfx::Planner3D *)p_granularity)[-1].m_components.m_tag + 3;
        (int)j >= 0;
        --j )
  {
    v33 = idJobManager::GetJobByIndex(this: (idJobManager *)p_granularity, index: (int)j);
    v34 = v33;
    if ( v33 != nullptr && v33->status == JOBSTATUS_COMPLETED )
    {
      if ( !idDeclJob::IsJobHidden(this: v33->decl) || (v35 = 1, jobDebug_ShowHidden.valueInteger != 0) )
        v35 = 0;
      if ( v35 == 0
        && (unsigned __int8)idDeclJob::UseDynamicJobHud(this: v34->decl) == 0
        && !idDeclJob::IsSimple(this: v34->decl)
        && !idJob::FailsDLCCriteria(this: v34) )
      {
        _idPlayer::ShowInventory_::_34_::idSWFScriptFunction_PlayerJobs_Refresh::AddJobToObject(
          job: thisObject,
          index: (const int)v34,
          allowNoteStateChange: v9.i++,
          a4: v7);
      }
    }
  }
  result->type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: result);
  result->type = SWF_VAR_BOOL;
  result->value.b = true;
  return result;
}


// ========================================================================
// __unwind$545139
// EA  : 0x82E7609C
// RVA : 0x00E7609C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545139()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 112));
}


// ========================================================================
// __unwind$545140
// EA  : 0x82E760C4
// RVA : 0x00E760C4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545140()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 168));
}


// ========================================================================
// __unwind$545141
// EA  : 0x82E760EC
// RVA : 0x00E760EC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545141()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 128));
}


// ========================================================================
// __unwind$545142
// EA  : 0x82E76114
// RVA : 0x00E76114
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545142()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 216));
}


// ========================================================================
// __unwind$545143
// EA  : 0x82E7613C
// RVA : 0x00E7613C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545143()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 256));
}


// ========================================================================
// __unwind$545144
// EA  : 0x82E76164
// RVA : 0x00E76164
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545144()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 240));
}


// ========================================================================
// __unwind$545145_0
// EA  : 0x82E7618C
// RVA : 0x00E7618C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545145_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 176));
}


// ========================================================================
// __unwind$545146
// EA  : 0x82E761B4
// RVA : 0x00E761B4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545146()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 144));
}


// ========================================================================
// __unwind$545147
// EA  : 0x82E761DC
// RVA : 0x00E761DC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545147()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 192));
}


// ========================================================================
// __unwind$545148
// EA  : 0x82E76204
// RVA : 0x00E76204
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545148()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 160));
}


// ========================================================================
// __unwind$545149
// EA  : 0x82E7622C
// RVA : 0x00E7622C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545149()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 208));
}


// ========================================================================
// __unwind$545150
// EA  : 0x82E76254
// RVA : 0x00E76254
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545150()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 96));
}


// ========================================================================
// __unwind$545152
// EA  : 0x82E7627C
// RVA : 0x00E7627C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545152()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 224));
}


// ========================================================================
// __unwind$545153
// EA  : 0x82E762A4
// RVA : 0x00E762A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545153()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 184));
}


// ========================================================================
// __unwind$545154
// EA  : 0x82E762CC
// RVA : 0x00E762CC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545154()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 104));
}


// ========================================================================
// __unwind$545155
// EA  : 0x82E762F4
// RVA : 0x00E762F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545155()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 232));
}


// ========================================================================
// __unwind$545156
// EA  : 0x82E7631C
// RVA : 0x00E7631C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545156()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 248));
}


// ========================================================================
// __unwind$545157
// EA  : 0x82E76344
// RVA : 0x00E76344
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545157()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 264));
}


// ========================================================================
// __unwind$545158
// EA  : 0x82E7636C
// RVA : 0x00E7636C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545158()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 120));
}


// ========================================================================
// __unwind$545159
// EA  : 0x82E76394
// RVA : 0x00E76394
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545159()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 136));
}


// ========================================================================
// __unwind$545160
// EA  : 0x82E763BC
// RVA : 0x00E763BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545160()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 88));
}


// ========================================================================
// __unwind$545161
// EA  : 0x82E763E4
// RVA : 0x00E763E4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545161()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 416 + 152));
}


// ========================================================================
// `idPlayer::ShowInventory'::`43'::idSWFScriptFunction_PlayerInventory_GetPersonalStats::Call
// EA  : 0x82E76418
// RVA : 0x00E76418
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowInventory_::_43_::idSWFScriptFunction_PlayerInventory_GetPersonalStats::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int num; // r11
  double v6; // fp1
  double v7; // fp31
  int StatInt; // r3
  idSWFScriptVar::swfScriptVarValue_t v9; // r23
  int v10; // r3
  idSWFScriptVar::swfScriptVarValue_t v11; // r23
  int v12; // r3
  idSWFScriptVar::swfScriptVarValue_t v13; // r23
  int v14; // r3
  idSWFScriptVar::swfScriptVarValue_t v15; // r28
  idSWFScriptObject *v16; // r28
  idSWFScriptVar v19; // [sp+50h] [-C0h] BYREF
  idSWFScriptVar v20; // [sp+58h] [-B8h] BYREF
  idSWFScriptVar v21; // [sp+60h] [-B0h] BYREF
  idSWFScriptVar v22; // [sp+68h] [-A8h] BYREF
  idSWFScriptVar v23; // [sp+70h] [-A0h] BYREF
  idSWFScriptVar v24; // [sp+78h] [-98h] BYREF
  idSWFScriptVar v25; // [sp+80h] [-90h] BYREF
  idSWFScriptVar v26; // [sp+88h] [-88h] BYREF
  idSWFScriptVar v27; // [sp+90h] [-80h] BYREF
  idSWFScriptVar v28; // [sp+98h] [-78h] BYREF
  idSWFScriptVar v29; // [sp+A0h] [-70h] BYREF
  idSWFScriptVar v30[2]; // [sp+A8h] [-68h] BYREF

  num = thisObject->variables.num;
  v19.type = SWF_VAR_STRINGID;
  if ( num != 0 )
  {
    v6 = ((double (__fastcall *)(int))*(_DWORD *)(*(_DWORD *)(num + 12168) + 64))(a1: num + 12168);
    v19.type = SWF_VAR_UNDEF;
    v7 = v6;
    idSWFScriptVar::Free(this: &v19);
    v19.value.f = v7;
    v19.type = SWF_VAR_FLOAT;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "maxHealth", value: &v19);
    idSWFScriptVar::Free(this: &v19);
    v20.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v20);
    v20.value.b = false;
    v20.type = SWF_VAR_BOOL;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "regenSpeed", value: &v20);
    idSWFScriptVar::Free(this: &v20);
    v21.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v21);
    v21.type = SWF_VAR_STRINGID;
    v21.value.i = -1;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "suitType", value: &v21);
    idSWFScriptVar::Free(this: &v21);
    v22.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v22);
    v22.value.i = 0;
    v22.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "protectionVal", value: &v22);
    idSWFScriptVar::Free(this: &v22);
    v23.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v23);
    v23.type = SWF_VAR_STRINGID;
    v23.value.i = -1;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "armorDesc", value: &v23);
    idSWFScriptVar::Free(this: &v23);
    StatInt = idRageMetrics::GetStatInt(
                this: clientGame->rageMetrics,
                player: (idPlayer *)thisObject->variables.num,
                stat: 148);
    v24.type = SWF_VAR_UNDEF;
    v9.i = StatInt;
    idSWFScriptVar::Free(this: &v24);
    v24.value = v9;
    v24.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "mutantKills", value: &v24);
    idSWFScriptVar::Free(this: &v24);
    v10 = idRageMetrics::GetStatInt(
            this: clientGame->rageMetrics,
            player: (idPlayer *)thisObject->variables.num,
            stat: 147);
    v25.type = SWF_VAR_UNDEF;
    v11.i = v10;
    idSWFScriptVar::Free(this: &v25);
    v25.value = v11;
    v25.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "banditKills", value: &v25);
    idSWFScriptVar::Free(this: &v25);
    v12 = idRageMetrics::GetStatInt(
            this: clientGame->rageMetrics,
            player: (idPlayer *)thisObject->variables.num,
            stat: 149);
    v26.type = SWF_VAR_UNDEF;
    v13.i = v12;
    idSWFScriptVar::Free(this: &v26);
    v26.type = SWF_VAR_INTEGER;
    v26.value = v13;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "authorityKills", value: &v26);
    idSWFScriptVar::Free(this: &v26);
    v14 = idRageMetrics::GetStatInt(
            this: clientGame->rageMetrics,
            player: (idPlayer *)thisObject->variables.num,
            stat: 0);
    v27.type = SWF_VAR_UNDEF;
    v15.i = v14;
    idSWFScriptVar::Free(this: &v27);
    v27.value = v15;
    v27.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "vehicleKills", value: &v27);
    idSWFScriptVar::Free(this: &v27);
    idSWFScriptVar::idSWFScriptVar(this: &v29, s: &byte_8200D768);
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "suitImg", value: &v29);
    idSWFScriptVar::Free(this: &v29);
    v28.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v28);
    v28.type = SWF_VAR_INTEGER;
    v28.value.i = 0;
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "armorLvl", value: &v28);
    idSWFScriptVar::Free(this: &v28);
    v16 = idSWFScriptObject::Alloc();
    idSWFScriptObject::MakeArray(this: v16);
    idPlayer::PopulateStatInformation(this: (idPlayer *)thisObject->variables.num, obj: v16);
    idSWFScriptVar::idSWFScriptVar(this: v30, o: v16);
    idSWFScriptObject::Set(this: (idSWFScriptObject *)thisObject->variables.size, name: "statInfo", value: v30);
    idSWFScriptVar::Free(this: v30);
    if ( v16->refCount-- == 1 )
    {
      idSWFScriptObject::~idSWFScriptObject(this: v16);
      idMem::Free(this: &mem, ptr: v16, align: ALIGN_16);
    }
  }
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// __unwind$545761
// EA  : 0x82E7676C
// RVA : 0x00E7676C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545761()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 80));
}


// ========================================================================
// __unwind$545762
// EA  : 0x82E76794
// RVA : 0x00E76794
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545762()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 88));
}


// ========================================================================
// __unwind$545763
// EA  : 0x82E767BC
// RVA : 0x00E767BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545763()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 96));
}


// ========================================================================
// __unwind$545764
// EA  : 0x82E767E4
// RVA : 0x00E767E4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545764()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 104));
}


// ========================================================================
// __unwind$545765
// EA  : 0x82E7680C
// RVA : 0x00E7680C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545765()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 112));
}


// ========================================================================
// __unwind$545766
// EA  : 0x82E76834
// RVA : 0x00E76834
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545766()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 120));
}


// ========================================================================
// __unwind$545767
// EA  : 0x82E7685C
// RVA : 0x00E7685C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545767()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 128));
}


// ========================================================================
// __unwind$545768
// EA  : 0x82E76884
// RVA : 0x00E76884
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545768()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 136));
}


// ========================================================================
// __unwind$545769
// EA  : 0x82E768AC
// RVA : 0x00E768AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545769()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 144));
}


// ========================================================================
// __unwind$545771_0
// EA  : 0x82E768D4
// RVA : 0x00E768D4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545771_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 160));
}


// ========================================================================
// __unwind$545772
// EA  : 0x82E768FC
// RVA : 0x00E768FC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545772()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 152));
}


// ========================================================================
// __unwind$545773
// EA  : 0x82E76924
// RVA : 0x00E76924
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_545773()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 272 + 168));
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`2'::idSWFScriptFunction_PlayerGarage_RefreshUpgrades::Call
// EA  : 0x82E76958
// RVA : 0x00E76958
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_2_::idSWFScriptFunction_PlayerGarage_RefreshUpgrades::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        idAFBody **a4)
{
  idAFBody *v7; // r3
  idAFBody_vtbl *v8; // r11
  int v9; // r10
  int v10; // r3
  idAFBody *v11; // r11
  int v12; // r30
  int v13; // r3
  int size; // r11
  idInventoryCollection *v15; // r29
  int v17; // r11
  int v18; // r30
  idVehicleKey *v19; // r30
  int v20; // r24
  int v21; // r27
  idList<idDeclVehicleUpgrade const *,5> *list; // r11
  int v23; // r28
  int v24; // r29
  idAFBody *v25; // r25
  int i; // r30
  idInventoryItem *InventoryItem; // r3
  int v28; // r6
  idSWFScriptVar::swfScriptVarValue_t *v29; // r4
  int v30; // r5
  int v31; // r8
  idSWFScriptVar::swfScriptVarValue_t *v32; // r10
  encounterGroupRole_t *v33; // r11
  int j; // ctr
  int v35; // [sp+50h] [-90h] BYREF
  int v36; // [sp+54h] [-8Ch] BYREF
  idAFBody *v37; // [sp+58h] [-88h] BYREF
  int v38; // [sp+5Ch] [-84h]
  idSWFScriptVar v39[2]; // [sp+60h] [-80h] BYREF
  idList<enum encounterGroupRole_t,5> v40[7]; // [sp+70h] [-70h] BYREF

  v38 = 0;
  if ( (int)a4[1] <= 1
    || (v7 = *a4, (v8 = (*a4)->__vftable) == (idAFBody_vtbl *)4)
    || (v9 = *((_DWORD *)&v7->__vftable + 2)) == 4
    || v8 == (idAFBody_vtbl *)3
    || v9 == 3 )
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.i = 0;
    result->type = SWF_VAR_INTEGER;
    return result;
  }
  else
  {
    v37 = *a4;
    v10 = idSWFScriptVar::ToInteger(this: (idSWFScriptVar *)v7);
    v11 = *a4;
    v12 = v10;
    idSWFScriptVar::ToBool(this: (idSWFScriptVar *)&v11->__vftable + 1);
    idSWFScriptVar::idSWFScriptVar(this: v39, i: nullptr);
    idSWFScriptObject::Set(this: *(idSWFScriptObject **)&thisObject->variables.granularity, name: "length", value: v39);
    idSWFScriptVar::Free(this: v39);
    v13 = (*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
    size = thisObject->variables.size;
    v15 = (idInventoryCollection *)v13;
    if ( size != 0 && *(_DWORD *)(size + 88) != 0 )
    {
      v17 = *(_DWORD *)(size + 124);
      v36 = 0;
      v18 = *(_DWORD *)(v17 + 4 * v12);
      v35 = *(_DWORD *)(v18 + 504);
      idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: (idList<idDeclVehicleUpgrade const *,5> *)v40);
      _idPlayer::ShowVehicleTuner_::_2_::idSWFScriptFunction_PlayerGarage_RefreshUpgrades::ValidateItem(
        index: &thisObject->refCount,
        item: (const idDeclInventory *)&v36,
        upgradeType: (upgradeType_t *)v18,
        curKey: (idVehicleKey *)&v35,
        currentRow: (idVehicleKey *)thisObject->variables.size,
        a6: v40);
      if ( vehicle_enableAllUpgrades.valueInteger != 0 )
      {
        v19 = (idVehicleKey *)thisObject->variables.size;
        v20 = 0;
        if ( v19->validUpgrades.num > 0 )
        {
          v21 = 0;
          do
          {
            list = v19->validUpgrades.list;
            v23 = 0;
            if ( list[v21].num > 0 )
            {
              v24 = 0;
              do
              {
                v25 = (idAFBody *)list[v21].list[v24];
                v37 = v25;
                if ( idList<idSaveGameProcessor *,5>::Find(this: (idList<idAFBody *,71> *)v40, obj: &v37) == nullptr )
                  _idPlayer::ShowVehicleTuner_::_2_::idSWFScriptFunction_PlayerGarage_RefreshUpgrades::ValidateItem(
                    index: &thisObject->refCount,
                    item: (const idDeclInventory *)&v36,
                    upgradeType: (upgradeType_t *)v25,
                    curKey: (idVehicleKey *)&v35,
                    currentRow: v19,
                    a6: v40);
                v19 = (idVehicleKey *)thisObject->variables.size;
                ++v23;
                ++v24;
                list = v19->validUpgrades.list;
              }
              while ( v23 < list[v21].num );
            }
            ++v20;
            ++v21;
          }
          while ( v20 < v19->validUpgrades.num );
        }
      }
      else
      {
        for ( i = 0; i < (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v15); ++i )
        {
          InventoryItem = idInventoryCollection::GetInventoryItem(this: v15, index: i);
          _idPlayer::ShowVehicleTuner_::_2_::idSWFScriptFunction_PlayerGarage_RefreshUpgrades::ValidateItem(
            index: &thisObject->refCount,
            item: (const idDeclInventory *)&v36,
            upgradeType: (upgradeType_t *)InventoryItem->decl,
            curKey: (idVehicleKey *)&v35,
            currentRow: (idVehicleKey *)thisObject->variables.size,
            a6: v40);
        }
      }
      v28 = thisObject->variables.size;
      v29 = nullptr;
      v30 = 0;
      v37 = *(idAFBody **)(v28 + 88);
      if ( (int)v37 > 0 )
      {
        v31 = 0;
        do
        {
          v32 = nullptr;
          if ( v40[0].num > 0 )
          {
            v33 = v40[0].list;
            for ( j = v40[0].num; j != 0; --j )
            {
              if ( *v33 == *(_DWORD *)(*(_DWORD *)(v28 + 84) + v31) )
                v29 = v32;
              v32 = (idSWFScriptVar::swfScriptVarValue_t *)((char *)v32 + 1);
              ++v33;
            }
          }
          ++v30;
          v31 += 4;
        }
        while ( v30 < (int)v37 );
      }
      idSWFScriptVar::idSWFScriptVar(this: result, i: v29);
      v38 = 1;
      idList<idThread *,58>::Clear(this: (idList<idVehicleState *,5> *)v40);
      return result;
    }
    else
    {
      idSWFScriptVar::idSWFScriptVar(this: result, i: nullptr);
      return result;
    }
  }
}


// ========================================================================
// __unwind$546110
// EA  : 0x82E76C54
// RVA : 0x00E76C54
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546110()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 224 + 96));
}


// ========================================================================
// __unwind$546111
// EA  : 0x82E76C7C
// RVA : 0x00E76C7C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546111()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 224 + 112));
}


// ========================================================================
// __unwind$546107
// EA  : 0x82E76CA4
// RVA : 0x00E76CA4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546107()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 224;
  if ( (*(_DWORD *)(v0 - 224 + 92) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 92) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 244));
  }
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`7'::idSWFScriptFunction_PlayerGarage_TriggerSchematicRender::Call
// EA  : 0x82E76CE8
// RVA : 0x00E76CE8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_7_::idSWFScriptFunction_PlayerGarage_TriggerSchematicRender::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        idSWFScriptVar **a4)
{
  char v7; // r29
  int v8; // r6
  int v9; // r11
  idTownGarageCamera *v10; // r7
  const char *v11; // r5

  if ( a4[1] != nullptr )
  {
    v7 = idSWFScriptVar::ToBool(this: *a4);
    v8 = -1;
    if ( a4[1] == (idSWFScriptVar *)2 )
      v8 = idSWFScriptVar::ToInteger(this: *a4 + 1);
    v9 = *(_DWORD *)(thisObject->variables.num + 12);
    if ( v9 == 0 || v8 == -1 )
    {
      v10 = nullptr;
      v11 = &byte_8200D768;
    }
    else
    {
      v10 = (idTownGarageCamera *)thisObject->variablesHash[0];
      v11 = *(const char **)(v9 + 736);
    }
    idPlayer::SetRenderTunerVehicle(
      this: (idPlayer *)thisObject->variables.size,
      render: v7,
      tunerVehicle: v11,
      upgrade: (idSWFScriptVar::swfScriptVarValue_t *)v8,
      camera: v10);
  }
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`9'::idSWFScriptFunction_PlayerGarage_KillVehicle::Call
// EA  : 0x82E76D88
// RVA : 0x00E76D88
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_9_::idSWFScriptFunction_PlayerGarage_KillVehicle::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idPlayer::SetRenderTunerVehicle(
    this: (idPlayer *)thisObject->variables.num,
    render: false,
    tunerVehicle: &byte_8200D768,
    upgrade: (idSWFScriptVar::swfScriptVarValue_t *)0xFFFFFFFF,
    camera: (idTownGarageCamera *)thisObject->variables.size);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// ?Disassemble@idPlayer@@QAAXPAVidDisassembleLoot@@PAVidEntity@@@Z
// EA  : 0x82E76E48
// RVA : 0x00E76E48
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::Disassemble(idPlayer *this, idDisassembleLoot *loot, idAI2 *ent)
{
  char v6; // r24
  __int64 v7; // r8
  int v8; // r6
  idPresentable *presentable; // r29
  idInventoryCollection *v10; // r3
  int v11; // r27
  const idDeclEntityDef *i; // r26
  const idDeclInventory *LootItem; // r28
  idPresentable *v14; // r29
  int v15; // r21
  idInventoryCollection *v16; // r3
  idInventoryItem *v17; // r3
  const idDeclInventory *decl; // r11
  const idDeclParticle *disassembleParticle; // r28
  idPhysics *Physics; // r3
  float *v21; // r3
  double v22; // fp8
  double v23; // fp6
  __int64 v24; // r10
  unsigned int v25; // r8
  double v26; // fp31
  int GameMsPerFrame; // r25
  int GameMs; // r29
  idRenderModelEffects *MergeBranch; // r3
  const idVec3 *v30; // r7
  idAI2 *v31; // r3
  int v32; // [sp+8h] [-F8h]
  int v33; // [sp+Ch] [-F4h]
  int v34; // [sp+10h] [-F0h]
  int v35; // [sp+14h] [-ECh]
  int v36; // [sp+18h] [-E8h]
  int v37; // [sp+1Ch] [-E4h]
  int v38; // [sp+20h] [-E0h]
  int v39; // [sp+24h] [-DCh]
  int v40; // [sp+28h] [-D8h]
  int v41; // [sp+2Ch] [-D4h]
  int v42; // [sp+30h] [-D0h]
  int v43; // [sp+34h] [-CCh]
  int v44; // [sp+38h] [-C8h]
  int v45; // [sp+3Ch] [-C4h]
  int v46; // [sp+40h] [-C0h]
  int v47; // [sp+44h] [-BCh]
  int v48; // [sp+48h] [-B8h]
  int v49; // [sp+4Ch] [-B4h]
  int v50; // [sp+50h] [-B0h]
  int v51[2]; // [sp+60h] [-A0h] BYREF
  __int64 v52; // [sp+68h] [-98h]
  idMat3 v53; // [sp+70h] [-90h] BYREF

  if ( loot != nullptr && ent != nullptr )
  {
    v6 = 1;
    if ( loot->lootBoxes.num > 0 )
    {
      idList<idVehicleKey *,5>::idList<idVehicleKey *,5>(this: (idList<idDeclVehicleUpgrade const *,5> *)&v53.mat[1].y);
      if ( (unsigned __int8)idDisassembleLoot::GetLootBox(
                              this: loot,
                              lootBox: (idLootBox *)&v53.mat[1].y,
                              entity: ent,
                              a4: v8,
                              a5: v7) != 0 )
      {
        presentable = ent->presentable;
        if ( presentable == nullptr )
        {
          idEntity::InitPresentableInternal(this: ent);
          presentable = ent->presentable;
        }
        v10 = ent->GetInventory_2(this: ent);
        idInventoryCollection::FreeInventory(this: v10, owner: presentable);
      }
      v11 = 0;
      for ( i = ent->entityDef; v11 < SLODWORD(v53.mat[1].z); ++v11 )
      {
        LootItem = idLootBox::GetLootItem(
                     this: (idLootBox *)&v53.mat[1].y,
                     idx: v11,
                     count: v51,
                     ignoreDropPercent: false);
        if ( LootItem != nullptr && v51[0] > 0 )
        {
          v14 = ent->presentable;
          if ( v14 == nullptr )
          {
            idEntity::InitPresentableInternal(this: ent);
            v14 = ent->presentable;
          }
          v15 = v51[0];
          v16 = ent->GetInventory_2(this: ent);
          v17 = idInventoryCollection::GiveItem(
                  this: v16,
                  owner: v14,
                  decl: LootItem,
                  count: v15,
                  forceCount: false,
                  canIntro: false);
          if ( v17 != nullptr )
          {
            decl = v17->decl;
            v17->lootable = true;
            v6 = i != decl->entityDef ? 0 : v6;
          }
        }
      }
      idDisassembleLoot::Looted(this: loot);
      disassembleParticle = loot->disassembleParticle;
      if ( disassembleParticle != nullptr )
      {
        v51[0] = -1;
        Physics = idEntity::GetPhysics(this: ent);
        v21 = (float *)Physics->GetAbsBounds(this: Physics, a2: -1);
        v22 = (float)(v21[1] + v21[4]);
        v23 = (float)(*v21 + v21[3]);
        v53.mat[0].z = (float)(v21[2] + v21[5]) * (float)0.5;
        v53.mat[0].y = (float)v22 * (float)0.5;
        v53.mat[0].x = (float)v23 * (float)0.5;
        HIDWORD(v24) = clientGame->random.seed;
        v25 = 1664525 * clientGame->random.seed;
        clientGame->random.seed = v25 + 1013904223;
        LODWORD(v24) = ((v25 + 1013904223) >> 10) & 0x7FFF;
        v52 = v24;
        v26 = (float)((float)v24 * (float)0.000030518509);
        GameMsPerFrame = idGameTimeManager::GetGameMsPerFrame(this: &clientGame->gameTimeManager, type: GAMETIME_SCALED);
        GameMs = idGameTimeManager::GetGameMs(this: &clientGame->gameTimeManager, type: GAMETIME_SCALED);
        MergeBranch = (idRenderModelEffects *)idAnimator_BlendEq::InternalGetMergeBranch(this: (idAnimator_BlendEq *)clientGame);
        idRenderModelEffects::AddParticles(
          this: MergeBranch,
          particle: disassembleParticle,
          systemStartTime: GameMs,
          gameMsPerFrame: GameMsPerFrame,
          diversity: v26,
          origin: v30,
          axis: &v53,
          velocity: mat3_identity.mat,
          color: &vec3_origin.x,
          a10: v32,
          a11: v33,
          a12: v34,
          a13: v35,
          a14: v36,
          a15: v37,
          a16: v38,
          a17: v39,
          a18: v40,
          a19: v41,
          a20: v42,
          a21: v43,
          a22: v44,
          a23: v45,
          a24: v46,
          a25: v47,
          a26: v48,
          a27: v49,
          a28: v50,
          a29: (unsigned int *)v51);
      }
      v31 = idAI2::CastTo(c: ent);
      if ( v31 != nullptr )
        ((void (__fastcall *)(idAI2 *, idPlayer *, idPlayer *, const idDeclDamage *, double))v31->Damage)(
          a1: v31,
          a2: this,
          a3: this,
          a4: gameLocal->damageFatalFall,
          a5: 1.0);
      idList<idThread *,58>::Clear(this: (idList<idVehicleState *,5> *)&v53.mat[1].y);
    }
    idPlayer::LootItems(this, ent, disassemble: v6 != 0 ? nullptr : loot);
    idPlayer::RemoveDroppableInfo(this, ent);
  }
}


// ========================================================================
// __unwind$546360
// EA  : 0x82E7715C
// RVA : 0x00E7715C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546360()
{
  int v0; // r12

  idList<idDeclSecretType const *,5>::~idList<idDeclSecretType const *,5>(this: (idStaticList<idVehicleState *,4> *)(v0 - 256 + 128));
}


// ========================================================================
// ?LaunchPlayTestGui@idPlayer@@QAAXXZ
// EA  : 0x82E77190
// RVA : 0x00E77190
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::LaunchPlayTestGui(idPlayer *this)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v3; // r3
  idSWFScriptObject *v4; // r30
  idSWFScriptFunction *v5; // r3
  idSWFScriptFunction *v6; // r4
  idSWFScriptFunction *v7; // r3
  idSWFScriptFunction *v8; // r4
  idSWFScriptFunction *v9; // r3
  idSWFScriptFunction *v10; // r4
  idSWFScriptFunction *v11; // r3
  idSWFScriptFunction *v12; // r4
  idPresentable *v13; // r3
  idPresentablePlayer *v14; // r3
  idSWF *v15; // r29
  idPresentable *v16; // r3
  idPresentablePlayer *v17; // r3
  idSWF *PlayerGui; // r3
  idSWFScriptVar v19; // [sp+50h] [-110h] BYREF
  idSWFScriptVar v20; // [sp+58h] [-108h] BYREF
  idSWFScriptVar v21; // [sp+60h] [-100h] BYREF
  idSWFScriptVar v22; // [sp+68h] [-F8h] BYREF
  idSWFScriptVar v23; // [sp+70h] [-F0h] BYREF
  idSWFScriptVar v24; // [sp+78h] [-E8h] BYREF
  idSWFScriptVar v25; // [sp+80h] [-E0h] BYREF
  idSWFScriptVar v26; // [sp+88h] [-D8h] BYREF
  idStaticList<idSWFScriptVar,16> v27; // [sp+90h] [-D0h] BYREF

  presentable = this->presentable;
  if ( presentable != nullptr )
    v3 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v3 = nullptr;
  if ( idPresentablePlayer::GuiIsActive(this: v3, g: GUI_PLAYTEST_DEBUG) )
  {
    idStaticList<idSWFScriptVar,16>::idStaticList<idSWFScriptVar,16>(this: &v27);
    idList<idSWFScriptVar,72>::~idList<idSWFScriptVar,72>(this: &v27);
    v16 = this->presentable;
    if ( v16 != nullptr )
      v17 = v16->GetPlayerInterface_2(this: v16);
    else
      v17 = nullptr;
    PlayerGui = idPresentablePlayer::GetPlayerGui(this: v17, g: GUI_PLAYTEST_DEBUG);
    idSWF::Invoke(this: PlayerGui, functionName: "returnToScreen", parms: (const idSWFParmList *)&v27);
    idStaticList<idSWFScriptVar,16>::~idStaticList<idSWFScriptVar,16>(this: &v27);
  }
  else
  {
    v4 = idSWFScriptObject::Alloc();
    idSWFScriptObject::MakeArray(this: v4);
    v5 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                  this: &mem,
                                  location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                  size: 0x10u,
                                  tag: TAG_SWF,
                                  zeroBuffer: false,
                                  align: ALIGN_16,
                                  heap: HEAP_DEFAULTHEAP);
    if ( v5 != nullptr )
    {
      v5[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v5[3].__vftable = (idSWFScriptFunction_vtbl *)v4;
      v6 = v5;
      v5[1].__vftable = nullptr;
      v5->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::LaunchPlayTestGui'::`5'::idSWFScriptFunction_PlaytestAvailableModel_Refresh::`vftable';
    }
    else
    {
      v6 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v24, nf: v6);
    idSWFScriptObject::Set(this: v4, name: "refresh", value: &v24);
    idSWFScriptVar::Free(this: &v24);
    v7 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                  this: &mem,
                                  location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                  size: 0x10u,
                                  tag: TAG_SWF,
                                  zeroBuffer: false,
                                  align: ALIGN_16,
                                  heap: HEAP_DEFAULTHEAP);
    if ( v7 != nullptr )
    {
      v7[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v7[3].__vftable = (idSWFScriptFunction_vtbl *)v4;
      v8 = v7;
      v7[1].__vftable = nullptr;
      v7->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::LaunchPlayTestGui'::`6'::idSWFScriptFunction_DoReaction::`vftable';
    }
    else
    {
      v8 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v22, nf: v8);
    idSWFScriptObject::Set(this: v4, name: "DoReaction", value: &v22);
    idSWFScriptVar::Free(this: &v22);
    v9 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                  this: &mem,
                                  location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                  size: 0x10u,
                                  tag: TAG_SWF,
                                  zeroBuffer: false,
                                  align: ALIGN_16,
                                  heap: HEAP_DEFAULTHEAP);
    if ( v9 != nullptr )
    {
      v9[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v9[3].__vftable = (idSWFScriptFunction_vtbl *)v4;
      v10 = v9;
      v9[1].__vftable = nullptr;
      v9->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::LaunchPlayTestGui'::`7'::idSWFScriptFunction_ClearPlaytestModel::`vftable';
    }
    else
    {
      v10 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v26, nf: v10);
    idSWFScriptObject::Set(this: v4, name: "ClearPlaytestModel", value: &v26);
    idSWFScriptVar::Free(this: &v26);
    v11 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                   this: &mem,
                                   location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                   size: 0x10u,
                                   tag: TAG_SWF,
                                   zeroBuffer: false,
                                   align: ALIGN_16,
                                   heap: HEAP_DEFAULTHEAP);
    if ( v11 != nullptr )
    {
      v11[2].__vftable = (idSWFScriptFunction_vtbl *)this;
      v11[3].__vftable = (idSWFScriptFunction_vtbl *)v4;
      v12 = v11;
      v11[1].__vftable = nullptr;
      v11->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::LaunchPlayTestGui'::`8'::idSWFScriptFunction_DoBack::`vftable';
    }
    else
    {
      v12 = nullptr;
    }
    idSWFScriptVar::idSWFScriptVar(this: &v20, nf: v12);
    idSWFScriptObject::Set(this: v4, name: "DoBack", value: &v20);
    idSWFScriptVar::Free(this: &v20);
    idSWFScriptVar::idSWFScriptVar(this: &v21, s: "playtest");
    idSWFScriptObject::Set(this: v4, name: "filterPath", value: &v21);
    idSWFScriptVar::Free(this: &v21);
    v13 = this->presentable;
    if ( v13 != nullptr )
      v14 = v13->GetPlayerInterface_2(this: v13);
    else
      v14 = nullptr;
    v15 = idPresentablePlayer::GetPlayerGui(this: v14, g: GUI_PLAYTEST_DEBUG);
    idSWFScriptVar::idSWFScriptVar(this: &v23, o: v4);
    idSWFScriptObject::Set(this: v15->globals, name: "jobs", value: &v23);
    idSWFScriptVar::Free(this: &v23);
    idSWFScriptVar::idSWFScriptVar(this: &v25, s: &byte_8200D768);
    idSWFScriptObject::Set(this: v15->globals, name: "jobFilter", value: &v25);
    idSWFScriptVar::Free(this: &v25);
    v19.type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: &v19);
    v19.value.i = 0;
    v19.type = SWF_VAR_INTEGER;
    idSWFScriptObject::Set(this: v15->globals, name: "jobFilterIndex", value: &v19);
    idSWFScriptVar::Free(this: &v19);
    idSWF::Activate(this: v15, b: true);
  }
}


// ========================================================================
// __unwind$546632
// EA  : 0x82E77510
// RVA : 0x00E77510
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546632()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 352 + 120));
}


// ========================================================================
// __unwind$546634
// EA  : 0x82E77538
// RVA : 0x00E77538
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546634()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 352 + 104));
}


// ========================================================================
// __unwind$546636
// EA  : 0x82E77560
// RVA : 0x00E77560
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546636()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 352 + 136));
}


// ========================================================================
// __unwind$546638
// EA  : 0x82E77588
// RVA : 0x00E77588
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546638()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 352 + 88));
}


// ========================================================================
// __unwind$546639
// EA  : 0x82E775B0
// RVA : 0x00E775B0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546639()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 352 + 96));
}


// ========================================================================
// __unwind$546640
// EA  : 0x82E775D8
// RVA : 0x00E775D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546640()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 352 + 112));
}


// ========================================================================
// __unwind$546641
// EA  : 0x82E77600
// RVA : 0x00E77600
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546641()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 352 + 128));
}


// ========================================================================
// __unwind$546642
// EA  : 0x82E77628
// RVA : 0x00E77628
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546642()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 352 + 80));
}


// ========================================================================
// __unwind$546643
// EA  : 0x82E77650
// RVA : 0x00E77650
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_546643()
{
  int v0; // r12

  idSWFParmList::~idSWFParmList(this: (idSWFParmList *)(v0 - 352 + 144));
}


// ========================================================================
// ?ShowInventory@idPlayer@@QAAX_N@Z
// EA  : 0x82E77680
// RVA : 0x00E77680
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::ShowInventory(idPlayer *this, bool inVehicle)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v5; // r3
  idPresentable *v6; // r3
  idPresentablePlayer *v7; // r3
  idSWF *PlayerGui; // r29
  idSWFScriptObject *v9; // r30
  idSWFScriptFunction *v10; // r3
  idSWFScriptFunction *v11; // r4
  idSWFScriptObject *v12; // r30
  idSWFScriptFunction *v13; // r3
  idSWFScriptFunction *v14; // r4
  idSWFScriptObject *v15; // r30
  idSWFScriptFunction *v16; // r3
  idSWFScriptFunction *v17; // r4
  idSWFScriptFunction *v18; // r3
  idSWFScriptFunction *v19; // r4
  idSWFScriptFunction *v20; // r3
  idSWFScriptFunction *v21; // r4
  idSWFScriptObject *v22; // r30
  idSWFScriptFunction *v23; // r3
  idSWFScriptFunction *v24; // r4
  idSWFScriptFunction *v25; // r3
  idSWFScriptFunction *v26; // r4
  idSWFScriptObject *v27; // r30
  idSWFScriptFunction *v28; // r3
  idSWFScriptFunction *v29; // r4
  idSWFScriptObject *v30; // r30
  idSWFScriptFunction *v31; // r3
  idSWFScriptFunction *v32; // r4
  idSWFScriptObject *v33; // r30
  idSWFScriptFunction *v34; // r3
  idSWFScriptFunction *v35; // r4
  idSWFScriptFunction *v36; // r3
  idSWFScriptFunction *v37; // r4
  idSWFScriptFunction *v38; // r3
  idSWFScriptFunction *v39; // r4
  idSWFScriptFunction *v40; // r3
  idSWFScriptFunction *v41; // r4
  idSWFScriptFunction *v42; // r30
  idPresentable *v43; // r3
  int v44; // r3
  idSWFScriptFunction *v45; // r4
  idSWFScriptFunction *v46; // r3
  idSWFScriptFunction *v47; // r4
  idSWFScriptFunction *v48; // r3
  idSWFScriptFunction *v49; // r4
  idSWFScriptFunction *v50; // r3
  idSWFScriptFunction *v51; // r4
  idSWFScriptFunction *v52; // r3
  idSWFScriptFunction *v53; // r4
  idSWFScriptFunction *v54; // r3
  idSWFScriptFunction *v55; // r4
  idSWFScriptFunction *v56; // r3
  idSWFScriptFunction *v57; // r4
  idSWFScriptFunction *v58; // r3
  idSWFScriptFunction *v59; // r4
  idSWFScriptFunction *v60; // r3
  idSWFScriptFunction *v61; // r4
  idPresentable *v62; // r3
  idPresentablePlayer *v63; // r3
  idPlayerHud *PlayerHud; // r3
  idPresentable *v65; // r3
  int v66; // r3
  idSWFScriptVar v67; // [sp+50h] [-1E0h] BYREF
  idSWFScriptVar v68; // [sp+58h] [-1D8h] BYREF
  idSWFScriptVar v69; // [sp+60h] [-1D0h] BYREF
  idSWFScriptVar v70; // [sp+68h] [-1C8h] BYREF
  idSWFScriptVar v71; // [sp+70h] [-1C0h] BYREF
  idSWFScriptVar v72; // [sp+78h] [-1B8h] BYREF
  idSWFScriptVar v73; // [sp+80h] [-1B0h] BYREF
  idSWFScriptVar v74; // [sp+88h] [-1A8h] BYREF
  idSWFScriptVar v75; // [sp+90h] [-1A0h] BYREF
  idSWFScriptVar v76; // [sp+98h] [-198h] BYREF
  idSWFScriptVar v77; // [sp+A0h] [-190h] BYREF
  idSWFScriptVar v78; // [sp+A8h] [-188h] BYREF
  idSWFScriptVar v79; // [sp+B0h] [-180h] BYREF
  idSWFScriptVar v80; // [sp+B8h] [-178h] BYREF
  idSWFScriptVar v81; // [sp+C0h] [-170h] BYREF
  idSWFScriptVar v82; // [sp+C8h] [-168h] BYREF
  idSWFScriptVar v83; // [sp+D0h] [-160h] BYREF
  idSWFScriptVar v84; // [sp+D8h] [-158h] BYREF
  idSWFScriptVar v85; // [sp+E0h] [-150h] BYREF
  idSWFScriptVar v86; // [sp+E8h] [-148h] BYREF
  idSWFScriptVar v87; // [sp+F0h] [-140h] BYREF
  idSWFScriptVar v88; // [sp+F8h] [-138h] BYREF
  idSWFScriptVar v89; // [sp+100h] [-130h] BYREF
  idSWFScriptVar v90; // [sp+108h] [-128h] BYREF
  idSWFScriptVar v91; // [sp+110h] [-120h] BYREF
  idSWFScriptVar v92; // [sp+118h] [-118h] BYREF
  idSWFScriptVar v93; // [sp+120h] [-110h] BYREF
  idSWFScriptVar v94; // [sp+128h] [-108h] BYREF
  idSWFScriptVar v95; // [sp+130h] [-100h] BYREF
  idSWFScriptVar v96; // [sp+138h] [-F8h] BYREF
  idSWFScriptVar v97; // [sp+140h] [-F0h] BYREF
  idSWFScriptFunction *v98; // [sp+148h] [-E8h]
  idStaticList<idSWFScriptVar,16> v99; // [sp+150h] [-E0h] BYREF

  if ( !gameLocal->GetGamePaused(this: gameLocal)
    && (unsigned __int8)idMainMenu::IsActive(this: gameLocal->mainMenu) == 0
    && common->GetRecordState(this: common) == RECORD_NONE
    && !this->IsDead(this)
    && (unsigned __int8)idClientGame::PlayerIndexIsLocal(this: clientGame, playerNum: this->entityNumber) != 0 )
  {
    presentable = this->presentable;
    v5 = presentable != nullptr ? presentable->GetPlayerInterface_2(this: presentable) : nullptr;
    if ( !idPresentablePlayer::GuiIsActive(this: v5, g: GUI_INVENTORY) )
    {
      v6 = this->presentable;
      if ( v6 != nullptr )
        v7 = v6->GetPlayerInterface_2(this: v6);
      else
        v7 = nullptr;
      PlayerGui = idPresentablePlayer::GetPlayerGui(this: v7, g: GUI_INVENTORY);
      v9 = idSWFScriptObject::Alloc();
      idSWFScriptObject::MakeArray(this: v9);
      v10 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x10u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v10 != nullptr )
      {
        v10[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v10[3].__vftable = (idSWFScriptFunction_vtbl *)v9;
        v11 = v10;
        v10[1].__vftable = nullptr;
        v10->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`22'::idSWFScriptFunction_Category_Refresh::`vftable';
      }
      else
      {
        v11 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v69, nf: v11);
      idSWFScriptObject::Set(this: v9, name: "refresh", value: &v69);
      idSWFScriptVar::Free(this: &v69);
      idSWFScriptVar::idSWFScriptVar(this: &v70, o: v9);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "newCategories", value: &v70);
      idSWFScriptVar::Free(this: &v70);
      idSWFScriptObject::Release(this: v9);
      v12 = idSWFScriptObject::Alloc();
      idSWFScriptObject::MakeArray(this: v12);
      v13 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x18u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v13 != nullptr )
      {
        v13[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v13[3].__vftable = (idSWFScriptFunction_vtbl *)v12;
        v14 = v13;
        HIBYTE(v13[5].__vftable) = inVehicle;
        v13[1].__vftable = nullptr;
        v13->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`23'::idSWFScriptFunction_PlayerInventory_Refresh::`vftable';
      }
      else
      {
        v14 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v84, nf: v14);
      idSWFScriptObject::Set(this: v12, name: "refresh", value: &v84);
      idSWFScriptVar::Free(this: &v84);
      idSWFScriptVar::idSWFScriptVar(this: &v72, o: v12);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "inventory", value: &v72);
      idSWFScriptVar::Free(this: &v72);
      idSWFScriptObject::Release(this: v12);
      v15 = idSWFScriptObject::Alloc();
      idSWFScriptObject::MakeArray(this: v15);
      v16 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x10u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v16 != nullptr )
      {
        v16[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v16[3].__vftable = (idSWFScriptFunction_vtbl *)v15;
        v17 = v16;
        v16[1].__vftable = nullptr;
        v16->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`26'::idSWFScriptFunction_PlayerWeapons_Refresh::`vftable';
      }
      else
      {
        v17 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v94, nf: v17);
      idSWFScriptObject::Set(this: v15, name: "refresh", value: &v94);
      idSWFScriptVar::Free(this: &v94);
      idSWFScriptVar::idSWFScriptVar(this: &v74, o: v15);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "weapons", value: &v74);
      idSWFScriptVar::Free(this: &v74);
      v18 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v18 != nullptr )
      {
        v18[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v18[1].__vftable = nullptr;
        v19 = v18;
        v18->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`27'::idSWFScriptFuntion_PlayerWeapons_EquipWeapon::`vftable';
      }
      else
      {
        v19 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v86, nf: v19);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "equipWeapon", value: &v86);
      idSWFScriptVar::Free(this: &v86);
      v20 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v20 != nullptr )
      {
        v20[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v20[1].__vftable = nullptr;
        v21 = v20;
        v20->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`28'::idSWFScriptFuntion_PlayerWeapons_UnequipWeapon::`vftable';
      }
      else
      {
        v21 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v76, nf: v21);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "unequipWeapon", value: &v76);
      idSWFScriptVar::Free(this: &v76);
      idSWFScriptObject::Release(this: v15);
      v22 = idSWFScriptObject::Alloc();
      idSWFScriptObject::MakeArray(this: v22);
      v23 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x10u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v23 != nullptr )
      {
        v23[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v23[3].__vftable = (idSWFScriptFunction_vtbl *)v22;
        v24 = v23;
        v23[1].__vftable = nullptr;
        v23->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`34'::idSWFScriptFunction_PlayerJobs_Refresh::`vftable';
      }
      else
      {
        v24 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v92, nf: v24);
      idSWFScriptObject::Set(this: v22, name: "refresh", value: &v92);
      idSWFScriptVar::Free(this: &v92);
      v25 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v25 != nullptr )
      {
        v25[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v25[1].__vftable = nullptr;
        v26 = v25;
        v25->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`31'::idSWFScriptFunction_GetActiveJob::`vftable';
      }
      else
      {
        v26 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v78, nf: v26);
      idSWFScriptObject::Set(this: v22, name: "getActive", value: &v78);
      idSWFScriptVar::Free(this: &v78);
      idSWFScriptVar::idSWFScriptVar(this: &v88, o: v22);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "jobs", value: &v88);
      idSWFScriptVar::Free(this: &v88);
      idSWFScriptObject::Release(this: v22);
      v27 = idSWFScriptObject::Alloc();
      idSWFScriptObject::MakeArray(this: v27);
      v28 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x10u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v28 != nullptr )
      {
        v28[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v28[3].__vftable = (idSWFScriptFunction_vtbl *)v27;
        v29 = v28;
        v28[1].__vftable = nullptr;
        v28->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`37'::idSWFScriptFunction_PlayerSchematics_Refresh::`vftable';
      }
      else
      {
        v29 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v80, nf: v29);
      idSWFScriptObject::Set(this: v27, name: "refresh", value: &v80);
      idSWFScriptVar::Free(this: &v80);
      idSWFScriptVar::idSWFScriptVar(this: &v96, o: v27);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "schematics", value: &v96);
      idSWFScriptVar::Free(this: &v96);
      idSWFScriptObject::Release(this: v27);
      v30 = idSWFScriptObject::Alloc();
      idSWFScriptObject::MakeArray(this: v30);
      v31 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x10u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v31 != nullptr )
      {
        v31[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v31[3].__vftable = (idSWFScriptFunction_vtbl *)v30;
        v32 = v31;
        v31[1].__vftable = nullptr;
        v31->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`38'::idSWFScriptFunction_PlayerVehicles_Refresh::`vftable';
      }
      else
      {
        v32 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v82, nf: v32);
      idSWFScriptObject::Set(this: v30, name: "refresh", value: &v82);
      idSWFScriptVar::Free(this: &v82);
      idSWFScriptVar::idSWFScriptVar(this: &v68, o: v30);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "vehicles", value: &v68);
      idSWFScriptVar::Free(this: &v68);
      idSWFScriptObject::Release(this: v30);
      v33 = idSWFScriptObject::Alloc();
      idSWFScriptObject::MakeArray(this: v33);
      v34 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x10u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v34 != nullptr )
      {
        v34[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v34[3].__vftable = (idSWFScriptFunction_vtbl *)v33;
        v35 = v34;
        v34[1].__vftable = nullptr;
        v34->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`43'::idSWFScriptFunction_PlayerInventory_GetPersonalStats::`vftable';
      }
      else
      {
        v35 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v67, nf: v35);
      idSWFScriptObject::Set(this: v33, name: "refresh", value: &v67);
      idSWFScriptVar::Free(this: &v67);
      idSWFScriptVar::idSWFScriptVar(this: &v71, o: v33);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "personalStats", value: &v71);
      idSWFScriptVar::Free(this: &v71);
      idSWFScriptObject::Release(this: v33);
      idSWFScriptVar::idSWFScriptVar(this: &v73, b: false);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "isDemo", value: &v73);
      idSWFScriptVar::Free(this: &v73);
      v36 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v36 != nullptr )
      {
        v36[1].__vftable = nullptr;
        v37 = v36;
        v36[2].__vftable = nullptr;
        v36->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`19'::idSWFScriptFunction_CanScrollJobs::`vftable';
      }
      else
      {
        v37 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v75, nf: v37);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "canScrollJobs", value: &v75);
      idSWFScriptVar::Free(this: &v75);
      v38 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v38 != nullptr )
      {
        v38[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v38[1].__vftable = nullptr;
        v39 = v38;
        v38->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`35'::idSWFScriptFunction_PlayerInventory_GetCash::`vftable';
      }
      else
      {
        v39 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v77, nf: v39);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "getCash", value: &v77);
      idSWFScriptVar::Free(this: &v77);
      v40 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v40 != nullptr )
      {
        v40[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v40[1].__vftable = nullptr;
        v41 = v40;
        v40->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`36'::idSWFScriptFunction_PlayerInventory_GetVehicleCash::`vftable';
      }
      else
      {
        v41 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v79, nf: v41);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "getVehicleCash", value: &v79);
      idSWFScriptVar::Free(this: &v79);
      v42 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      v98 = v42;
      if ( v42 != nullptr )
      {
        v43 = this->presentable;
        if ( v43 != nullptr )
          v44 = (int)v43->GetPlayerInterface_2(this: v43);
        else
          v44 = 0;
        v42[2].__vftable = (idSWFScriptFunction_vtbl *)v44;
        v42[1].__vftable = nullptr;
        v45 = v42;
        v42->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`24'::idSWFScriptFunction_PlayerUnequipItem::`vftable';
      }
      else
      {
        v45 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v81, nf: v45);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "unequipItem", value: &v81);
      idSWFScriptVar::Free(this: &v81);
      v46 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v46 != nullptr )
      {
        v46[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v46[1].__vftable = nullptr;
        v47 = v46;
        v46->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`39'::idSWFScriptFunction_PlayerInventory_Deactivate::`vftable';
      }
      else
      {
        v47 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v83, nf: v47);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "shutdown", value: &v83);
      idSWFScriptVar::Free(this: &v83);
      v48 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x10u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v48 != nullptr )
      {
        v48[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v48[3].__vftable = (idSWFScriptFunction_vtbl *)PlayerGui;
        v49 = v48;
        v48[1].__vftable = nullptr;
        v48->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`41'::idSWFScriptFunction_PlayerInventory_UseDeactivate::`vftable';
      }
      else
      {
        v49 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v85, nf: v49);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "useShutdown", value: &v85);
      idSWFScriptVar::Free(this: &v85);
      v50 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0x10u,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v50 != nullptr )
      {
        v50[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v50[3].__vftable = (idSWFScriptFunction_vtbl *)PlayerGui;
        v51 = v50;
        v50[1].__vftable = nullptr;
        v50->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`40'::idSWFScriptFunction_PlayerInventory_EquipDeactivate::`vftable';
      }
      else
      {
        v51 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v87, nf: v51);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "equipShutdown", value: &v87);
      idSWFScriptVar::Free(this: &v87);
      idSWFScriptVar::idSWFScriptVar(
        this: &v89,
        i: (idSWFScriptVar::swfScriptVarValue_t *)this->infoMessages.savedInventoryScreen);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "playerSavedInventoryScreen", value: &v89);
      idSWFScriptVar::Free(this: &v89);
      v52 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v52 != nullptr )
      {
        v52[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v52[1].__vftable = nullptr;
        v53 = v52;
        v52->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`42'::idSWFScriptFunction_PlayerInventory_SetInventoryScreen::`vftable';
      }
      else
      {
        v53 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v91, nf: v53);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "setPlayerSavedInventoryScreen", value: &v91);
      idSWFScriptVar::Free(this: &v91);
      v54 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v54 != nullptr )
      {
        v54[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v54[1].__vftable = nullptr;
        v55 = v54;
        v54->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`25'::idSWFScriptFunction_PlayerInventory_AvailQuickSlot::`vftable';
      }
      else
      {
        v55 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v93, nf: v55);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "availQuick", value: &v93);
      idSWFScriptVar::Free(this: &v93);
      v56 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v56 != nullptr )
      {
        v56[1].__vftable = nullptr;
        v57 = v56;
        v56[2].__vftable = nullptr;
        v56->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`20'::idSWFScriptFunction_GetScreenFade::`vftable';
      }
      else
      {
        v57 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v95, nf: v57);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "getFade", value: &v95);
      idSWFScriptVar::Free(this: &v95);
      v58 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v58 != nullptr )
      {
        v58[1].__vftable = nullptr;
        v59 = v58;
        v58[2].__vftable = nullptr;
        v58->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`21'::idSWFScriptFunction_GetShouldScreenFade::`vftable';
      }
      else
      {
        v59 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v97, nf: v59);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "getShouldFade", value: &v97);
      idSWFScriptVar::Free(this: &v97);
      v60 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                     this: &mem,
                                     location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                     size: 0xCu,
                                     tag: TAG_SWF,
                                     zeroBuffer: false,
                                     align: ALIGN_16,
                                     heap: HEAP_DEFAULTHEAP);
      if ( v60 != nullptr )
      {
        v60[2].__vftable = (idSWFScriptFunction_vtbl *)this;
        v60[1].__vftable = nullptr;
        v61 = v60;
        v60->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowInventory'::`44'::idSWFScriptFunciton_TriggerEntity::`vftable';
      }
      else
      {
        v61 = nullptr;
      }
      idSWFScriptVar::idSWFScriptVar(this: &v90, nf: v61);
      idSWFScriptObject::Set(this: PlayerGui->globals, name: "triggerEntity", value: &v90);
      idSWFScriptVar::Free(this: &v90);
      v62 = this->presentable;
      if ( v62 != nullptr )
        v63 = v62->GetPlayerInterface_2(this: v62);
      else
        v63 = nullptr;
      idPresentablePlayer::ClearPickupItems(this: v63);
      PlayerHud = (idPlayerHud *)idPlayer::GetPlayerHud(this);
      idPlayerHud::SetHudState(this: PlayerHud, state: HUDSTATE_DAMAGE);
      v65 = this->presentable;
      if ( v65 != nullptr )
        v66 = (int)v65->GetPlayerInterface_2(this: v65);
      else
        v66 = 0;
      idView::ForceBlurValues(this: (idView *)(v66 + 16224), blurBegin: 0.5, blurEnd: 0.5, blurTime: 0.0);
      idSWF::Activate(this: PlayerGui, b: true);
      idStaticList<idSWFScriptVar,16>::idStaticList<idSWFScriptVar,16>(this: &v99);
      idList<idSWFScriptVar,72>::~idList<idSWFScriptVar,72>(this: &v99);
      idSWF::Invoke(this: PlayerGui, functionName: "activatePage", parms: (const idSWFParmList *)&v99);
      idStaticList<idSWFScriptVar,16>::~idStaticList<idSWFScriptVar,16>(this: &v99);
    }
  }
}


// ========================================================================
// __unwind$547007
// EA  : 0x82E783E8
// RVA : 0x00E783E8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547007()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 96));
}


// ========================================================================
// __unwind$547008
// EA  : 0x82E78410
// RVA : 0x00E78410
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547008()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 104));
}


// ========================================================================
// __unwind$547010
// EA  : 0x82E78438
// RVA : 0x00E78438
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547010()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 216));
}


// ========================================================================
// __unwind$547011
// EA  : 0x82E78460
// RVA : 0x00E78460
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547011()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 120));
}


// ========================================================================
// __unwind$547013
// EA  : 0x82E78488
// RVA : 0x00E78488
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547013()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 296));
}


// ========================================================================
// __unwind$547014
// EA  : 0x82E784B0
// RVA : 0x00E784B0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547014()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 136));
}


// ========================================================================
// __unwind$547016
// EA  : 0x82E784D8
// RVA : 0x00E784D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547016()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 232));
}


// ========================================================================
// __unwind$547018
// EA  : 0x82E78500
// RVA : 0x00E78500
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547018()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 152));
}


// ========================================================================
// __unwind$547020
// EA  : 0x82E78528
// RVA : 0x00E78528
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547020()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 280));
}


// ========================================================================
// __unwind$547022
// EA  : 0x82E78550
// RVA : 0x00E78550
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547022()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 168));
}


// ========================================================================
// __unwind$547023
// EA  : 0x82E78578
// RVA : 0x00E78578
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547023()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 248));
}


// ========================================================================
// __unwind$547025
// EA  : 0x82E785A0
// RVA : 0x00E785A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547025()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 184));
}


// ========================================================================
// __unwind$547026
// EA  : 0x82E785C8
// RVA : 0x00E785C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547026()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 312));
}


// ========================================================================
// __unwind$547028
// EA  : 0x82E785F0
// RVA : 0x00E785F0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547028()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 200));
}


// ========================================================================
// __unwind$547029
// EA  : 0x82E78618
// RVA : 0x00E78618
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547029()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 88));
}


// ========================================================================
// __unwind$547031
// EA  : 0x82E78640
// RVA : 0x00E78640
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547031()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 80));
}


// ========================================================================
// __unwind$547032
// EA  : 0x82E78668
// RVA : 0x00E78668
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547032()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 112));
}


// ========================================================================
// __unwind$547033
// EA  : 0x82E78690
// RVA : 0x00E78690
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547033()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 128));
}


// ========================================================================
// __unwind$547035
// EA  : 0x82E786B8
// RVA : 0x00E786B8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547035()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 144));
}


// ========================================================================
// __unwind$547037
// EA  : 0x82E786E0
// RVA : 0x00E786E0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547037()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 160));
}


// ========================================================================
// __unwind$547039_0
// EA  : 0x82E78708
// RVA : 0x00E78708
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547039_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 176));
}


// ========================================================================
// __unwind$547040
// EA  : 0x82E78730
// RVA : 0x00E78730
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547040()
{
  int v0; // r12

  operator delete(p: *(void **)(v0 - 560 + 328), tag: TAG_SWF);
}


// ========================================================================
// __unwind$547041_0
// EA  : 0x82E7875C
// RVA : 0x00E7875C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547041_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 192));
}


// ========================================================================
// __unwind$547043
// EA  : 0x82E78784
// RVA : 0x00E78784
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547043()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 208));
}


// ========================================================================
// __unwind$547045
// EA  : 0x82E787AC
// RVA : 0x00E787AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547045()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 224));
}


// ========================================================================
// __unwind$547047
// EA  : 0x82E787D4
// RVA : 0x00E787D4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547047()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 240));
}


// ========================================================================
// __unwind$547048
// EA  : 0x82E787FC
// RVA : 0x00E787FC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547048()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 256));
}


// ========================================================================
// __unwind$547050
// EA  : 0x82E78824
// RVA : 0x00E78824
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547050()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 272));
}


// ========================================================================
// __unwind$547052
// EA  : 0x82E7884C
// RVA : 0x00E7884C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547052()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 288));
}


// ========================================================================
// __unwind$547054
// EA  : 0x82E78874
// RVA : 0x00E78874
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547054()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 304));
}


// ========================================================================
// __unwind$547056
// EA  : 0x82E7889C
// RVA : 0x00E7889C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547056()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 320));
}


// ========================================================================
// __unwind$547058
// EA  : 0x82E788C4
// RVA : 0x00E788C4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547058()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 560 + 264));
}


// ========================================================================
// __unwind$547059
// EA  : 0x82E788EC
// RVA : 0x00E788EC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_547059()
{
  int v0; // r12

  idSWFParmList::~idSWFParmList(this: (idSWFParmList *)(v0 - 560 + 336));
}


// ========================================================================
// ?EnterPersonalGarage@idPlayer@@QAAPAVidSWF@@PAVidTownGarageCamera@@@Z
// EA  : 0x82E78920
// RVA : 0x00E78920
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWF *__fastcall idPlayer::EnterPersonalGarage(idPlayer *this, idTownGarageCamera *camera)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v5; // r3
  idSWF *PlayerGui; // r23
  idInventoryCollection *v7; // r25
  int i; // r24
  idInventoryItem *InventoryItem; // r30
  const idDeclInventory *decl; // r18
  int v11; // r3
  idSWFScriptVar::swfScriptVarValue_t v12; // r30
  idSWFScriptVar *v13; // r3
  const idDeclInventory *v14; // r18
  int v15; // r3
  idSWFScriptVar::swfScriptVarValue_t v16; // r30
  const idDeclInventory *v17; // r18
  int v18; // r3
  idSWFScriptVar::swfScriptVarValue_t v19; // r30
  bool v20; // r29
  _DWORD *v21; // r3
  idSWFScriptVar::swfScriptVarValue_t v22; // r30
  _DWORD *v23; // r3
  idSWFScriptVar::swfScriptVarValue_t v24; // r30
  idTownGarageCamera *ExitTownName; // r3
  const char *String; // r3
  const idStr *v27; // r30
  char *ExitTownImage; // r3
  const idStr *v29; // r30
  idSWFScriptVar *v30; // r3
  const idStr *v31; // r18
  const idStr *v32; // r30
  _DWORD *v33; // r3
  idSWFScriptVar::swfScriptVarValue_t v34; // r30
  _DWORD *v35; // r3
  idSWFScriptVar::swfScriptVarValue_t v36; // r30
  _DWORD *v37; // r3
  idSWFScriptVar::swfScriptVarValue_t v38; // r30
  _DWORD *v39; // r3
  idSWFScriptVar::swfScriptVarValue_t v40; // r30
  _DWORD *v41; // r3
  idSWFScriptVar::swfScriptVarValue_t v42; // r30
  _DWORD *v43; // r3
  idSWFScriptVar::swfScriptVarValue_t v44; // r30
  _DWORD *v45; // r3
  idSWFScriptVar::swfScriptVarValue_t v46; // r30
  _DWORD *v47; // r3
  idSWFScriptVar::swfScriptVarValue_t v48; // r30
  _DWORD *v49; // r3
  idSWFScriptVar::swfScriptVarValue_t v50; // r30
  _DWORD *v51; // r3
  idSWFScriptVar::swfScriptVarValue_t v52; // r30
  _DWORD *v53; // r3
  idSWFScriptVar::swfScriptVarValue_t v54; // r30
  _DWORD *v55; // r3
  idSWFScriptVar::swfScriptVarValue_t v56; // r30
  _DWORD *v57; // r3
  idSWFScriptVar::swfScriptVarValue_t v58; // r30
  idSWFScriptObject *v59; // r30
  _DWORD *v60; // r3
  idSWFScriptVar::swfScriptVarValue_t v61; // r29
  _DWORD *v63; // r3
  idSWFScriptVar::swfScriptVarValue_t v64; // r30
  _DWORD *v65; // r3
  idSWFScriptVar::swfScriptVarValue_t v66; // r30
  _DWORD *v67; // r3
  idSWFScriptVar::swfScriptVarValue_t v68; // r30
  _DWORD *v69; // r3
  idSWFScriptVar::swfScriptVarValue_t v70; // r30
  _DWORD *v71; // r3
  idSWFScriptVar::swfScriptVarValue_t v72; // r30
  _DWORD *v73; // r3
  idSWFScriptVar::swfScriptVarValue_t v74; // r30
  _DWORD *v75; // r3
  idSWFScriptVar::swfScriptVarValue_t v76; // r30
  _DWORD *v77; // r3
  idSWFScriptVar::swfScriptVarValue_t v78; // r30
  _DWORD *v79; // r3
  idSWFScriptVar::swfScriptVarValue_t v80; // r30
  idVehicleKey *CurrentKey; // r3
  idVehicleKey *v82; // r29
  idVehicle *VehicleFromKey; // r3
  idVehicle *v84; // r30
  idPresentable *v85; // r3
  int v86; // r3
  idSWFScriptVar *list; // r29
  int size; // r30
  idSWFScriptVar *v89; // r28
  idPresentable *v90; // r3
  idPresentablePlayer *v91; // r3
  idSWFScriptVar v93; // [sp+50h] [-2E0h] BYREF
  idSWFScriptVar v94; // [sp+58h] [-2D8h] BYREF
  idSWFScriptVar v95; // [sp+60h] [-2D0h] BYREF
  idSWFScriptVar v96; // [sp+68h] [-2C8h] BYREF
  idSWFScriptVar v97; // [sp+70h] [-2C0h] BYREF
  idSWFScriptVar v98; // [sp+78h] [-2B8h] BYREF
  idSWFScriptVar v99; // [sp+80h] [-2B0h] BYREF
  idSWFScriptVar v100; // [sp+88h] [-2A8h] BYREF
  idSWFScriptVar v101; // [sp+90h] [-2A0h] BYREF
  idSWFScriptVar v102; // [sp+98h] [-298h] BYREF
  idSWFScriptVar v103; // [sp+A0h] [-290h] BYREF
  idSWFScriptVar v104; // [sp+A8h] [-288h] BYREF
  idSWFScriptVar v105; // [sp+B0h] [-280h] BYREF
  idSWFScriptVar v106; // [sp+B8h] [-278h] BYREF
  idSWFScriptVar v107; // [sp+C0h] [-270h] BYREF
  idSWFScriptVar v108; // [sp+C8h] [-268h] BYREF
  idSWFScriptVar v109; // [sp+D0h] [-260h] BYREF
  idSWFScriptVar v110; // [sp+D8h] [-258h] BYREF
  idSWFScriptVar v111; // [sp+E0h] [-250h] BYREF
  idSWFScriptVar v112; // [sp+E8h] [-248h] BYREF
  idSWFScriptVar v113; // [sp+F0h] [-240h] BYREF
  idSWFScriptVar v114; // [sp+F8h] [-238h] BYREF
  idSWFScriptVar v115; // [sp+100h] [-230h] BYREF
  idSWFScriptVar v116; // [sp+108h] [-228h] BYREF
  idSWFScriptVar v117; // [sp+110h] [-220h] BYREF
  idSWFScriptVar v118; // [sp+118h] [-218h] BYREF
  idSWFScriptVar v119; // [sp+120h] [-210h] BYREF
  idSWFScriptVar v120; // [sp+128h] [-208h] BYREF
  idSWFScriptVar v121; // [sp+130h] [-200h] BYREF
  idSWFScriptVar v122; // [sp+138h] [-1F8h] BYREF
  idSWFScriptVar v123; // [sp+140h] [-1F0h] BYREF
  idSWFScriptVar v124; // [sp+148h] [-1E8h] BYREF
  idSWFScriptVar v125; // [sp+150h] [-1E0h] BYREF
  idSWFScriptVar v126; // [sp+158h] [-1D8h] BYREF
  idSWFScriptVar v127; // [sp+160h] [-1D0h] BYREF
  idSWFScriptVar v128; // [sp+168h] [-1C8h] BYREF
  idSWFScriptVar v129; // [sp+170h] [-1C0h] BYREF
  idTownGarageManager *garageManager; // [sp+178h] [-1B8h]
  idStr v131; // [sp+180h] [-1B0h] BYREF
  idStr v132; // [sp+1A0h] [-190h] BYREF
  idStr v133; // [sp+1C0h] [-170h] BYREF
  idStr v134; // [sp+1E0h] [-150h] BYREF
  idStr v135; // [sp+200h] [-130h] BYREF
  idStaticList<idSWFScriptVar,16> v136; // [sp+220h] [-110h] BYREF

  presentable = this->presentable;
  if ( presentable != nullptr )
    v5 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v5 = nullptr;
  PlayerGui = idPresentablePlayer::GetPlayerGui(this: v5, g: GUI_PLAYERGARAGE);
  v119.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v119);
  v119.value.i = 0;
  v119.type = SWF_VAR_INTEGER;
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "mgAmmo", value: &v119);
  idSWFScriptVar::Free(this: &v119);
  v127.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v127);
  v127.type = SWF_VAR_INTEGER;
  v127.value.i = 0;
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "rocketAmmo", value: &v127);
  idSWFScriptVar::Free(this: &v127);
  v126.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v126);
  v126.type = SWF_VAR_INTEGER;
  v126.value.i = 0;
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "energyAmmo", value: &v126);
  idSWFScriptVar::Free(this: &v126);
  v7 = this->GetInventory_2(this);
  for ( i = 0; i < (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v7); ++i )
  {
    InventoryItem = idInventoryCollection::GetInventoryItem(this: v7, index: i);
    if ( InventoryItem != nullptr )
    {
      decl = InventoryItem->decl;
      if ( decl == idTownGarageCamera::GetVehicleMGAmmo(this: camera) )
      {
        v11 = InventoryItem->GetCount(this: InventoryItem);
        v124.type = SWF_VAR_UNDEF;
        v12.i = v11;
        idSWFScriptVar::Free(this: &v124);
        v124.value = v12;
        v124.type = SWF_VAR_INTEGER;
        idSWFScriptObject::Set(this: PlayerGui->globals, name: "mgAmmo", value: &v124);
        v13 = &v124;
_M549485:
        idSWFScriptVar::Free(this: v13);
        continue;
      }
      v14 = InventoryItem->decl;
      if ( v14 == idTownGarageCamera::GetVehicleRocketAmmo(this: camera) )
      {
        v15 = InventoryItem->GetCount(this: InventoryItem);
        v128.type = SWF_VAR_UNDEF;
        v16.i = v15;
        idSWFScriptVar::Free(this: &v128);
        v128.value = v16;
        v128.type = SWF_VAR_INTEGER;
        idSWFScriptObject::Set(this: PlayerGui->globals, name: "rocketAmmo", value: &v128);
        v13 = &v128;
        goto _M549485;
      }
      v17 = InventoryItem->decl;
      if ( v17 == idTownGarageCamera::GetVehicleEnergyAmmo(this: camera) )
      {
        v18 = InventoryItem->GetCount(this: InventoryItem);
        v121.type = SWF_VAR_UNDEF;
        v19.i = v18;
        idSWFScriptVar::Free(this: &v121);
        v121.value = v19;
        v121.type = SWF_VAR_INTEGER;
        idSWFScriptObject::Set(this: PlayerGui->globals, name: "energyAmmo", value: &v121);
        v13 = &v121;
        goto _M549485;
      }
    }
  }
  v20 = true;
  if ( camera != nullptr )
  {
    garageManager = camera->garageManager;
    if ( garageManager != nullptr )
      v20 = garageManager->garage != GARAGE_SUBWAYTOWN;
  }
  v21 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x14u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v21 != nullptr )
  {
    v21[2] = this;
    v21[4] = camera;
    v22.i = (int)v21;
    v21[1] = 0;
    *v21 = &`idPlayer::EnterPersonalGarage'::`7'::idSWFScriptFunction_PlayerGarage_ExitGarageToTown::`vftable';
  }
  else
  {
    v22.i = 0;
  }
  v95.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v95);
  if ( v22.i != 0 )
  {
    v95.value = v22;
    v95.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v22.i + 8))(a1: v22.i);
  }
  else
  {
    v95.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "exitGarageToTown", value: &v95);
  idSWFScriptVar::Free(this: &v95);
  v23 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x14u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v23 != nullptr )
  {
    v23[2] = this;
    v23[4] = camera;
    v24.i = (int)v23;
    v23[1] = 0;
    *v23 = &`idPlayer::EnterPersonalGarage'::`8'::idSWFScriptFunction_PlayerGarage_ExitGarageToWasteland::`vftable';
  }
  else
  {
    v24.i = 0;
  }
  v110.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v110);
  if ( v24.i != 0 )
  {
    v110.value = v24;
    v110.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v24.i + 8))(a1: v24.i);
  }
  else
  {
    v110.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "exitGarageToWasteland", value: &v110);
  idSWFScriptVar::Free(this: &v110);
  if ( camera != nullptr )
  {
    ExitTownName = idTownGarageCamera::GetExitTownName(this: (idTownGarageCamera *)&v133, result: (idStr *)camera);
    String = idLocalization::GetString(inString: (const char *)ExitTownName->listenerList);
    v123.type = SWF_VAR_UNDEF;
    v27 = idStr::idStr(this: &v135, text: String);
    idSWFScriptVar::Free(this: &v123);
    v123.type = SWF_VAR_STRING;
    v123.value.i = (int)idSWFScriptString::Alloc(s: v27);
    idStr::FreeData(this: &v135);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "exitTownName", value: &v123);
    idSWFScriptVar::Free(this: &v123);
    idStr::FreeData(this: &v133);
    ExitTownImage = idTownGarageCamera::GetExitTownImage(this: camera);
    v125.type = SWF_VAR_UNDEF;
    v29 = idStr::idStr(this: &v131, text: ExitTownImage);
    idSWFScriptVar::Free(this: &v125);
    v125.type = SWF_VAR_STRING;
    v125.value.i = (int)idSWFScriptString::Alloc(s: v29);
    idStr::FreeData(this: &v131);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "exitTownImage", value: &v125);
    v30 = &v125;
  }
  else
  {
    v120.type = SWF_VAR_UNDEF;
    v31 = idStr::idStr(this: &v132, text: &byte_8200D768);
    idSWFScriptVar::Free(this: &v120);
    v120.type = SWF_VAR_STRING;
    v120.value.i = (int)idSWFScriptString::Alloc(s: v31);
    idStr::FreeData(this: &v132);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "exitTownName", value: &v120);
    idSWFScriptVar::Free(this: &v120);
    v129.type = SWF_VAR_UNDEF;
    v32 = idStr::idStr(this: &v134, text: &byte_8200D768);
    idSWFScriptVar::Free(this: &v129);
    v129.type = SWF_VAR_STRING;
    v129.value.i = (int)idSWFScriptString::Alloc(s: v32);
    idStr::FreeData(this: &v134);
    idSWFScriptObject::Set(this: PlayerGui->globals, name: "exitTownImage", value: &v129);
    v30 = &v129;
  }
  idSWFScriptVar::Free(this: v30);
  v33 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x10u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v33 != nullptr )
  {
    v33[2] = this;
    v33[3] = camera;
    v34.i = (int)v33;
    v33[1] = 0;
    *v33 = &`idPlayer::EnterPersonalGarage'::`32'::idSWFScriptFunction_PlayerGarage_GetNumVehicleKills::`vftable';
  }
  else
  {
    v34.i = 0;
  }
  v97.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v97);
  if ( v34.i != 0 )
  {
    v97.value = v34;
    v97.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v34.i + 8))(a1: v34.i);
  }
  else
  {
    v97.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "numKills", value: &v97);
  idSWFScriptVar::Free(this: &v97);
  v122.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v122);
  v122.value.b = v20;
  v122.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "isWellspring", value: &v122);
  idSWFScriptVar::Free(this: &v122);
  v35 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x10u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v35 != nullptr )
  {
    v35[2] = this;
    v35[3] = camera;
    v36.i = (int)v35;
    v35[1] = 0;
    *v35 = &`idPlayer::EnterPersonalGarage'::`15'::idSWFScriptFunction_PlayerGarage_RepairVehicle::`vftable';
  }
  else
  {
    v36.i = 0;
  }
  v112.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v112);
  if ( v36.i != 0 )
  {
    v112.value = v36;
    v112.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v36.i + 8))(a1: v36.i);
  }
  else
  {
    v112.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "repair", value: &v112);
  idSWFScriptVar::Free(this: &v112);
  v37 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x10u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v37 != nullptr )
  {
    v37[2] = this;
    v37[3] = camera;
    v38.i = (int)v37;
    v37[1] = 0;
    *v37 = &`idPlayer::EnterPersonalGarage'::`14'::idSWFScriptFunction_PlayerGarage_CanRepairVehicle::`vftable';
  }
  else
  {
    v38.i = 0;
  }
  v99.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v99);
  if ( v38.i != 0 )
  {
    v99.value = v38;
    v99.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v38.i + 8))(a1: v38.i);
  }
  else
  {
    v99.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "canrepair", value: &v99);
  idSWFScriptVar::Free(this: &v99);
  v39 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v39 != nullptr )
  {
    v39[2] = this;
    v39[1] = 0;
    v40.i = (int)v39;
    *v39 = &`idPlayer::EnterPersonalGarage'::`16'::idSWFScriptFunction_PlayerGarage_GetCash::`vftable';
  }
  else
  {
    v40.i = 0;
  }
  v114.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v114);
  if ( v40.i != 0 )
  {
    v114.value = v40;
    v114.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v40.i + 8))(a1: v40.i);
  }
  else
  {
    v114.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "cash", value: &v114);
  idSWFScriptVar::Free(this: &v114);
  v41 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v41 != nullptr )
  {
    v41[2] = camera;
    v41[1] = 0;
    v42.i = (int)v41;
    *v41 = &`idPlayer::EnterPersonalGarage'::`17'::idSWFScriptFunction_PlayerGarage_GetVehicleDamage::`vftable';
  }
  else
  {
    v42.i = 0;
  }
  v101.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v101);
  if ( v42.i != 0 )
  {
    v101.value = v42;
    v101.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v42.i + 8))(a1: v42.i);
  }
  else
  {
    v101.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "damage", value: &v101);
  idSWFScriptVar::Free(this: &v101);
  v43 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v43 != nullptr )
  {
    v43[2] = camera;
    v43[1] = 0;
    v44.i = (int)v43;
    *v43 = &`idPlayer::EnterPersonalGarage'::`18'::idSWFScriptFunction_PlayerGarage_GetVehicleRepairCost::`vftable';
  }
  else
  {
    v44.i = 0;
  }
  v116.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v116);
  if ( v44.i != 0 )
  {
    v116.value = v44;
    v116.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v44.i + 8))(a1: v44.i);
  }
  else
  {
    v116.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "repairCost", value: &v116);
  idSWFScriptVar::Free(this: &v116);
  v45 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v45 != nullptr )
  {
    v45[2] = camera;
    v45[1] = 0;
    v46.i = (int)v45;
    *v45 = &`idPlayer::EnterPersonalGarage'::`26'::idSWFScriptFunction_PlayerGarage_ZoomToTrophy::`vftable';
  }
  else
  {
    v46.i = 0;
  }
  v103.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v103);
  if ( v46.i != 0 )
  {
    v103.value = v46;
    v103.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v46.i + 8))(a1: v46.i);
  }
  else
  {
    v103.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "zoomToTrophy", value: &v103);
  idSWFScriptVar::Free(this: &v103);
  v47 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v47 != nullptr )
  {
    v47[2] = camera;
    v47[1] = 0;
    v48.i = (int)v47;
    *v47 = &`idPlayer::EnterPersonalGarage'::`27'::idSWFScriptFunction_PlayerGarage_ZoomFromTrohpy::`vftable';
  }
  else
  {
    v48.i = 0;
  }
  v118.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v118);
  if ( v48.i != 0 )
  {
    v118.value = v48;
    v118.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v48.i + 8))(a1: v48.i);
  }
  else
  {
    v118.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "zoomFromTrophy", value: &v118);
  idSWFScriptVar::Free(this: &v118);
  v49 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v49 != nullptr )
  {
    v49[2] = camera;
    v49[1] = 0;
    v50.i = (int)v49;
    *v49 = &`idPlayer::EnterPersonalGarage'::`28'::idSWFScriptFunction_PlayerGarage_ToggleCarTrophyView::`vftable';
  }
  else
  {
    v50.i = 0;
  }
  v105.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v105);
  if ( v50.i != 0 )
  {
    v105.value = v50;
    v105.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v50.i + 8))(a1: v50.i);
  }
  else
  {
    v105.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "toggleCarTrophyView", value: &v105);
  idSWFScriptVar::Free(this: &v105);
  v51 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x10u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v51 != nullptr )
  {
    v51[3] = this;
    v51[1] = 0;
    v52.i = (int)v51;
    *v51 = &`idPlayer::EnterPersonalGarage'::`4'::idSWFScriptFunction_PlayerGarage_EquipItem::`vftable';
  }
  else
  {
    v52.i = 0;
  }
  v115.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v115);
  if ( v52.i != 0 )
  {
    v115.value = v52;
    v115.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v52.i + 8))(a1: v52.i);
  }
  else
  {
    v115.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "equipItem", value: &v115);
  idSWFScriptVar::Free(this: &v115);
  v53 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x10u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v53 != nullptr )
  {
    v53[3] = this;
    v53[1] = 0;
    v54.i = (int)v53;
    *v53 = &`idPlayer::EnterPersonalGarage'::`5'::idSWFScriptFunction_PlayerGarage_IsItemEquipped::`vftable';
  }
  else
  {
    v54.i = 0;
  }
  v107.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v107);
  if ( v54.i != 0 )
  {
    v107.value = v54;
    v107.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v54.i + 8))(a1: v54.i);
  }
  else
  {
    v107.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "isItemEquipped", value: &v107);
  idSWFScriptVar::Free(this: &v107);
  v55 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x10u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v55 != nullptr )
  {
    v55[3] = this;
    v55[1] = 0;
    v56.i = (int)v55;
    *v55 = &`idPlayer::EnterPersonalGarage'::`6'::idSWFScriptFunction_PlayerGarage_UnequipItem::`vftable';
  }
  else
  {
    v56.i = 0;
  }
  v113.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v113);
  if ( v56.i != 0 )
  {
    v113.value = v56;
    v113.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v56.i + 8))(a1: v56.i);
  }
  else
  {
    v113.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "unequipItem", value: &v113);
  idSWFScriptVar::Free(this: &v113);
  v57 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v57 != nullptr )
  {
    v57[2] = camera;
    v57[1] = 0;
    v58.i = (int)v57;
    *v57 = &`idPlayer::EnterPersonalGarage'::`19'::idSWFScriptFunction_PlayerGarage_CanTune::`vftable';
  }
  else
  {
    v58.i = 0;
  }
  v109.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v109);
  if ( v58.i != 0 )
  {
    v109.value = v58;
    v109.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v58.i + 8))(a1: v58.i);
  }
  else
  {
    v109.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "canTune", value: &v109);
  idSWFScriptVar::Free(this: &v109);
  v59 = idSWFScriptObject::Alloc();
  idSWFScriptObject::MakeArray(this: v59);
  v60 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x10u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v60 != nullptr )
  {
    v60[2] = v59;
    v60[3] = this;
    v61.i = (int)v60;
    v60[1] = 0;
    *v60 = &`idPlayer::EnterPersonalGarage'::`3'::idSWFScriptFunction_PlayerGarage_RefreshQuickItems::`vftable';
  }
  else
  {
    v61.i = 0;
  }
  v117.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v117);
  if ( v61.i != 0 )
  {
    v117.value = v61;
    v117.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v61.i + 8))(a1: v61.i);
  }
  else
  {
    v117.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: v59, name: "refresh", value: &v117);
  idSWFScriptVar::Free(this: &v117);
  v111.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v111);
  if ( v59 != nullptr )
  {
    v111.value.i = (int)v59;
    v111.type = SWF_VAR_OBJECT;
    ++v59->refCount;
  }
  else
  {
    v111.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "quickItems", value: &v111);
  idSWFScriptVar::Free(this: &v111);
  if ( v59->refCount-- == 1 )
  {
    idSWFScriptObject::~idSWFScriptObject(this: v59);
    idMem::Free(this: &mem, ptr: v59, align: ALIGN_16);
  }
  v63 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v63 != nullptr )
  {
    v63[2] = this;
    v63[1] = 0;
    v64.i = (int)v63;
    *v63 = &`idPlayer::EnterPersonalGarage'::`29'::idSWFScriptFunction_PlayerGarage_ToggleGarageBlur::`vftable';
  }
  else
  {
    v64.i = 0;
  }
  v104.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v104);
  if ( v64.i != 0 )
  {
    v104.value = v64;
    v104.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v64.i + 8))(a1: v64.i);
  }
  else
  {
    v104.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "toggleGarageBlur", value: &v104);
  idSWFScriptVar::Free(this: &v104);
  v65 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v65 != nullptr )
  {
    v65[2] = this;
    v65[1] = 0;
    v66.i = (int)v65;
    *v65 = &`idPlayer::EnterPersonalGarage'::`30'::idSWFScriptFunction_PlayerGarage_UpdateSchematic::`vftable';
  }
  else
  {
    v66.i = 0;
  }
  v106.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v106);
  if ( v66.i != 0 )
  {
    v106.value = v66;
    v106.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v66.i + 8))(a1: v66.i);
  }
  else
  {
    v106.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "updateSchematic", value: &v106);
  idSWFScriptVar::Free(this: &v106);
  v67 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v67 != nullptr )
  {
    v67[2] = camera;
    v67[1] = 0;
    v68.i = (int)v67;
    *v67 = &`idPlayer::EnterPersonalGarage'::`22'::idSWFScriptFunction_PlayerGarage_GetNumTargets::`vftable';
  }
  else
  {
    v68.i = 0;
  }
  v108.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v108);
  if ( v68.i != 0 )
  {
    v108.value = v68;
    v108.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v68.i + 8))(a1: v68.i);
  }
  else
  {
    v108.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "numTargets", value: &v108);
  idSWFScriptVar::Free(this: &v108);
  v69 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0x14u,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v69 != nullptr )
  {
    v69[2] = this;
    v69[3] = camera;
    v70.i = (int)v69;
    v69[1] = 0;
    *((_BYTE *)v69 + 16) = 1;
    *v69 = &`idPlayer::EnterPersonalGarage'::`31'::idSWFScriptFunction_PlayerGarage_ActivateTuner::`vftable';
  }
  else
  {
    v70.i = 0;
  }
  v93.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v93);
  if ( v70.i != 0 )
  {
    v93.value = v70;
    v93.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v70.i + 8))(a1: v70.i);
  }
  else
  {
    v93.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "activateTuner", value: &v93);
  idSWFScriptVar::Free(this: &v93);
  v71 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v71 != nullptr )
  {
    v71[2] = camera;
    v71[1] = 0;
    v72.i = (int)v71;
    *v71 = &`idPlayer::EnterPersonalGarage'::`20'::idSWFScriptFunction_PlayerGarage_GetVehicleName::`vftable';
  }
  else
  {
    v72.i = 0;
  }
  v94.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v94);
  if ( v72.i != 0 )
  {
    v94.value = v72;
    v94.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v72.i + 8))(a1: v72.i);
  }
  else
  {
    v94.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "vehicleName", value: &v94);
  idSWFScriptVar::Free(this: &v94);
  v73 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v73 != nullptr )
  {
    v73[2] = camera;
    v73[1] = 0;
    v74.i = (int)v73;
    *v73 = &`idPlayer::EnterPersonalGarage'::`21'::idSWFScriptFunction_PlayerGarage_GetVehicleClass::`vftable';
  }
  else
  {
    v74.i = 0;
  }
  v96.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v96);
  if ( v74.i != 0 )
  {
    v96.value = v74;
    v96.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v74.i + 8))(a1: v74.i);
  }
  else
  {
    v96.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "vehicleClass", value: &v96);
  idSWFScriptVar::Free(this: &v96);
  v75 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v75 != nullptr )
  {
    v75[2] = camera;
    v75[1] = 0;
    v76.i = (int)v75;
    *v75 = &`idPlayer::EnterPersonalGarage'::`23'::idSWFScriptFunction_PlayerGarage_GetVehiclePrestige::`vftable';
  }
  else
  {
    v76.i = 0;
  }
  v98.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v98);
  if ( v76.i != 0 )
  {
    v98.value = v76;
    v98.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v76.i + 8))(a1: v76.i);
  }
  else
  {
    v98.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "vehiclePrestige", value: &v98);
  idSWFScriptVar::Free(this: &v98);
  v77 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v77 != nullptr )
  {
    v77[2] = camera;
    v77[1] = 0;
    v78.i = (int)v77;
    *v77 = &`idPlayer::EnterPersonalGarage'::`9'::idSWFScriptFunction_PlayerGarage_PreviousBay::`vftable';
  }
  else
  {
    v78.i = 0;
  }
  v100.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v100);
  if ( v78.i != 0 )
  {
    v100.value = v78;
    v100.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v78.i + 8))(a1: v78.i);
  }
  else
  {
    v100.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "previousBay", value: &v100);
  idSWFScriptVar::Free(this: &v100);
  v79 = idMem::AllocWithLocation(
          this: &mem,
          location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
          size: 0xCu,
          tag: TAG_SWF,
          zeroBuffer: false,
          align: ALIGN_16,
          heap: HEAP_DEFAULTHEAP);
  if ( v79 != nullptr )
  {
    v79[2] = camera;
    v79[1] = 0;
    v80.i = (int)v79;
    *v79 = &`idPlayer::EnterPersonalGarage'::`10'::idSWFScriptFunction_PlayerGarage_NextBay::`vftable';
  }
  else
  {
    v80.i = 0;
  }
  v102.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v102);
  if ( v80.i != 0 )
  {
    v102.value = v80;
    v102.type = SWF_VAR_FUNCTION;
    (*(void (__fastcall **)(int __struct_ptr))(*(_DWORD *)v80.i + 8))(a1: v80.i);
  }
  else
  {
    v102.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "nextBay", value: &v102);
  idSWFScriptVar::Free(this: &v102);
  this->inPersonalGarage = true;
  if ( camera != nullptr )
  {
    CurrentKey = idTownGarageCamera::GetCurrentKey(this: camera);
    v82 = CurrentKey;
    if ( CurrentKey != nullptr )
    {
      VehicleFromKey = idVehicleKey::GetVehicleFromKey(this: CurrentKey);
      v84 = VehicleFromKey;
      if ( VehicleFromKey != nullptr )
      {
        idVehicle::SetArmorFromKey(this: VehicleFromKey, key: v82);
        idVehicle::SetWeaponsFromKey(this: v84, key: v82);
        idVehicle::SetThemeFromKey(this: v84, key: v82);
        idVehicle::RecalcMaxArmoredHealth(this: v84);
      }
    }
  }
  v85 = this->presentable;
  if ( v85 != nullptr )
    v86 = (int)v85->GetPlayerInterface_2(this: v85);
  else
    v86 = 0;
  idPlayerHud::SetHudState(this: (idPlayerHud *)(v86 + 35096), state: HUDSTATE_NONE);
  idSWF::Activate(this: PlayerGui, b: true);
  idStaticList<idSWFScriptVar,16>::idStaticList<idSWFScriptVar,16>(this: &v136);
  if ( v136.listStatic == 0 || v136.listStatic == 2 )
  {
    list = v136.list;
    if ( v136.list != nullptr )
    {
      size = v136.size;
      v89 = v136.list;
      if ( v136.size > 0 )
      {
        do
        {
          idSWFScriptVar::Free(this: list);
          --size;
          ++list;
        }
        while ( size != 0 );
      }
      idMem::Free(this: &mem, ptr: v89, align: ALIGN_16);
    }
    v136.list = nullptr;
    v136.size = 0;
  }
  v136.num = 0;
  idSWF::Invoke(this: PlayerGui, functionName: "activateGarage", parms: (const idSWFParmList *)&v136);
  if ( camera != nullptr )
  {
    v90 = this->presentable;
    if ( v90 != nullptr )
      v91 = v90->GetPlayerInterface_2(this: v90);
    else
      v91 = nullptr;
    camera->tunerGui = idPresentablePlayer::GetPlayerGui(this: v91, g: GUI_TUNE_VEHICLE);
  }
  idStaticList<idSWFScriptVar,16>::~idStaticList<idSWFScriptVar,16>(this: &v136);
  return PlayerGui;
}


// ========================================================================
// __unwind$548084
// EA  : 0x82E79EA4
// RVA : 0x00E79EA4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548084()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 288));
}


// ========================================================================
// __unwind$548085
// EA  : 0x82E79ECC
// RVA : 0x00E79ECC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548085()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 352));
}


// ========================================================================
// __unwind$548086
// EA  : 0x82E79EF4
// RVA : 0x00E79EF4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548086()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 344));
}


// ========================================================================
// __unwind$548087
// EA  : 0x82E79F1C
// RVA : 0x00E79F1C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548087()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 328));
}


// ========================================================================
// __unwind$548088
// EA  : 0x82E79F44
// RVA : 0x00E79F44
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548088()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 360));
}


// ========================================================================
// __unwind$548089
// EA  : 0x82E79F6C
// RVA : 0x00E79F6C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548089()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 304));
}


// ========================================================================
// __unwind$548091
// EA  : 0x82E79F94
// RVA : 0x00E79F94
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548091()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 96));
}


// ========================================================================
// __unwind$548093
// EA  : 0x82E79FBC
// RVA : 0x00E79FBC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548093()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 216));
}


// ========================================================================
// __unwind$548094
// EA  : 0x82E79FE4
// RVA : 0x00E79FE4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548094()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 816 + 448));
}


// ========================================================================
// __unwind$548362
// EA  : 0x82E7A00C
// RVA : 0x00E7A00C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548362()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 816 + 512));
}


// ========================================================================
// __unwind$548095_0
// EA  : 0x82E7A034
// RVA : 0x00E7A034
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548095_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 320));
}


// ========================================================================
// __unwind$548389
// EA  : 0x82E7A05C
// RVA : 0x00E7A05C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548389()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 816 + 384));
}


// ========================================================================
// __unwind$548096
// EA  : 0x82E7A084
// RVA : 0x00E7A084
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548096()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 336));
}


// ========================================================================
// __unwind$548413
// EA  : 0x82E7A0AC
// RVA : 0x00E7A0AC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548413()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 816 + 416));
}


// ========================================================================
// __unwind$548097_0
// EA  : 0x82E7A0D4
// RVA : 0x00E7A0D4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548097_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 296));
}


// ========================================================================
// __unwind$548436_0
// EA  : 0x82E7A0FC
// RVA : 0x00E7A0FC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548436_0()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 816 + 480));
}


// ========================================================================
// __unwind$548098
// EA  : 0x82E7A124
// RVA : 0x00E7A124
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548098()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 368));
}


// ========================================================================
// __unwind$548100
// EA  : 0x82E7A14C
// RVA : 0x00E7A14C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548100()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 112));
}


// ========================================================================
// __unwind$548101
// EA  : 0x82E7A174
// RVA : 0x00E7A174
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548101()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 312));
}


// ========================================================================
// __unwind$548103
// EA  : 0x82E7A19C
// RVA : 0x00E7A19C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548103()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 232));
}


// ========================================================================
// __unwind$548105
// EA  : 0x82E7A1C4
// RVA : 0x00E7A1C4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548105()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 128));
}


// ========================================================================
// __unwind$548107
// EA  : 0x82E7A1EC
// RVA : 0x00E7A1EC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548107()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 248));
}


// ========================================================================
// __unwind$548109
// EA  : 0x82E7A214
// RVA : 0x00E7A214
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548109()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 144));
}


// ========================================================================
// __unwind$548111
// EA  : 0x82E7A23C
// RVA : 0x00E7A23C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548111()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 264));
}


// ========================================================================
// __unwind$548113
// EA  : 0x82E7A264
// RVA : 0x00E7A264
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548113()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 160));
}


// ========================================================================
// __unwind$548115
// EA  : 0x82E7A28C
// RVA : 0x00E7A28C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548115()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 280));
}


// ========================================================================
// __unwind$548117
// EA  : 0x82E7A2B4
// RVA : 0x00E7A2B4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548117()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 176));
}


// ========================================================================
// __unwind$548119_0
// EA  : 0x82E7A2DC
// RVA : 0x00E7A2DC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548119_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 256));
}


// ========================================================================
// __unwind$548121
// EA  : 0x82E7A304
// RVA : 0x00E7A304
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548121()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 192));
}


// ========================================================================
// __unwind$548123
// EA  : 0x82E7A32C
// RVA : 0x00E7A32C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548123()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 240));
}


// ========================================================================
// __unwind$548125
// EA  : 0x82E7A354
// RVA : 0x00E7A354
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548125()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 208));
}


// ========================================================================
// __unwind$548127
// EA  : 0x82E7A37C
// RVA : 0x00E7A37C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548127()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 272));
}


// ========================================================================
// __unwind$548128
// EA  : 0x82E7A3A4
// RVA : 0x00E7A3A4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548128()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 224));
}


// ========================================================================
// __unwind$548130
// EA  : 0x82E7A3CC
// RVA : 0x00E7A3CC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548130()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 168));
}


// ========================================================================
// __unwind$548132
// EA  : 0x82E7A3F4
// RVA : 0x00E7A3F4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548132()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 184));
}


// ========================================================================
// __unwind$548134
// EA  : 0x82E7A41C
// RVA : 0x00E7A41C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548134()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 200));
}


// ========================================================================
// __unwind$548136
// EA  : 0x82E7A444
// RVA : 0x00E7A444
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548136()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 80));
}


// ========================================================================
// __unwind$548138
// EA  : 0x82E7A46C
// RVA : 0x00E7A46C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548138()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 88));
}


// ========================================================================
// __unwind$548140
// EA  : 0x82E7A494
// RVA : 0x00E7A494
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548140()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 104));
}


// ========================================================================
// __unwind$548142
// EA  : 0x82E7A4BC
// RVA : 0x00E7A4BC
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548142()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 120));
}


// ========================================================================
// __unwind$548144
// EA  : 0x82E7A4E4
// RVA : 0x00E7A4E4
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548144()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 136));
}


// ========================================================================
// __unwind$548146
// EA  : 0x82E7A50C
// RVA : 0x00E7A50C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548146()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 816 + 152));
}


// ========================================================================
// __unwind$548147_0
// EA  : 0x82E7A534
// RVA : 0x00E7A534
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_548147_0()
{
  int v0; // r12

  idSWFParmList::~idSWFParmList(this: (idSWFParmList *)(v0 - 816 + 544));
}


// ========================================================================
// ?ShowVehicleTuner@idPlayer@@QAAXPAVidVehicleKey@@_NPBVaiPlayerInteraction_t@@PAVidAI2@@PAVidTownGarageCamera@@@Z
// EA  : 0x82E7A568
// RVA : 0x00E7A568
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::ShowVehicleTuner(
        idPlayer *this,
        idSWFScriptFunction_vtbl *key,
        bool fromGarage,
        idSWFScriptFunction_vtbl *interaction,
        idSWFScriptFunction_vtbl *offeringAI,
        idSWFScriptFunction_vtbl *camera)
{
  idSWFScriptObject *v12; // r17
  idSWFScriptObject *v13; // r16
  idPresentable *presentable; // r3
  idPresentablePlayer *v15; // r3
  idSWF *PlayerGui; // r26
  idSWFScriptFunction *v17; // r3
  idSWFScriptFunction *v18; // r4
  idSWFScriptFunction *v19; // r3
  idSWFScriptFunction *v20; // r4
  idSWFScriptFunction *v21; // r3
  idSWFScriptFunction *v22; // r4
  idSWFScriptFunction *v23; // r3
  idSWFScriptFunction *v24; // r4
  idSWFScriptFunction *v25; // r3
  idSWFScriptFunction *v26; // r4
  idSWFScriptFunction *v27; // r3
  idSWFScriptFunction *v28; // r4
  idSWFScriptFunction *v29; // r3
  idSWFScriptFunction *v30; // r4
  idSWFScriptFunction *v31; // r3
  idSWFScriptFunction *v32; // r4
  idSWFScriptFunction *v33; // r3
  idSWFScriptFunction *v34; // r4
  idSWFScriptFunction *v35; // r3
  idSWFScriptFunction *v36; // r4
  idSWFScriptFunction *v37; // r3
  idSWFScriptFunction *v38; // r4
  idSWFScriptFunction *v39; // r3
  idSWFScriptFunction *v40; // r4
  idSWFScriptFunction *v41; // r3
  idSWFScriptFunction *v42; // r4
  idSWFScriptFunction *v43; // r3
  idSWFScriptFunction *v44; // r4
  idSWFScriptFunction *v45; // r3
  idSWFScriptFunction *v46; // r4
  idSWFScriptFunction *v47; // r3
  idSWFScriptFunction *v48; // r4
  idSWFScriptVar v51; // [sp+50h] [-1C0h] BYREF
  idSWFScriptVar v52; // [sp+58h] [-1B8h] BYREF
  idSWFScriptVar v53; // [sp+60h] [-1B0h] BYREF
  idSWFScriptVar v54; // [sp+68h] [-1A8h] BYREF
  idSWFScriptVar v55; // [sp+70h] [-1A0h] BYREF
  idSWFScriptVar v56; // [sp+78h] [-198h] BYREF
  idSWFScriptVar v57; // [sp+80h] [-190h] BYREF
  idSWFScriptVar v58; // [sp+88h] [-188h] BYREF
  idSWFScriptVar v59; // [sp+90h] [-180h] BYREF
  idSWFScriptVar v60; // [sp+98h] [-178h] BYREF
  idSWFScriptVar v61; // [sp+A0h] [-170h] BYREF
  idSWFScriptVar v62; // [sp+A8h] [-168h] BYREF
  idSWFScriptVar v63; // [sp+B0h] [-160h] BYREF
  idSWFScriptVar v64; // [sp+B8h] [-158h] BYREF
  idSWFScriptVar v65; // [sp+C0h] [-150h] BYREF
  idSWFScriptVar v66; // [sp+C8h] [-148h] BYREF
  idSWFScriptVar v67; // [sp+D0h] [-140h] BYREF
  idSWFScriptVar v68; // [sp+D8h] [-138h] BYREF
  idSWFScriptVar v69[2]; // [sp+E0h] [-130h] BYREF
  idStaticList<idSWFScriptVar,16> v70[2]; // [sp+F0h] [-120h] BYREF

  v12 = idSWFScriptObject::Alloc();
  v13 = idSWFScriptObject::Alloc();
  idSWFScriptObject::MakeArray(this: v12);
  idSWFScriptObject::MakeArray(this: v13);
  presentable = this->presentable;
  if ( presentable != nullptr )
    v15 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v15 = nullptr;
  PlayerGui = idPresentablePlayer::GetPlayerGui(this: v15, g: GUI_TUNE_VEHICLE);
  v17 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x14u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v17 != nullptr )
  {
    v17[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    v17[3].__vftable = key;
    v18 = v17;
    v17[4].__vftable = (idSWFScriptFunction_vtbl *)v12;
    v17[1].__vftable = nullptr;
    v17->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`2'::idSWFScriptFunction_PlayerGarage_RefreshUpgrades::`vftable';
  }
  else
  {
    v18 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v61, nf: v18);
  idSWFScriptObject::Set(this: v12, name: "refresh", value: &v61);
  idSWFScriptVar::Free(this: &v61);
  v19 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x14u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v19 != nullptr )
  {
    v19[2].__vftable = key;
    v19[3].__vftable = (idSWFScriptFunction_vtbl *)v13;
    v20 = v19;
    v19[4].__vftable = (idSWFScriptFunction_vtbl *)this;
    v19[1].__vftable = nullptr;
    v19->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`3'::idSWFScriptFunction_PlayerGarage_RefreshTypes::`vftable';
  }
  else
  {
    v20 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v63, nf: v20);
  idSWFScriptObject::Set(this: v13, name: "refresh", value: &v63);
  idSWFScriptVar::Free(this: &v63);
  v52.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v52);
  if ( v12 != nullptr )
  {
    v52.value.i = (int)v12;
    v52.type = SWF_VAR_OBJECT;
    ++v12->refCount;
  }
  else
  {
    v52.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "upgrades", value: &v52);
  idSWFScriptVar::Free(this: &v52);
  v51.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v51);
  if ( v13 != nullptr )
  {
    v51.value.i = (int)v13;
    v51.type = SWF_VAR_OBJECT;
    ++v13->refCount;
  }
  else
  {
    v51.type = SWF_VAR_NULL;
  }
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "components", value: &v51);
  idSWFScriptVar::Free(this: &v51);
  v21 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x18u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v21 != nullptr )
  {
    v21[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    v21[3].__vftable = key;
    v22 = v21;
    v21[4].__vftable = (idSWFScriptFunction_vtbl *)v12;
    v21[1].__vftable = nullptr;
    v21->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`4'::idSWFScriptFunction_PlayerGarage_EquipUpgrade::`vftable';
    v21[5].__vftable = (idSWFScriptFunction_vtbl *)PlayerGui;
  }
  else
  {
    v22 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v57, nf: v22);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "equipUpgrade", value: &v57);
  idSWFScriptVar::Free(this: &v57);
  v23 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x14u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v23 != nullptr )
  {
    v23[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    v23[3].__vftable = key;
    v24 = v23;
    v23[4].__vftable = camera;
    v23[1].__vftable = nullptr;
    v23->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`5'::idSWFScriptFunction_PlayerGarage_ReturnToGarage::`vftable';
  }
  else
  {
    v24 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v67, nf: v24);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "returnToGarage", value: &v67);
  idSWFScriptVar::Free(this: &v67);
  v25 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x14u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v25 != nullptr )
  {
    v25[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    v25[3].__vftable = interaction;
    v26 = v25;
    v25[4].__vftable = offeringAI;
    v25[1].__vftable = nullptr;
    v25->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`6'::idSWFScriptFunction_PlayerGarage_ReturnToVendor::`vftable';
  }
  else
  {
    v26 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v59, nf: v26);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "returnToVendor", value: &v59);
  idSWFScriptVar::Free(this: &v59);
  v27 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x18u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v27 != nullptr )
  {
    v27[2].__vftable = key;
    v27[3].__vftable = (idSWFScriptFunction_vtbl *)this;
    v28 = v27;
    HIBYTE(v27[4].__vftable) = fromGarage;
    v27[1].__vftable = nullptr;
    v27->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`7'::idSWFScriptFunction_PlayerGarage_TriggerSchematicRender::`vftable';
    v27[5].__vftable = camera;
  }
  else
  {
    v28 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v65, nf: v28);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "showVehicle", value: &v65);
  idSWFScriptVar::Free(this: &v65);
  v29 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x10u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v29 != nullptr )
  {
    v29[2].__vftable = key;
    v29[3].__vftable = (idSWFScriptFunction_vtbl *)this;
    v30 = v29;
    v29[1].__vftable = nullptr;
    v29->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`8'::idSWFScriptFunction_PlayerGarage_SelectVehicleComponent::`vftable';
  }
  else
  {
    v30 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v54, nf: v30);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "selectVehicleComponent", value: &v54);
  idSWFScriptVar::Free(this: &v54);
  v53.type = SWF_VAR_UNDEF;
  idSWFScriptVar::Free(this: &v53);
  v53.value.b = fromGarage;
  v53.type = SWF_VAR_BOOL;
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "fromGarage", value: &v53);
  idSWFScriptVar::Free(this: &v53);
  v31 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x10u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v31 != nullptr )
  {
    v31[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    v31[3].__vftable = camera;
    v32 = v31;
    v31[1].__vftable = nullptr;
    v31->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`9'::idSWFScriptFunction_PlayerGarage_KillVehicle::`vftable';
  }
  else
  {
    v32 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: v69, nf: v32);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "killVehicle", value: v69);
  idSWFScriptVar::Free(this: v69);
  v33 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0xCu,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v33 != nullptr )
  {
    v33[2].__vftable = key;
    v33[1].__vftable = nullptr;
    v34 = v33;
    v33->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`12'::idSWFScriptFunction_PlayerGarage_VehicleName::`vftable';
  }
  else
  {
    v34 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v55, nf: v34);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "vehicleName", value: &v55);
  idSWFScriptVar::Free(this: &v55);
  v35 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0xCu,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v35 != nullptr )
  {
    v35[2].__vftable = key;
    v35[1].__vftable = nullptr;
    v36 = v35;
    v35->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`10'::idSWFScriptFunction_PlayerGarage_VehicleRating::`vftable';
  }
  else
  {
    v36 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v56, nf: v36);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "vehicleRating", value: &v56);
  idSWFScriptVar::Free(this: &v56);
  v37 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0xCu,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v37 != nullptr )
  {
    v37[2].__vftable = key;
    v37[1].__vftable = nullptr;
    v38 = v37;
    v37->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`11'::idSWFScriptFunction_PlayerGarage_NeedsRepairToInstall::`vftable';
  }
  else
  {
    v38 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v58, nf: v38);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "needsRepairToInstall", value: &v58);
  idSWFScriptVar::Free(this: &v58);
  v39 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x10u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v39 != nullptr )
  {
    v39[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    v39[3].__vftable = key;
    v40 = v39;
    v39[1].__vftable = nullptr;
    v39->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`14'::idSWFScriptFunction_PlayerGarage_RepairVehicle::`vftable';
  }
  else
  {
    v40 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v60, nf: v40);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "repair", value: &v60);
  idSWFScriptVar::Free(this: &v60);
  v41 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0x10u,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v41 != nullptr )
  {
    v41[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    v41[3].__vftable = key;
    v42 = v41;
    v41[1].__vftable = nullptr;
    v41->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`13'::idSWFScriptFunction_PlayerGarage_CanRepairVehicle::`vftable';
  }
  else
  {
    v42 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v62, nf: v42);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "canrepair", value: &v62);
  idSWFScriptVar::Free(this: &v62);
  v43 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0xCu,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v43 != nullptr )
  {
    v43[2].__vftable = (idSWFScriptFunction_vtbl *)this;
    v43[1].__vftable = nullptr;
    v44 = v43;
    v43->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`15'::idSWFScriptFunction_PlayerGarage_GetCash::`vftable';
  }
  else
  {
    v44 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v64, nf: v44);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "cash", value: &v64);
  idSWFScriptVar::Free(this: &v64);
  v45 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0xCu,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v45 != nullptr )
  {
    v45[2].__vftable = key;
    v45[1].__vftable = nullptr;
    v46 = v45;
    v45->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`16'::idSWFScriptFunction_PlayerGarage_GetVehicleDamage::`vftable';
  }
  else
  {
    v46 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v66, nf: v46);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "damage", value: &v66);
  idSWFScriptVar::Free(this: &v66);
  v47 = (idSWFScriptFunction *)idMem::AllocWithLocation(
                                 this: &mem,
                                 location: "w:\\tech5\\shared\\idlib\\Heap.h(64) : tag",
                                 size: 0xCu,
                                 tag: TAG_SWF,
                                 zeroBuffer: false,
                                 align: ALIGN_16,
                                 heap: HEAP_DEFAULTHEAP);
  if ( v47 != nullptr )
  {
    v47[2].__vftable = key;
    v47[1].__vftable = nullptr;
    v48 = v47;
    v47->__vftable = (idSWFScriptFunction_vtbl *)&`idPlayer::ShowVehicleTuner'::`17'::idSWFScriptFunction_PlayerGarage_GetVehicleRepairCost::`vftable';
  }
  else
  {
    v48 = nullptr;
  }
  idSWFScriptVar::idSWFScriptVar(this: &v68, nf: v48);
  idSWFScriptObject::Set(this: PlayerGui->globals, name: "repairCost", value: &v68);
  idSWFScriptVar::Free(this: &v68);
  if ( v12->refCount-- == 1 )
  {
    idSWFScriptObject::~idSWFScriptObject(this: v12);
    idMem::Free(this: &mem, ptr: v12, align: ALIGN_16);
  }
  if ( v13->refCount-- == 1 )
  {
    idSWFScriptObject::~idSWFScriptObject(this: v13);
    idMem::Free(this: &mem, ptr: v13, align: ALIGN_16);
  }
  idSWF::Activate(this: PlayerGui, b: true);
  idStaticList<idSWFScriptVar,16>::idStaticList<idSWFScriptVar,16>(this: v70);
  if ( v70[0].listStatic == 0 || v70[0].listStatic == 2 )
  {
    if ( v70[0].list != nullptr )
      idListArrayDelete<idSWFScriptVar>(ptr: v70[0].list, num: v70[0].size);
    v70[0].list = nullptr;
    v70[0].size = 0;
  }
  v70[0].num = 0;
  idSWF::Invoke(this: PlayerGui, functionName: "activateTuner", parms: (const idSWFParmList *)v70);
  idStaticList<idSWFScriptVar,16>::~idStaticList<idSWFScriptVar,16>(this: v70);
}


// ========================================================================
// __unwind$549828
// EA  : 0x82E7AE90
// RVA : 0x00E7AE90
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549828()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 160));
}


// ========================================================================
// __unwind$549830
// EA  : 0x82E7AEB8
// RVA : 0x00E7AEB8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549830()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 176));
}


// ========================================================================
// __unwind$549831
// EA  : 0x82E7AEE0
// RVA : 0x00E7AEE0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549831()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 88));
}


// ========================================================================
// __unwind$549832
// EA  : 0x82E7AF08
// RVA : 0x00E7AF08
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549832()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 80));
}


// ========================================================================
// __unwind$549834
// EA  : 0x82E7AF30
// RVA : 0x00E7AF30
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549834()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 128));
}


// ========================================================================
// __unwind$549836
// EA  : 0x82E7AF58
// RVA : 0x00E7AF58
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549836()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 208));
}


// ========================================================================
// __unwind$549838
// EA  : 0x82E7AF80
// RVA : 0x00E7AF80
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549838()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 144));
}


// ========================================================================
// __unwind$549840
// EA  : 0x82E7AFA8
// RVA : 0x00E7AFA8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549840()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 192));
}


// ========================================================================
// __unwind$549842
// EA  : 0x82E7AFD0
// RVA : 0x00E7AFD0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549842()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 104));
}


// ========================================================================
// __unwind$549843
// EA  : 0x82E7AFF8
// RVA : 0x00E7AFF8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549843()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 96));
}


// ========================================================================
// __unwind$549845
// EA  : 0x82E7B020
// RVA : 0x00E7B020
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549845()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 224));
}


// ========================================================================
// __unwind$549847
// EA  : 0x82E7B048
// RVA : 0x00E7B048
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549847()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 112));
}


// ========================================================================
// __unwind$549849
// EA  : 0x82E7B070
// RVA : 0x00E7B070
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549849()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 120));
}


// ========================================================================
// __unwind$549851
// EA  : 0x82E7B098
// RVA : 0x00E7B098
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549851()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 136));
}


// ========================================================================
// __unwind$549853
// EA  : 0x82E7B0C0
// RVA : 0x00E7B0C0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549853()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 152));
}


// ========================================================================
// __unwind$549855
// EA  : 0x82E7B0E8
// RVA : 0x00E7B0E8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549855()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 168));
}


// ========================================================================
// __unwind$549857
// EA  : 0x82E7B110
// RVA : 0x00E7B110
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549857()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 184));
}


// ========================================================================
// __unwind$549859
// EA  : 0x82E7B138
// RVA : 0x00E7B138
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549859()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 200));
}


// ========================================================================
// __unwind$549861
// EA  : 0x82E7B160
// RVA : 0x00E7B160
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549861()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 528 + 216));
}


// ========================================================================
// __unwind$549862
// EA  : 0x82E7B188
// RVA : 0x00E7B188
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_549862()
{
  int v0; // r12

  idSWFParmList::~idSWFParmList(this: (idSWFParmList *)(v0 - 528 + 240));
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`4'::idSWFScriptFunction_PlayerGarage_EquipUpgrade::Call
// EA  : 0x82E7B1B8
// RVA : 0x00E7B1B8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_4_::idSWFScriptFunction_PlayerGarage_EquipUpgrade::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        __int64 parms,
        __int64 a4)
{
  __int64 v6; // r10
  idStr *v7; // r4
  int v8; // r11
  idSWFScriptVar *v9; // r3
  idSWFScriptObject *size; // r28
  const char *v11; // r3
  idSWFSpriteInstance *v12; // r30
  idSWFSpriteInstance *v13; // r29
  idSWFSpriteInstance *v14; // r28
  const idDeclVehicleUpgrade *v15; // r4
  bool v16; // r4
  idVehicle *VehicleFromKey; // r3
  idSWFScriptObject v19; // [sp+58h] [-208h] BYREF
  idSWFScriptObject v20[2]; // [sp+C0h] [-1A0h] BYREF
  idStaticList<idSWFScriptVar,16> v21; // [sp+190h] [-D0h] BYREF

  LODWORD(v6) = &v19.prototype;
  v19.variablesHash[15] = 20;
  v19.variablesHash[14] = (int)&v19.prototype;
  v19.variablesHash[13] = 0;
  HIBYTE(v19.prototype) = 0;
  HIDWORD(v6) = *(_DWORD *)(parms + 4);
  if ( HIDWORD(v6) != 1 || (v7 = *(idStr **)parms, (v8 = **(_DWORD **)parms) == 4) || v8 == 3 )
  {
    result->type = SWF_VAR_UNDEF;
    idSWFScriptVar::Free(this: result);
    result->value.b = false;
    result->type = SWF_VAR_BOOL;
    goto LABEL_34;
  }
  v19.refCount = *(_DWORD *)parms;
  v9 = idSWFScriptVar::ToString(this: (idSWFScriptVar *)&v20[0].variablesHash[3], result: v7, a3: parms, a4, a5: v6);
  idStr::operator=(this: (idStr *)&v19.variablesHash[13], text: (const idStr *)v9);
  idStr::FreeData(this: (idStr *)&v20[0].variablesHash[3]);
  if ( thisObject->variables.size == 0 )
  {
    idSWFScriptVar::idSWFScriptVar(this: result, b: false);
    goto LABEL_34;
  }
  idSWF::GetGlobal(
    this: (idSWF *)&v19.variables.num,
    result: (idSWFScriptVar *)thisObject->variablesHash[0],
    name: "components");
  idSWF::GetGlobal(
    this: (idSWF *)&v19.variablesHash[3],
    result: (idSWFScriptVar *)thisObject->variablesHash[0],
    name: "scrollPartIndex");
  if ( v19.variables.num == 8 )
  {
    size = (idSWFScriptObject *)v19.variables.size;
    v11 = (const char *)idSWFScriptVar::ToInteger(this: (idSWFScriptVar *)&v19.variablesHash[3]);
    idSWFScriptObject::Get(this: (idSWFScriptObject *)&v19.variables.granularity, result: size, index: v11);
    if ( *(_DWORD *)&v19.variables.granularity == 8 )
    {
      idSWFScriptObject::Get(
        this: (idSWFScriptObject *)&v19.variablesHash[5],
        result: (idSWFScriptObject *)v19.variablesHash[0],
        name: "checkRepaired");
      if ( (unsigned __int8)idSWFScriptVar::ToBool(this: (idSWFScriptVar *)&v19.variablesHash[5]) != 0
        && idVehicleKey::GetDamagePercentInt(this: (idVehicleKey *)thisObject->variables.size) != 0 )
      {
        idSWF::GetGlobal(
          this: (idSWF *)&v19.variablesHash[1],
          result: (idSWFScriptVar *)thisObject->variablesHash[0],
          name: "shortcutKeys");
        if ( v19.variablesHash[1] == 8 )
        {
          idSWFScriptObject::Get(
            this: (idSWFScriptObject *)&v19.variablesHash[9],
            result: (idSWFScriptObject *)v19.variablesHash[2],
            name: "clear");
          if ( v19.variablesHash[9] == 7 )
          {
            idStaticList<idSWFScriptVar,16>::idStaticList<idSWFScriptVar,16>(this: &v21);
            idList<idSWFScriptVar,72>::~idList<idSWFScriptVar,72>(this: &v21);
            (*(void (__fastcall **)(__int16 *, int, int, idStaticList<idSWFScriptVar,16> *))(*(_DWORD *)v19.variablesHash[10]
                                                                                           + 4))(
              a1: &v20[0].variables.granularity,
              a2: v19.variablesHash[10],
              a3: v19.variablesHash[2],
              a4: &v21);
            idSWFScriptVar::Free(this: (idSWFScriptVar *)&v20[0].variables.granularity);
            idStaticList<idSWFScriptVar,16>::~idStaticList<idSWFScriptVar,16>(this: &v21);
          }
          idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variablesHash[9]);
        }
        idSWFScriptObject::Get(
          this: (idSWFScriptObject *)&v19.variablesHash[7],
          result: *(idSWFScriptObject **)(*(_DWORD *)(thisObject->variablesHash[0] + 64) + 40),
          name: "tunerMenu");
        if ( v19.variablesHash[7] == 8 )
        {
          idSWFScriptObject::Get(this: &v19, result: (idSWFScriptObject *)v19.variablesHash[8], name: "tuner");
          if ( v19.refCount == 8 )
          {
            idSWFScriptObject::Get(
              this: (idSWFScriptObject *)&v19.variablesHash[11],
              result: (idSWFScriptObject *)v19.variables.list,
              name: "joy1");
            idSWFScriptObject::Get(this: v20, result: (idSWFScriptObject *)v19.variables.list, name: "joy2");
            idSWFScriptObject::Get(
              this: (idSWFScriptObject *)&v20[0].variables.num,
              result: (idSWFScriptObject *)v19.variables.list,
              name: "repairInfo");
            v12 = idSWFScriptVar::ToSprite(this: (idSWFScriptVar *)&v19.variablesHash[11]);
            v13 = idSWFScriptVar::ToSprite(this: (idSWFScriptVar *)v20);
            v14 = idSWFScriptVar::ToSprite(this: (idSWFScriptVar *)&v20[0].variables.num);
            if ( v12 != nullptr )
              idSWFSpriteInstance::SetAlpha(this: v12, val: 0.0);
            if ( v13 != nullptr )
              idSWFSpriteInstance::SetAlpha(this: v13, val: 0.0);
            if ( v14 != nullptr )
            {
              idStaticList<idSWFScriptVar,16>::idStaticList<idSWFScriptVar,16>(this: (idStaticList<idSWFScriptVar,16> *)&v20[0].variablesHash[11]);
              idList<idSWFScriptVar,72>::~idList<idSWFScriptVar,72>(this: (idList<idSWFScriptVar,5> *)&v20[0].variablesHash[11]);
              idSWFParmList::Append(this: (idSWFParmList *)&v20[0].variablesHash[11], s: "rollOn");
              idSWFSpriteInstance::PlayFrame(this: v14, parms: (const idSWFParmList *)&v20[0].variablesHash[11]);
              idStaticList<idSWFScriptVar,16>::~idStaticList<idSWFScriptVar,16>(this: (idStaticList<idSWFScriptVar,16> *)&v20[0].variablesHash[11]);
            }
            idSWFScriptVar::Free(this: (idSWFScriptVar *)&v20[0].variables.num);
            idSWFScriptVar::Free(this: (idSWFScriptVar *)v20);
            idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variablesHash[11]);
          }
          idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19);
        }
        idSWFScriptVar::idSWFScriptVar(this: result, b: true);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variablesHash[7]);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variablesHash[1]);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variablesHash[5]);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variables.granularity);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variablesHash[3]);
        idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variables.num);
        goto LABEL_34;
      }
      idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variablesHash[5]);
    }
    idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variables.granularity);
  }
  if ( v19.variablesHash[14] != 0
    && (v15 = (const idDeclVehicleUpgrade *)idDeclInfo::FindWithInheritance(
                                              this: &idDeclVehicleUpgrade::resourceList,
                                              name: (const char *)v19.variablesHash[14],
                                              makeDefault: true)) != nullptr )
  {
    idVehicleKey::EquipUpgrade(this: (idVehicleKey *)thisObject->variables.size, upgrade: v15, init: false);
    v16 = idVehicleKey::GetDamagePercent(this: (idVehicleKey *)thisObject->variables.size) == 0.0;
    idVehicleKey::UpdateArmorInfo(this: (idVehicleKey *)thisObject->variables.size, initFromUpgrades: v16);
    VehicleFromKey = idVehicleKey::GetVehicleFromKey(this: (idVehicleKey *)thisObject->variables.size);
    if ( VehicleFromKey != nullptr )
      idVehicle::RecalcMaxArmoredHealth(this: VehicleFromKey);
    idSWFScriptVar::idSWFScriptVar(this: result, b: true);
    idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variablesHash[3]);
    idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variables.num);
  }
  else
  {
    idLib::Warning(fmt: "Trying to equip a NULL upgrade!");
    idSWFScriptVar::idSWFScriptVar(this: result, b: false);
    idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variablesHash[3]);
    idSWFScriptVar::Free(this: (idSWFScriptVar *)&v19.variables.num);
  }
LABEL_34:
  idStr::FreeData(this: (idStr *)&v19.variablesHash[13]);
  return result;
}


// ========================================================================
// __unwind$550525
// EA  : 0x82E7B610
// RVA : 0x00E7B610
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550525()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 608 + 160));
}


// ========================================================================
// __unwind$550526
// EA  : 0x82E7B638
// RVA : 0x00E7B638
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550526()
{
  int v0; // r12

  idStrStatic<260>::~idStrStatic<260>(this: (idStr *)(v0 - 608 + 224));
}


// ========================================================================
// __unwind$550530
// EA  : 0x82E7B660
// RVA : 0x00E7B660
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550530()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 96));
}


// ========================================================================
// __unwind$550531
// EA  : 0x82E7B688
// RVA : 0x00E7B688
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550531()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 120));
}


// ========================================================================
// __unwind$550532
// EA  : 0x82E7B6B0
// RVA : 0x00E7B6B0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550532()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 104));
}


// ========================================================================
// __unwind$550533
// EA  : 0x82E7B6D8
// RVA : 0x00E7B6D8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550533()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 128));
}


// ========================================================================
// __unwind$550534
// EA  : 0x82E7B700
// RVA : 0x00E7B700
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550534()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 112));
}


// ========================================================================
// __unwind$550535
// EA  : 0x82E7B728
// RVA : 0x00E7B728
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550535()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 144));
}


// ========================================================================
// __unwind$550536
// EA  : 0x82E7B750
// RVA : 0x00E7B750
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550536()
{
  int v0; // r12

  idSWFParmList::~idSWFParmList(this: (idSWFParmList *)(v0 - 608 + 400));
}


// ========================================================================
// __unwind$550538
// EA  : 0x82E7B778
// RVA : 0x00E7B778
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550538()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 136));
}


// ========================================================================
// __unwind$550539
// EA  : 0x82E7B7A0
// RVA : 0x00E7B7A0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550539()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 88));
}


// ========================================================================
// __unwind$550540
// EA  : 0x82E7B7C8
// RVA : 0x00E7B7C8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550540()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 152));
}


// ========================================================================
// __unwind$550541
// EA  : 0x82E7B7F0
// RVA : 0x00E7B7F0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550541()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 192));
}


// ========================================================================
// __unwind$550542_0
// EA  : 0x82E7B818
// RVA : 0x00E7B818
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550542_0()
{
  int v0; // r12

  idSWFScriptVar::~idSWFScriptVar(this: (idSWFScriptVar *)(v0 - 608 + 200));
}


// ========================================================================
// __unwind$550543
// EA  : 0x82E7B840
// RVA : 0x00E7B840
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550543()
{
  int v0; // r12

  idSWFParmList::~idSWFParmList(this: (idSWFParmList *)(v0 - 608 + 256));
}


// ========================================================================
// __unwind$550527
// EA  : 0x82E7B868
// RVA : 0x00E7B868
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550527()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 608;
  if ( (*(_DWORD *)(v0 - 608 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 628));
  }
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`5'::idSWFScriptFunction_PlayerGarage_ReturnToGarage::Call
// EA  : 0x82E7B8B8
// RVA : 0x00E7B8B8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_5_::idSWFScriptFunction_PlayerGarage_ReturnToGarage::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  int v5; // r3
  idPresentablePlayer *v6; // r3
  idSWF *PlayerGui; // r3
  int num; // r11
  int v9; // r3
  idPresentablePlayer *v10; // r3
  idSWF *v11; // r3
  idVehicleKey *size; // r3
  idVehicle *VehicleFromKey; // r3
  idVehicle *v14; // r30
  idStaticList<idSWFScriptVar,16> v16; // [sp+60h] [-C0h] BYREF

  v5 = *(_DWORD *)(thisObject->variables.num + 488);
  if ( v5 != 0 )
    v6 = (idPresentablePlayer *)(*(int (__fastcall **)(int))(*(_DWORD *)v5 + 104))(a1: v5);
  else
    v6 = nullptr;
  PlayerGui = idPresentablePlayer::GetPlayerGui(this: v6, g: GUI_PLAYERGARAGE);
  idSWF::Activate(this: PlayerGui, b: true);
  idStaticList<idSWFScriptVar,16>::idStaticList<idSWFScriptVar,16>(this: &v16);
  if ( v16.listStatic == 0 || v16.listStatic == 2 )
  {
    if ( v16.list != nullptr )
      idListArrayDelete<idSWFScriptVar>(ptr: v16.list, num: v16.size);
    v16.list = nullptr;
    v16.size = 0;
  }
  num = thisObject->variables.num;
  v16.num = 0;
  v9 = *(_DWORD *)(num + 488);
  if ( v9 != 0 )
    v10 = (idPresentablePlayer *)(*(int (__fastcall **)(int))(*(_DWORD *)v9 + 104))(a1: v9);
  else
    v10 = nullptr;
  v11 = idPresentablePlayer::GetPlayerGui(this: v10, g: GUI_PLAYERGARAGE);
  idSWF::Invoke(this: v11, functionName: "activateGarage", parms: (const idSWFParmList *)&v16);
  size = (idVehicleKey *)thisObject->variables.size;
  if ( size != nullptr )
  {
    VehicleFromKey = idVehicleKey::GetVehicleFromKey(this: size);
    v14 = VehicleFromKey;
    if ( VehicleFromKey != nullptr )
    {
      idVehicle::SetArmorFromKey(this: VehicleFromKey, key: (idVehicleKey *)thisObject->variables.size);
      idVehicle::SetWeaponsFromKey(this: v14, key: (idVehicleKey *)thisObject->variables.size);
      idVehicle::SetThemeFromKey(this: v14, key: (idVehicleKey *)thisObject->variables.size);
      idVehicle::RecalcMaxArmoredHealth(this: v14);
    }
  }
  result->type = SWF_VAR_UNDEF;
  idStaticList<idSWFScriptVar,16>::~idStaticList<idSWFScriptVar,16>(this: &v16);
  return result;
}


// ========================================================================
// __unwind$550883
// EA  : 0x82E7B9F8
// RVA : 0x00E7B9F8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550883()
{
  int v0; // r12

  idSWFParmList::~idSWFParmList(this: (idSWFParmList *)(v0 - 288 + 96));
}


// ========================================================================
// __unwind$550884
// EA  : 0x82E7BA20
// RVA : 0x00E7BA20
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550884()
{
  int v0; // r12
  int v1; // r31

  v1 = v0 - 288;
  if ( (*(_DWORD *)(v0 - 288 + 80) & 1) != 0 )
  {
    *(_DWORD *)(v1 + 80) &= ~1u;
    idSWFScriptVar::~idSWFScriptVar(this: *(idSWFScriptVar **)(v1 + 308));
  }
}


// ========================================================================
// ?UpdateTunerVehicle@idPlayer@@QAAXH@Z
// EA  : 0x82E7BA70
// RVA : 0x00E7BA70
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __fastcall idPlayer::UpdateTunerVehicle(idPlayer *this, idSWFScriptVar::swfScriptVarValue_t *index)
{
  idPresentable *presentable; // r3
  idPresentablePlayer *v5; // r3
  idPresentable *v6; // r3
  idPresentablePlayer *v7; // r3
  idSWF *PlayerGui; // r3
  idStaticList<idSWFScriptVar,16> v9; // [sp+50h] [-B0h] BYREF

  presentable = this->presentable;
  if ( presentable != nullptr )
    v5 = presentable->GetPlayerInterface_2(this: presentable);
  else
    v5 = nullptr;
  if ( idPresentablePlayer::GetPlayerGui(this: v5, g: GUI_TUNER_VEHICLE) != nullptr )
  {
    idStaticList<idSWFScriptVar,16>::idStaticList<idSWFScriptVar,16>(this: &v9);
    idSWFParmList::Append(this: (idSWFParmList *)&v9, i: index);
    v6 = this->presentable;
    if ( v6 != nullptr )
      v7 = v6->GetPlayerInterface_2(this: v6);
    else
      v7 = nullptr;
    PlayerGui = idPresentablePlayer::GetPlayerGui(this: v7, g: GUI_TUNER_VEHICLE);
    idSWF::Invoke(this: PlayerGui, functionName: "selectPart", parms: (const idSWFParmList *)&v9);
    idStaticList<idSWFScriptVar,16>::~idStaticList<idSWFScriptVar,16>(this: &v9);
  }
}


// ========================================================================
// __unwind$550964
// EA  : 0x82E7BB1C
// RVA : 0x00E7BB1C
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void _unwind_550964()
{
  int v0; // r12

  idSWFParmList::~idSWFParmList(this: (idSWFParmList *)(v0 - 256 + 80));
}


// ========================================================================
// `idPlayer::OfferWares'::`12'::idSWFScriptFunction_PlayerVendor_ToTuner::Call
// EA  : 0x82E7BB48
// RVA : 0x00E7BB48
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::OfferWares_::_12_::idSWFScriptFunction_PlayerVendor_ToTuner::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  int v6; // r31
  int v7; // r27
  int v8; // r28
  idInventoryCollection *v9; // r30
  idVehicleKey *InventoryItem; // r3
  idSWFScriptFunction_vtbl *v11; // r3

  v6 = 0;
  if ( *(_DWORD *)(a4 + 4) != 1 )
    goto LABEL_11;
  v7 = idSWFScriptVar::ToInteger(this: *(idSWFScriptVar **)a4);
  v8 = 0;
  v9 = (idInventoryCollection *)(*(int (__fastcall **)(int))(*(_DWORD *)thisObject->variables.num + 468))(a1: thisObject->variables.num);
  if ( (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v9) > 0 )
  {
    while ( 1 )
    {
      InventoryItem = (idVehicleKey *)idInventoryCollection::GetInventoryItem(this: v9, index: v6);
      if ( InventoryItem != nullptr )
      {
        v11 = (idSWFScriptFunction_vtbl *)idVehicleKey::CastTo(c: InventoryItem);
        if ( v11 == nullptr || v11[3].GetPrototype == nullptr )
          goto LABEL_8;
        if ( v7 - 1 == v8 )
          break;
        ++v8;
      }
LABEL_8:
      if ( ++v6 >= (int)idScriptObject::GetTypeDef(this: (bfx::Planner3D *)v9) )
      {
        result->type = SWF_VAR_UNDEF;
        return result;
      }
    }
    idPlayer::ShowVehicleTuner(
      this: (idPlayer *)thisObject->variables.num,
      key: v11,
      fromGarage: false,
      interaction: (idSWFScriptFunction_vtbl *)thisObject->variables.size,
      offeringAI: *(idSWFScriptFunction_vtbl **)&thisObject->variables.granularity,
      camera: nullptr);
    *(_DWORD *)(thisObject->variables.num + 12216) = v7;
  }
LABEL_11:
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`30'::idSWFScriptFunction_PlayerGarage_UpdateSchematic::Call
// EA  : 0x82E7BC40
// RVA : 0x00E7BC40
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_30_::idSWFScriptFunction_PlayerGarage_UpdateSchematic::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  idSWFScriptVar::swfScriptVarValue_t *v6; // r3

  if ( *(_DWORD *)(a4 + 4) == 1 )
  {
    v6 = (idSWFScriptVar::swfScriptVarValue_t *)idSWFScriptVar::ToInteger(this: *(idSWFScriptVar **)a4);
    idPlayer::UpdateTunerVehicle(this: (idPlayer *)thisObject->variables.num, index: v6);
  }
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::EnterPersonalGarage'::`31'::idSWFScriptFunction_PlayerGarage_ActivateTuner::Call
// EA  : 0x82E7BCA0
// RVA : 0x00E7BCA0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::EnterPersonalGarage_::_31_::idSWFScriptFunction_PlayerGarage_ActivateTuner::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms)
{
  idTownGarageCamera *size; // r29
  char granularity_high; // r28
  idSWFScriptFunction_vtbl *CurrentKey; // r3

  size = (idTownGarageCamera *)thisObject->variables.size;
  granularity_high = HIBYTE(thisObject->variables.granularity);
  CurrentKey = (idSWFScriptFunction_vtbl *)idTownGarageCamera::GetCurrentKey(this: size);
  idPlayer::ShowVehicleTuner(
    this: (idPlayer *)thisObject->variables.num,
    key: CurrentKey,
    fromGarage: granularity_high,
    interaction: nullptr,
    offeringAI: nullptr,
    camera: (idSWFScriptFunction_vtbl *)size);
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `idPlayer::ShowVehicleTuner'::`8'::idSWFScriptFunction_PlayerGarage_SelectVehicleComponent::Call
// EA  : 0x82E7BCF8
// RVA : 0x00E7BCF8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

idSWFScriptVar *__fastcall _idPlayer::ShowVehicleTuner_::_8_::idSWFScriptFunction_PlayerGarage_SelectVehicleComponent::Call(
        idSWFScriptVar *result,
        idSWFScriptObject *thisObject,
        const idSWFParmList *parms,
        int a4)
{
  idSWFScriptVar::swfScriptVarValue_t *v6; // r3

  if ( *(_DWORD *)(a4 + 4) == 1 )
  {
    v6 = (idSWFScriptVar::swfScriptVarValue_t *)idSWFScriptVar::ToInteger(this: *(idSWFScriptVar **)a4);
    idPlayer::UpdateTunerVehicle(this: (idPlayer *)thisObject->variables.size, index: v6);
  }
  result->type = SWF_VAR_UNDEF;
  return result;
}


// ========================================================================
// `dynamic initializer for 'g_ragdollLootingImpulse''
// EA  : 0x8338FA88
// RVA : 0x0138FA88
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__g_ragdollLootingImpulse__()
{
  idCVar::idCVar(
    this: &g_ragdollLootingImpulse,
    name: "g_ragdollLootImpulse",
    value: "2000",
    flags: 4,
    description: "impulse to apply to AI ragdolls when looting",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__g_ragdollLootingImpulse__);
}


// ========================================================================
// `dynamic initializer for 'g_viewNoteType''
// EA  : 0x8338FAE0
// RVA : 0x0138FAE0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__g_viewNoteType__()
{
  idCVar::idCVar(
    this: &g_viewNoteType,
    name: "g_viewNoteType",
    value: "0",
    flags: 2,
    description: "default viewnote type setting",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__g_viewNoteType__);
}


// ========================================================================
// `dynamic initializer for 'g_viewNoteRepeat''
// EA  : 0x8338FB38
// RVA : 0x0138FB38
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__g_viewNoteRepeat__()
{
  idCVar::idCVar(
    this: &g_viewNoteRepeat,
    name: "g_viewNoteRepeat",
    value: "0",
    flags: 2,
    description: "default viewnote repeatability setting",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__g_viewNoteRepeat__);
}


// ========================================================================
// `dynamic initializer for 'g_viewNoteDevTrack''
// EA  : 0x8338FB90
// RVA : 0x0138FB90
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__g_viewNoteDevTrack__()
{
  idCVar::idCVar(
    this: &g_viewNoteDevTrack,
    name: "g_viewNoteDevTrack",
    value: "0",
    flags: 2,
    description: "default viewnote devtrack setting",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__g_viewNoteDevTrack__);
}


// ========================================================================
// `dynamic initializer for 'g_viewNotePriority''
// EA  : 0x8338FBE8
// RVA : 0x0138FBE8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__g_viewNotePriority__()
{
  idCVar::idCVar(
    this: &g_viewNotePriority,
    name: "g_viewNotePriority",
    value: "2",
    flags: 2,
    description: "default viewnote priority setting",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__g_viewNotePriority__);
}


// ========================================================================
// `dynamic initializer for 'g_viewNoteComponent''
// EA  : 0x8338FC40
// RVA : 0x0138FC40
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__g_viewNoteComponent__()
{
  idCVar::idCVar(
    this: &g_viewNoteComponent,
    name: "g_viewNoteComponent",
    value: "0",
    flags: 2,
    description: "default component/devGroup setting",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__g_viewNoteComponent__);
}


// ========================================================================
// `dynamic initializer for 'g_debugInvGUI''
// EA  : 0x8338FC98
// RVA : 0x0138FC98
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__g_debugInvGUI__()
{
  idCVar::idCVar(
    this: &g_debugInvGUI,
    name: "g_debugInvGUI",
    value: "0",
    flags: 1,
    description: "print out everything displayed in the inventory gui",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__g_debugInvGUI__);
}


// ========================================================================
// `dynamic initializer for 'vehicle_enableAllUpgrades''
// EA  : 0x8338FCF0
// RVA : 0x0138FCF0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__vehicle_enableAllUpgrades__()
{
  idCVar::idCVar(
    this: &vehicle_enableAllUpgrades,
    name: "vehicle_enableAllUpgrades",
    value: "0",
    flags: 0,
    description: "all upgrades available in garage",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__vehicle_enableAllUpgrades__);
}


// ========================================================================
// `dynamic initializer for 'swf_invFadeTime''
// EA  : 0x8338FD48
// RVA : 0x0138FD48
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__swf_invFadeTime__()
{
  idCVar::idCVar(
    this: &swf_invFadeTime,
    name: "swf_invFadeTime",
    value: "400.0f",
    flags: 4,
    description: "test gui model location",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__swf_invFadeTime__);
}


// ========================================================================
// `dynamic initializer for 'swf_invFadeWait''
// EA  : 0x8338FDA0
// RVA : 0x0138FDA0
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__swf_invFadeWait__()
{
  idCVar::idCVar(
    this: &swf_invFadeWait,
    name: "swf_invFadeWait",
    value: "375",
    flags: 2,
    description: "test gui model location",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__swf_invFadeWait__);
}


// ========================================================================
// `dynamic initializer for 'swf_optionScrollSpeed''
// EA  : 0x8338FDF8
// RVA : 0x0138FDF8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__swf_optionScrollSpeed__()
{
  idCVar::idCVar(
    this: &swf_optionScrollSpeed,
    name: "swf_optionScrollSpeed",
    value: "55",
    flags: 2,
    description: "used to adjust scroll speed of options",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__swf_optionScrollSpeed__);
}


// ========================================================================
// `dynamic initializer for 'swf_inventoryShowUndefined''
// EA  : 0x8338FE50
// RVA : 0x0138FE50
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__swf_inventoryShowUndefined__()
{
  idCVar::idCVar(
    this: &swf_inventoryShowUndefined,
    name: "swf_inventoryShowUndefined",
    value: "0",
    flags: 1,
    description: "shows all undefined items in inventory when set",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__swf_inventoryShowUndefined__);
}


// ========================================================================
// `dynamic initializer for 'job_interuptVO''
// EA  : 0x8338FEA8
// RVA : 0x0138FEA8
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__job_interuptVO__()
{
  idCVar::idCVar(
    this: &job_interuptVO,
    name: "job_interuptVO",
    value: "1",
    flags: 1,
    description: "we can interupt the job VO early",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__job_interuptVO__);
}


// ========================================================================
// `dynamic initializer for 'job_interuptVOTime''
// EA  : 0x8338FF00
// RVA : 0x0138FF00
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__job_interuptVOTime__()
{
  idCVar::idCVar(
    this: &job_interuptVOTime,
    name: "job_interuptVOTime",
    value: "1500",
    flags: 2,
    description: "how many ms do we let the ai talk before we can interupt",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__job_interuptVOTime__);
}


// ========================================================================
// `dynamic initializer for 'tungsten_lootPoke''
// EA  : 0x8338FF58
// RVA : 0x0138FF58
// PDB : w:\tech5\tungsten\game\player\player_guis.cpp
// ========================================================================

void __noreturn _dynamic_initializer_for__tungsten_lootPoke__()
{
  idCVar::idCVar(
    this: &tungsten_lootPoke,
    name: "tungsten_lootPoke",
    value: "0",
    flags: 1,
    description: "Should we poke dead people when we loot them.",
    valueCompletion: nullptr);
  atexit(func: (void (__fastcall *)())_dynamic_atexit_destructor_for__tungsten_lootPoke__);
}

