Files
isaac-port/generated-src/menu_special_seeds.cpp
T
shweetandClaude Opus 5.5 780767f5e1 Curation round 2, wave A: anm2 (Anm2Ed JSON), text, config as idiomatic classes; SDL3 platform opens a window
- anm2.h/.cpp take over ANM2, AnimationState, LayerState, AnmCache and the frame data. They read Anm2Ed's JSON documents
  with simdjson and play them as the game does (interpolation baked at load). src/anm2/ and msvc.h are retired.
- font, formatted_text, string_table and rich_text take over the text classes. FormattedText::parse is still bit-exact
  against its assembly.
- options_config and challenge_params take over OptionsConfig, ChallengeParams and the .ini helpers. The tests include
  Save's exact bytes.
- platform.h/.cpp and main.cpp run IsaacMain on SDL3: the window and GL context open, and the run stops at the first
  built-in shader (FUN_00a13fa0).
- source_tree.py: a taken-over parent stays bytes, taken-over methods are not re-emitted as a namespace, and every
  address in a (a, b, c to d) list on a comment counts as taken over.
- log.h: reconstruction_missing() for a taken-over class's methods that are not written yet.
206 functions taken over, boot path 89/615. The full build waits for wave B: item_config, entity_config and mod_manager
still use the old APIs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 23:04:54 -05:00

1722 lines
75 KiB
C++

#include "classes.h"
// 008f01b0
void Menu_SpecialSeeds::Update()
{
Menu_SpecialSeeds *seedEffectSet = this;
float *pfVar1;
uint32_t seedEffect;
char isActionTriggered;
uint8_t isSeedActive;
int iVar2;
int *entryIt;
void *pvVar3;
void **seedEffectSet;
float fVar4;
float fVar5;
uint8_t local_30 [8];
void *seedEffectNode;
uint32_t local_24;
uint32_t local_20 [2];
uint32_t local_18 [2];
Seeds *local_10;
uint32_t actionId;
char isComboHeld;
uint32_t entries;
Manager *manager;
MenuManager *menuManager;
Seeds *scaledIndex;
if (((g_manager->_framecount & 1) == 0) && ((seedEffectSet->SpecialSeedsSprite)._loaded != 0)) {
AnimationState::Update(&(seedEffectSet->SpecialSeedsSprite)._animState);
AnimationState::Update(&(seedEffectSet->SpecialSeedsSprite)._overlayAnimState);
}
actionId = 0x18;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&actionId,0,0);
if (isActionTriggered == '\0') {
LAB_008f0261:
isComboHeld = '\0';
}
else {
actionId = 0x19;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&actionId,0,0);
if (isActionTriggered == '\0') goto LAB_008f0261;
actionId = 0x1c;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&actionId,0,0);
isComboHeld = '\x01';
if (isActionTriggered == '\0') goto LAB_008f0261;
}
actionId = 0xe;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&actionId,0,0);
menuManager = g_menuManager;
manager = g_manager;
if (isActionTriggered == '\0') {
if (isComboHeld == '\0') {
local_18[0] = 0x16;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_18,0,0);
if (isActionTriggered == '\0') {
local_10 = GHIDRA_CAST<Seeds *>(&DAT_00000017);
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_10,0,0);
if (isActionTriggered == '\0') {
local_20[0] = 0xf;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,local_20,0,0);
if (isActionTriggered != '\0') {
FUN_0098aec0();
}
}
else {
fVar4 = seedEffectSet->PositionY;
if ((fVar4 == 0.0) || ((0x1d < GHIDRA_INT(fVar4) && (GHIDRA_INT(fVar4) % 5 == 0)))) {
seedEffectSet->PositionX = (float)(GHIDRA_INT(seedEffectSet->PositionX) + 1);
entries = seedEffectSet[1].SpecialSeedsSprite._filename._capacity;
fVar4 = seedEffectSet->PositionX;
if (GHIDRA_INT(fVar4) <
GHIDRA_INT((*GHIDRA_CAST<int *>(seedEffectSet[1].SpecialSeedsSprite._animDefaultName._buf) - entries)) / 0x28) {
do {
if (*GHIDRA_CAST<int *>((entries + GHIDRA_INT(fVar4) * 0x28)) != 0) goto LAB_008f0594;
fVar4 = (float)(GHIDRA_INT(fVar4) + 1);
seedEffectSet->PositionX = fVar4;
} while (GHIDRA_INT(fVar4) <
GHIDRA_INT((*GHIDRA_CAST<int *>(seedEffectSet[1].SpecialSeedsSprite._animDefaultName._buf) - entries)) /
0x28);
}
seedEffectSet->PositionX = 0.0;
}
}
}
else {
fVar4 = seedEffectSet->PositionY;
if ((fVar4 == 0.0) || ((0x1d < GHIDRA_INT(fVar4) && (GHIDRA_INT(fVar4) % 5 == 0)))) {
pfVar1 = &seedEffectSet->PositionX;
*pfVar1 = (float)(GHIDRA_INT(*pfVar1) + -1);
fVar4 = seedEffectSet->PositionX;
fVar5 = *pfVar1;
while (-1 < GHIDRA_INT(fVar5)) {
if (*GHIDRA_CAST<int *>((seedEffectSet[1].SpecialSeedsSprite._filename._capacity + GHIDRA_INT(fVar4) * 0x28)) != 0)
goto LAB_008f0594;
fVar4 = (float)(GHIDRA_INT(fVar4) + -1);
seedEffectSet->PositionX = fVar4;
fVar5 = fVar4;
}
seedEffectSet->PositionX =
(float)(GHIDRA_INT((*GHIDRA_CAST<int *>(seedEffectSet[1].SpecialSeedsSprite._animDefaultName._buf) -
seedEffectSet[1].SpecialSeedsSprite._filename._capacity)) / 0x28 + -1);
}
}
}
else {
fVar4 = seedEffectSet->PositionX;
entries = seedEffectSet[1].SpecialSeedsSprite._filename._capacity;
if (*GHIDRA_CAST<int *>((entries + GHIDRA_INT(fVar4) * 0x28)) == 3) {
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_manager->_persistentGameData))) + 0x1))) == '\0') {
*(uint8_t *)
(GHIDRA_INT((g_manager->_persistentGameData)._cutsceneCounters) +
*GHIDRA_CAST<int *>((entries + 0xc + GHIDRA_INT(fVar4) * 0x28)) + 0x74) = 0;
*GHIDRA_CAST<uint8_t *>(&manager->_persistentGameData) = 1;
}
local_18[0] = *GHIDRA_CAST<uint32_t *>((entries + 0xc + GHIDRA_INT(fVar4) * 0x28));
std_set_int_erase_key(&(g_menuManager->_seedsObject)._seedEffects,GHIDRA_CAST<int *>(local_18));
fVar4 = seedEffectSet->PositionX;
Reset(seedEffectSet);
iVar2 = GHIDRA_INT((*GHIDRA_CAST<int *>(seedEffectSet[1].SpecialSeedsSprite._animDefaultName._buf) -
seedEffectSet[1].SpecialSeedsSprite._filename._capacity)) / 0x28;
if (GHIDRA_INT(fVar4) < iVar2) {
entryIt = GHIDRA_CAST<int *>((seedEffectSet[1].SpecialSeedsSprite._filename._capacity + GHIDRA_INT(fVar4) * 0x28));
do {
if (*entryIt != 0) break;
fVar4 = (float)(GHIDRA_INT(fVar4) + 1);
entryIt = entryIt + 10;
} while (GHIDRA_INT(fVar4) < iVar2);
}
if (iVar2 + -1 < GHIDRA_INT(fVar4)) {
fVar4 = (float)(iVar2 + -1);
}
seedEffectSet->PositionX = fVar4;
}
}
}
else {
local_18[0] = seedEffectSet[1].SpecialSeedsSprite._filename._capacity;
local_10 = GHIDRA_CAST<Seeds *>((GHIDRA_INT(seedEffectSet->PositionX) * 5));
iVar2 = *GHIDRA_CAST<int *>((local_18[0] + GHIDRA_INT(seedEffectSet->PositionX) * 0x28));
if (iVar2 == 1) {
seedEffectSet = &(g_menuManager->_seedsObject)._seedEffects;
pvVar3 = *seedEffectSet;
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
(seedEffectSet,
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)seedEffectSet,
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(pvVar3) + 4));
*(void **)(GHIDRA_CAST<char *>(pvVar3) + 4) = pvVar3;
*(void **)pvVar3 = pvVar3;
*(void **)(GHIDRA_CAST<char *>(pvVar3) + 8) = pvVar3;
(menuManager->_seedsObject)._seedEffectsCount = 0;
iVar2 = *GHIDRA_CAST<int *>((local_18[0] + GHIDRA_INT(local_10) * 8));
}
scaledIndex = local_10;
entries = local_18[0];
menuManager = g_menuManager;
if (iVar2 == 2) {
pvVar3 = (g_menuManager->_menuStateHistory)._end;
if (1 < GHIDRA_UINT((GHIDRA_INT(pvVar3) - GHIDRA_INT((g_menuManager->_menuStateHistory)._begin) >> 2))) {
pvVar3 = (void *)(GHIDRA_INT(pvVar3) + -4);
(g_menuManager->_menuStateHistory)._end = pvVar3;
}
(GHIDRA_CAST<MenuManager *>((menuManager)))->MenuManager::SetState(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + -4)),0);
}
if (*GHIDRA_CAST<int *>((entries + GHIDRA_INT(scaledIndex) * 8)) == 3) {
local_10 = &g_menuManager->_seedsObject;
isSeedActive = (GHIDRA_CAST<Seeds *>((local_10)))->Seeds::HasSeedEffect(*GHIDRA_CAST<uint32_t *>((entries + 0xc + GHIDRA_INT(scaledIndex) * 8)));
seedEffect = *GHIDRA_CAST<uint32_t *>((entries + 0xc + GHIDRA_INT(scaledIndex) * 8));
if (isSeedActive == 0) {
(GHIDRA_CAST<Seeds *>((local_10)))->Seeds::RemoveBlockingSeedEffects(seedEffect);
Seeds::AddSeedEffect
(&g_menuManager->_seedsObject,*GHIDRA_CAST<int *>((entries + 0xc + GHIDRA_INT(scaledIndex) * 8)));
}
else {
local_18[0] = seedEffect;
std_set_int_erase_key(&(g_menuManager->_seedsObject)._seedEffects,GHIDRA_CAST<int *>(local_18));
}
}
}
LAB_008f0594:
menuManager = g_menuManager;
local_24 = 9;
msvc::set<int>::find_node(local_30,&local_24);
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(seedEffectNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(seedEffectNode) + 0x10)) < 10)
) && (seedEffectNode != (menuManager->_seedsObject)._seedEffects)) {
seedEffectSet->HoldInputTimer = seedEffectSet->HoldInputTimer + 1;
if (0x1e < seedEffectSet->HoldInputTimer) {
seedEffectSet->HoldInputTimer = 0x1e;
}
}
else {
seedEffectSet->HoldInputTimer = 0;
}
local_24 = 0x17;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_24,0,0);
if (isActionTriggered == '\0') {
local_20[0] = 0x16;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_20,0,0);
if (isActionTriggered == '\0') {
seedEffectSet->PositionY = 0.0;
goto LAB_008f0642;
}
}
seedEffectSet->PositionY = (float)(GHIDRA_INT(seedEffectSet->PositionY) + 1);
LAB_008f0642:
menuManager = g_menuManager;
entries = seedEffectSet[1].SpecialSeedsSprite._filename._capacity;
fVar4 = DAT_00c35e24 + *GHIDRA_CAST<float *>((entries + 8 + GHIDRA_INT(seedEffectSet->PositionX) * 0x28)) + DAT_00c35e4c;
fVar5 = DAT_00c35e20 + *GHIDRA_CAST<float *>((entries + 4 + GHIDRA_INT(seedEffectSet->PositionX) * 0x28)) + _DAT_00c35e48;
seedEffectSet->SelectedElement = GHIDRA_INT(fVar4);
seedEffectSet->State = GHIDRA_INT(fVar5);
menuManager->_viewPositionSet[6].x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xf6fc))));
menuManager->_viewPositionSet[6].y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xf700))));
menuManager->_state = 1;
if (135.0 < fVar4) {
menuManager->_viewPositionSet[6].y = menuManager->_viewPositionSet[6].y - (fVar4 - 135.0);
}
return;
}
// 008f06e0
void Menu_SpecialSeeds::Render()
{
Menu_SpecialSeeds *sprite = this;
int *this_00;
code *pcVar1;
KColor color;
char *pcVar2;
uint8_t isEffectAddable;
uint32_t *nullFrame;
float *nullFrameOffset;
int *setFindResult;
uint8_t *text;
Font *needle;
int iVar3;
int seedListBytes;
std_string *psVar4;
AnimationState *otherAnimState;
void *strBuf;
std_string *strChar;
uint32_t uVar5;
ANM2 *sprite;
float fVar6;
float fVar7;
float paperBottomY;
char acStackY_640 [128];
std_string *in_stack_fffffa4c;
Seeds *in_stack_fffffa50;
float textBuf2;
uint8_t *textSize;
std_string **textCapacity;
void *noAchievementCheckNode;
int noAchievementEffectNode;
uint8_t local_578 [8];
void *dyslexiaEffectNode;
void *checkedEffectNode;
void *activeEffectNode;
uint8_t glyphRun [20];
uint64_t checkmarkRngShifts;
char local_530 [4];
char acStack_52c [4];
char acStack_528 [20];
ANM2 *spriteCopy;
float colorAlpha;
Vector cursorPos;
Vector noAchievementPos;
Vector checkmarkPos;
float local_4f4;
std_string formattedName;
uint32_t checkmarkSeed;
float baseY;
float baseX;
uint32_t local_4bc;
uint32_t local_4b8;
float local_4b4;
std_string *local_4b0;
float local_4ac;
float local_4a8;
char isChecked;
Vector local_4a0;
Font *local_494;
Seeds *local_490;
std_string numSeedsText;
std_string displayName;
uint32_t local_45c;
Font local_458 [14];
uint8_t local_27 [3];
uint32_t stackCookie;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
int *comboBan;
MenuManager *menuManager;
puStack_20 = local_27 + 0x23;
local_14 = -1;
puStack_18 = &LAB_00b07527;
local_1c = ExceptionList;
stackCookie = __security_cookie ^ GHIDRA_UINT((local_27 + 0x17));
ExceptionList = &local_1c;
sprite = &sprite->SpecialSeedsSprite;
baseX = (g_menuManager->_ViewPosition).x + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sprite)) + 0x14))));
baseY = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sprite)) + 0x18))));
local_4a0.y = baseY;
local_4a0.x = baseX;
spriteCopy = sprite;
nullFrame = ANM2::GetNullFrame(sprite,GHIDRA_CAST<uint8_t *>("PaperTop"),GHIDRA_CAST<uint8_t *>("NextSection"),0);
local_494 = GHIDRA_CAST<Font *>(*nullFrame);
fVar7 = (float)nullFrame[1];
textBuf2 = 1.3135225e-38;
strBuf = ANM2::GetNullFrame(sprite,GHIDRA_CAST<uint8_t *>("PaperBottom"),GHIDRA_CAST<uint8_t *>("ListEnd"),0);
local_490 = *GHIDRA_CAST<Seeds **>((GHIDRA_CAST<char *>(strBuf) + 4));
isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("PaperTop"),1);
if (((isEffectAddable != 0) && ((sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0))
&& (AnimationState::SetFrameFloat(&(sprite->SpecialSeedsSprite)._animState,0.0),
(sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) {
(sprite->SpecialSeedsSprite)._animState._isPlaying = 0;
}
if ((sprite->SpecialSeedsSprite)._loaded != 0) {
if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._animState,&local_4a0,&g_vectorZero,&g_vectorZero);
textBuf2 = 1.3135514e-38;
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._overlayAnimState,&local_4a0,&g_vectorZero,
&g_vectorZero);
baseY = local_4a0.y;
baseX = local_4a0.x;
}
else {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._overlayAnimState,&local_4a0,&g_vectorZero,
&g_vectorZero);
textBuf2 = 1.313541e-38;
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._animState,&local_4a0,&g_vectorZero,&g_vectorZero);
baseY = local_4a0.y;
baseX = local_4a0.x;
}
}
paperBottomY = DAT_00c35e4c +
*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(sprite[1].SpecialSeedsSprite._animDefaultName._buf) + -0x20));
local_4b4 = (fVar7 + (float)local_490) - DAT_00c35e24;
local_4a0.y = baseY + fVar7;
local_4a0.x = baseX + (float)local_494;
local_4bc = 0xb00b135;
acStack_528[0] = '\x05';
acStack_528[1] = '\0';
acStack_528[2] = '\0';
acStack_528[3] = '\0';
acStack_528[4] = '\t';
acStack_528[5] = '\0';
acStack_528[6] = '\0';
acStack_528[7] = '\0';
checkmarkSeed = 0x512578;
checkmarkRngShifts = 0x900000005;
fVar7 = local_4b4;
local_4a8 = paperBottomY;
strBuf = ANM2::GetAnimationData(sprite,GHIDRA_CAST<uint8_t *>("PaperMiddle"));
local_490 = *GHIDRA_CAST<Seeds **>((GHIDRA_CAST<char *>(strBuf) + 0x30));
if (fVar7 < paperBottomY) {
do {
if (local_4bc == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
pcVar1 = (code *)swi(3);
(*pcVar1)();
return;
}
local_4bc = local_4bc >> (acStack_528[0] & 0x1f) ^ local_4bc;
local_4bc = local_4bc << (acStack_528[4] & 0x1f) ^ local_4bc;
local_4bc = local_4bc >> 7 ^ local_4bc;
if (local_490 == GHIDRA_CAST<Seeds *>(0x0)) {
local_4b8 = 0;
}
else {
local_4b8 = local_4bc % GHIDRA_UINT(local_490);
}
textBuf2 = 1.3136013e-38;
nullFrameOffset =
ANM2::GetNullFrame(sprite,GHIDRA_CAST<uint8_t *>("PaperMiddle"),GHIDRA_CAST<uint8_t *>("NextSection"),local_4b8);
local_4ac = *nullFrameOffset;
local_494 = GHIDRA_CAST<Font *>(nullFrameOffset[1]);
if (local_4a8 < (float)local_494 + local_4b4) {
local_4b8 = 4;
textBuf2 = 1.3136112e-38;
nullFrameOffset = ANM2::GetNullFrame(sprite,GHIDRA_CAST<uint8_t *>("PaperMiddle"),GHIDRA_CAST<uint8_t *>("NextSection"),4);
local_4ac = *nullFrameOffset;
local_494 = GHIDRA_CAST<Font *>(nullFrameOffset[1]);
}
isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("PaperMiddle"),1);
if (((isEffectAddable != 0) &&
((sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat
(&(sprite->SpecialSeedsSprite)._animState,(float)GHIDRA_INT(local_4b8)),
(sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) {
(sprite->SpecialSeedsSprite)._animState._isPlaying = 0;
}
if ((sprite->SpecialSeedsSprite)._loaded != 0) {
if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._animState,&local_4a0,&g_vectorZero,&g_vectorZero);
otherAnimState = &(sprite->SpecialSeedsSprite)._overlayAnimState;
}
else {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._overlayAnimState,&local_4a0,&g_vectorZero,
&g_vectorZero);
otherAnimState = &(sprite->SpecialSeedsSprite)._animState;
}
textBuf2 = 1.3136348e-38;
AnimationState::Render(otherAnimState,&local_4a0,&g_vectorZero,&g_vectorZero);
}
local_4b4 = (float)local_494 + local_4b4;
local_4a0.y = local_4a0.y + (float)local_494;
local_4a0.x = local_4a0.x + local_4ac;
} while (local_4b4 < local_4a8);
}
isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("PaperBottom"),1);
if (((isEffectAddable != 0) && ((sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0))
&& (AnimationState::SetFrameFloat(&(sprite->SpecialSeedsSprite)._animState,0.0),
(sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) {
(sprite->SpecialSeedsSprite)._animState._isPlaying = 0;
}
if ((sprite->SpecialSeedsSprite)._loaded != 0) {
if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._animState,&local_4a0,&g_vectorZero,&g_vectorZero);
otherAnimState = &(sprite->SpecialSeedsSprite)._overlayAnimState;
}
else {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._overlayAnimState,&local_4a0,&g_vectorZero,
&g_vectorZero);
otherAnimState = &(sprite->SpecialSeedsSprite)._animState;
}
textBuf2 = 1.3136662e-38;
AnimationState::Render(otherAnimState,&local_4a0,&g_vectorZero,&g_vectorZero);
}
seedListBytes =
*GHIDRA_CAST<int *>(sprite[1].SpecialSeedsSprite._animDefaultName._buf) -
sprite[1].SpecialSeedsSprite._filename._capacity;
local_4a8 = 0.0;
iVar3 = seedListBytes >> 0x1f;
if (seedListBytes / 0x28 + iVar3 != iVar3) {
do {
uVar5 = sprite[1].SpecialSeedsSprite._filename._capacity;
isChecked = '\0';
fVar7 = *GHIDRA_CAST<float *>((uVar5 + 4 + GHIDRA_INT(local_4a8) * 0x28));
this_00 = GHIDRA_CAST<int *>((uVar5 + GHIDRA_INT(local_4a8) * 0x28));
iVar3 = *this_00;
paperBottomY = (float)this_00[2];
if (((iVar3 == 3) || (iVar3 == 2)) || (iVar3 == 1)) {
local_4ac = -NAN;
if (iVar3 == 3) {
local_494 = GHIDRA_CAST<Font *>(this_00[3]);
local_490 = &g_menuManager->_seedsObject;
msvc::set<int>::find_node();
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(activeEffectNode) + 0xd)) == '\0') &&
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(activeEffectNode) + 0x10)) <= GHIDRA_INT(local_494))) {
strBuf = activeEffectNode;
}
else {
strBuf = local_490->_seedEffects;
}
if (strBuf == local_490->_seedEffects) {
isEffectAddable = (GHIDRA_CAST<Seeds *>((local_490)))->Seeds::CanAddSeedEffect(GHIDRA_UINT(local_494));
if (isEffectAddable == 0) {
local_4ac = -NAN;
}
}
else {
fVar6 = sprite->PositionX;
local_490 = GHIDRA_CAST<Seeds *>((GHIDRA_INT(fVar6) * 5));
uVar5 = sprite[1].SpecialSeedsSprite._filename._capacity;
seedListBytes = *GHIDRA_CAST<int *>((uVar5 + GHIDRA_INT(fVar6) * 0x28));
if (seedListBytes == 3) {
local_490 = *GHIDRA_CAST<Seeds **>((uVar5 + 0xc + GHIDRA_INT(fVar6) * 0x28));
if (((GHIDRA_CAST<Font *>(&DAT_00000050) <= local_494) || (GHIDRA_CAST<Seeds *>(&DAT_00000050) <= local_490)) ||
(comboBan = GHIDRA_CAST<int *>((GHIDRA_INT(g_seedComboBans) + GHIDRA_INT(local_494) * 8)),
setFindResult = GHIDRA_CAST<int *>(std)::set<int>::find(), *setFindResult != *comboBan))
goto LAB_008f0d0d;
}
else if (seedListBytes == 1) {
LAB_008f0d0d:
local_4ac = -NAN;
goto LAB_008f0d3c;
}
LAB_008f0d31:
local_4ac = -2.4216445e+38;
}
}
else if ((iVar3 == 2) || (iVar3 == 1)) goto LAB_008f0d31;
LAB_008f0d3c:
if (checkmarkSeed == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
pcVar1 = (code *)swi(3);
(*pcVar1)();
return;
}
checkmarkSeed = checkmarkSeed >> ((uint8_t)checkmarkRngShifts & 0x1f) ^ checkmarkSeed;
checkmarkSeed =
checkmarkSeed << ((uint8_t)((uint64_t)checkmarkRngShifts >> 0x20) & 0x1f) ^ checkmarkSeed
;
checkmarkSeed = checkmarkSeed >> 7 ^ checkmarkSeed;
local_490 = GHIDRA_CAST<Seeds *>((checkmarkSeed % 3));
isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("Checkmark"),1);
if (((isEffectAddable != 0) && ((sprite->_animState)._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat(&sprite->_animState,(float)GHIDRA_INT(local_490)),
(sprite->_animState)._animData != (void *)0x0)) {
(sprite->_animState)._isPlaying = 0;
}
if (iVar3 == 3) {
local_490 = GHIDRA_CAST<Seeds *>(&(g_menuManager->_seedsObject)._seedEffects);
local_494 = GHIDRA_CAST<Font *>(this_00[3]);
msvc::set<int>::find_node();
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(checkedEffectNode) + 0xd)) == '\0') &&
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(checkedEffectNode) + 0x10)) <= this_00[3])) {
strBuf = checkedEffectNode;
}
else {
strBuf = *(void **)local_490;
}
if (strBuf != *(void **)local_490) {
isChecked = '\x01';
checkmarkPos.x = baseX + fVar7 + DAT_00c35e20 + _DAT_00c35e28;
checkmarkPos.y = baseY + paperBottomY + DAT_00c35e24 + _DAT_00c35e2c;
if ((sprite->SpecialSeedsSprite)._loaded != 0) {
if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._animState,&checkmarkPos,&g_vectorZero,
&g_vectorZero);
otherAnimState = &(sprite->SpecialSeedsSprite)._overlayAnimState;
}
else {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._overlayAnimState,&checkmarkPos,&g_vectorZero
,&g_vectorZero);
otherAnimState = &(sprite->SpecialSeedsSprite)._animState;
}
textBuf2 = 1.3137847e-38;
AnimationState::Render(otherAnimState,&checkmarkPos,&g_vectorZero,&g_vectorZero);
}
}
}
(GHIDRA_CAST<SpecialSeed *>((this_00)))->SpecialSeed::get_display_name(&displayName);
local_14 = 0;
text = GHIDRA_CAST<uint8_t *>(FUN_008f2b70());
numSeedsText._size = 0;
numSeedsText._capacity = 0xf;
numSeedsText._buf[0] = '\0';
numSeedsText._buf[1] = '\0';
numSeedsText._buf[2] = '\0';
numSeedsText._buf[3] = '\0';
if (text != local_27) {
(GHIDRA_CAST<msvc::string *>((numSeedsText._buf)))->msvc::string::assign(text,GHIDRA_INT(local_27) - GHIDRA_INT(text));
}
local_458[0]._lineHeight = 0xf;
local_458[0]._base = 0;
local_458[0]._spacingVert = 10;
local_458[0]._outline = 0;
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x12))) = 0;
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x0))) = 0x646565736d756e7b;
local_458[0]._stretchH = 0x7d73;
local_458[0]._aa = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
uVar5 = displayName._size;
local_494 = GHIDRA_CAST<Font *>(&displayName);
if (0xf < displayName._capacity) {
local_494 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Font *>(displayName._buf))) + 0x0)));
}
formattedName._buf[0] = '\0';
formattedName._buf[1] = '\0';
formattedName._buf[2] = '\0';
formattedName._buf[3] = '\0';
formattedName._size = 0;
formattedName._capacity = 0;
local_490 = GHIDRA_CAST<Seeds *>(displayName._size);
if (displayName._size < 0x10) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(formattedName._buf)) + 0x0))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<std_string *>(local_494))->_buf);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(formattedName._buf)) + 0x4))) = *GHIDRA_CAST<uint32_t *>(((GHIDRA_CAST<std_string *>(local_494))->_buf + 4));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(formattedName._buf)) + 0x8))) = *GHIDRA_CAST<uint32_t *>(((GHIDRA_CAST<std_string *>(local_494))->_buf + 8));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(formattedName._buf)) + 0xc))) = *GHIDRA_CAST<uint32_t *>(((GHIDRA_CAST<std_string *>(local_494))->_buf + 0xc));
formattedName._capacity = GHIDRA_UINT(&DAT_0000000f);
}
else {
local_4b0 = GHIDRA_CAST<std_string *>((displayName._size | 0xf));
if (GHIDRA_CAST<std_string *>(0x7fffffff) < local_4b0) {
local_4b0 = GHIDRA_CAST<std_string *>(0x7fffffff);
}
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(formattedName._buf)) + 0x0))) = msvc::_Allocate(GHIDRA_UINT((local_4b0->_buf + 1)));
textBuf2 = 1.3138286e-38;
memcpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)formattedName._buf)) + 0x0))),local_494,uVar5 + 1);
formattedName._capacity = GHIDRA_UINT(local_4b0);
}
acStack_528[4] = formattedName._buf[0xc];
acStack_528[5] = formattedName._buf[0xd];
acStack_528[6] = formattedName._buf[0xe];
acStack_528[7] = formattedName._buf[0xf];
acStack_528[0] = formattedName._buf[8];
acStack_528[1] = formattedName._buf[9];
acStack_528[2] = formattedName._buf[10];
acStack_528[3] = formattedName._buf[0xb];
formattedName._size = uVar5;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
local_494 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Font *>(local_458[0]))) + 0x0)));
local_490 = GHIDRA_CAST<Seeds *>(formattedName._size);
if (uVar5 != 0) {
uVar5 = 0;
local_530 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((char [4])formattedName._buf)) + 0x0)));
acStack_52c = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((char [4])formattedName._buf)) + 0x4)));
while( true ) {
needle = local_458;
if (0xf < (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_458[0]))) + 0x14)))) {
needle = local_494;
}
psVar4 = &formattedName;
if (0xf < formattedName._capacity) {
psVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(formattedName._buf))) + 0x0)));
}
textBuf2 = 1.3138455e-38;
uVar5 = msvc::string::find(GHIDRA_CAST<uint8_t *>(psVar4),formattedName._size,uVar5,GHIDRA_CAST<uint8_t *>(needle),10);
if (uVar5 == 0xffffffff) break;
psVar4 = &numSeedsText;
if (0xf < numSeedsText._capacity) {
psVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(numSeedsText._buf))) + 0x0)));
}
in_stack_fffffa50 = GHIDRA_CAST<Seeds *>(0x8f10e2);
(GHIDRA_CAST<msvc::string *>((formattedName._buf)))->msvc::string::replace(uVar5,10,GHIDRA_CAST<uint8_t *>(psVar4),numSeedsText._size);
uVar5 = uVar5 + numSeedsText._size;
}
sprite = spriteCopy;
}
local_530 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((char [4])formattedName._buf)) + 0x0)));
acStack_528[4] = formattedName._buf[0xc];
acStack_528[5] = formattedName._buf[0xd];
acStack_528[6] = formattedName._buf[0xe];
acStack_528[7] = formattedName._buf[0xf];
acStack_528[0] = formattedName._buf[8];
acStack_528[1] = formattedName._buf[9];
acStack_528[2] = formattedName._buf[10];
acStack_528[3] = formattedName._buf[0xb];
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(formattedName._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(formattedName._buf)) + 0x0))) & 0xffffff00;
local_4a0.y = (float)formattedName._capacity;
local_4a0.x = (float)formattedName._size;
formattedName._capacity = 0xf;
formattedName._size = 0;
acStack_52c = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((char [4])formattedName._buf)) + 0x4)));
(GHIDRA_CAST<msvc::string *>((displayName._buf)))->msvc::string::_Tidy_deallocate();
displayName._buf[0] = local_530[0];
displayName._buf[1] = local_530[1];
displayName._buf[2] = local_530[2];
displayName._buf[3] = local_530[3];
displayName._buf[4] = acStack_52c[0];
displayName._buf[5] = acStack_52c[1];
displayName._buf[6] = acStack_52c[2];
displayName._buf[7] = acStack_52c[3];
displayName._buf[8] = acStack_528[0];
displayName._buf[9] = acStack_528[1];
displayName._buf[10] = acStack_528[2];
displayName._buf[0xb] = acStack_528[3];
displayName._buf[0xc] = acStack_528[4];
displayName._buf[0xd] = acStack_528[5];
displayName._buf[0xe] = acStack_528[6];
displayName._buf[0xf] = acStack_528[7];
local_458[0]._lineHeight = 0xf;
local_458[0]._base = 0;
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
displayName._size = GHIDRA_UINT(local_4a0.x);
displayName._capacity = GHIDRA_UINT(local_4a0.y);
local_458[0]._spacingVert = 0;
local_458[0]._outline = 0;
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x12))) = 0;
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x0))) & 0xffffffffffffff00;
if (0xf < numSeedsText._capacity) {
uVar5 = numSeedsText._capacity + 1;
strBuf = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)numSeedsText._buf)) + 0x0)));
if (0xfff < uVar5) {
strBuf = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(numSeedsText._buf)) + 0x0))) + -4);
uVar5 = numSeedsText._capacity + 0x24;
if (0x1f < ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(numSeedsText._buf)) + 0x0))) - GHIDRA_INT(strBuf)) - 4U) goto LAB_008f19db;
}
operator_delete(strBuf,uVar5);
}
menuManager = g_menuManager;
textCapacity = &local_4b0;
textSize = local_578;
numSeedsText._size = 0;
numSeedsText._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(numSeedsText._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(numSeedsText._buf)) + 0x0))) & 0xffffff00;
local_4b0 = GHIDRA_CAST<std_string *>(&DAT_00000009);
seedListBytes = 0x8f1223;
msvc::set<int>::find_node();
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(dyslexiaEffectNode) + 0xd)) != '\0') ||
(strBuf = dyslexiaEffectNode, 9 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(dyslexiaEffectNode) + 0x10)))) {
strBuf = (menuManager->_seedsObject)._seedEffects;
}
if (((strBuf != (menuManager->_seedsObject)._seedEffects) &&
(sprite->HoldInputTimer - 1U < 0x1d)) && (*GHIDRA_CAST<int *>(&g_manager->_stringTable) == 0)) {
(GHIDRA_CAST<msvc::string *>((acStackY_640 + 0x8c)))->msvc::string::string(&displayName);
local_4b0 = string_scramble_seeded
(local_458,in_stack_fffffa4c,GHIDRA_INT(in_stack_fffffa50),GHIDRA_INT(textBuf2),
seedListBytes,GHIDRA_UINT(textSize),GHIDRA_UINT(textCapacity));
if (&displayName != local_4b0) {
if (0xf < displayName._capacity) {
uVar5 = displayName._capacity + 1;
strBuf = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)displayName._buf)) + 0x0)));
if (0xfff < uVar5) {
strBuf = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(displayName._buf)) + 0x0))) + -4);
uVar5 = displayName._capacity + 0x24;
if (0x1f < ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(displayName._buf)) + 0x0))) - GHIDRA_INT(strBuf)) - 4U) goto LAB_008f19db;
}
operator_delete(strBuf,uVar5);
}
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(displayName._buf)) + 0x0))) = *GHIDRA_CAST<uint32_t *>(local_4b0->_buf);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(displayName._buf)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((local_4b0->_buf + 4));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(displayName._buf)) + 0x8))) = *GHIDRA_CAST<uint32_t *>((local_4b0->_buf + 8));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(displayName._buf)) + 0xc))) = *GHIDRA_CAST<uint32_t *>((local_4b0->_buf + 0xc));
displayName._size = local_4b0->_size;
displayName._capacity = local_4b0->_capacity;
local_4b0->_size = 0;
local_4b0->_capacity = 0xf;
local_4b0->_buf[0] = 0;
}
if (0xf < (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_458[0]))) + 0x14)))) {
uVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x14))) + 1;
strBuf = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_458[0])) + 0x0)));
if (0xfff < uVar5) {
strBuf = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x0))) + -4);
uVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x14))) + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x0))) + (-4 - GHIDRA_INT(strBuf))))) goto LAB_008f19db;
}
operator_delete(strBuf,uVar5);
}
local_458[0]._spacingVert = 0;
local_458[0]._outline = 0;
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x12))) = 0;
local_458[0]._lineHeight = 0xf;
local_458[0]._base = 0;
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x0))) & 0xffffffffffffff00;
}
psVar4 = &displayName;
if ((displayName._capacity < 0x10) ||
(psVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(displayName._buf))) + 0x0))), (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(displayName._buf)) + 0x0))) != 0)) {
local_4b0 = GHIDRA_CAST<std_string *>((psVar4->_buf + 1));
strChar = psVar4;
do {
pcVar2 = strChar->_buf;
strChar = GHIDRA_CAST<std_string *>((strChar->_buf + 1));
} while (*pcVar2 != 0);
seedListBytes = GHIDRA_INT(strChar) - GHIDRA_INT(local_4b0);
}
else {
seedListBytes = 0;
}
text_convert_encoding(GHIDRA_CAST<uint8_t *>(psVar4),seedListBytes,0,&local_458[0]._scaleW,0x200,1);
local_494 = &g_manager->_font2_TeamMeatEx12;
if (((iVar3 != 1) && (iVar3 != 2)) &&
((*GHIDRA_CAST<int *>(&g_manager->_stringTable) != 2 && (*GHIDRA_CAST<int *>(&g_manager->_stringTable) != 0xb)))) {
local_494 = &g_manager->_font1_TeamMeatEx10;
}
fVar6 = baseX + DAT_00c35e20;
local_45c = 0;
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x0))) = 0xffff;
local_4f4 = baseY + DAT_00c35e24 + paperBottomY;
local_458[0]._stretchH = 0;
local_458[0]._aa = 0x80;
local_458[0]._paddingUp = 0x3f;
local_458[0]._paddingRight = 0xff;
local_458[0]._paddingDown = 0xff;
local_458[0]._paddingLeft = 0xff;
local_458[0]._spacingHoriz = 0xff;
local_458[0]._spacingVert = 0;
local_458[0]._outline = 0;
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x12))) = 0;
local_458[0]._lineHeight = 0;
local_458[0]._base = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
acStack_528[8] = '\0';
acStack_528[9] = '\0';
acStack_528[10] = '\0';
acStack_528[0xb] = '\0';
local_4b0 = GHIDRA_CAST<std_string *>((((float)(GHIDRA_UINT(local_4ac) >> 0x10 & 0xff) + 0.0) / 255.0));
uVar5 = GHIDRA_UINT(local_4ac) >> 0x18;
local_490 = GHIDRA_CAST<Seeds *>((((float)(GHIDRA_UINT(local_4ac) >> 8 & 0xff) + 0.0) / 255.0));
local_4ac = ((float)(GHIDRA_UINT(local_4ac) & 0xff) + 0.0) / 255.0;
colorAlpha = ((float)uVar5 + 0.0) / 255.0;
strBuf = Font::layout_glyphs(local_494,glyphRun,GHIDRA_CAST<uint8_t *>(&local_458[0]._scaleW),&local_45c,
&g_vectorOne);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
color._green = (float)local_490;
color._red = (float)local_4b0;
color._blue = local_4ac;
color._alpha = colorAlpha;
color._unk = 0;
in_stack_fffffa4c = local_4b0;
in_stack_fffffa50 = local_490;
textBuf2 = local_4ac;
Font::draw_glyph_run(local_494,fVar6 + fVar7,local_4f4,strBuf,1.0,1.0,color,&local_45c);
msvc::vector<12byte>::clear();
msvc::vector<12byte>::_Tidy();
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
local_458[0]._spacingVert = 0;
local_458[0]._outline = 0;
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(local_458[0])) + 0x12))) = 0;
local_458[0]._lineHeight = 0;
local_458[0]._base = 0;
seedListBytes = Font::get_string_width_utf16(local_494,&local_458[0]._scaleW,-1);
local_4f4 = (float)((double)seedListBytes + __uint_to_double_fixup[-(seedListBytes >> 0x1f)]
);
if (iVar3 == 2) {
isEffectAddable = (GHIDRA_CAST<Seeds *>((&g_menuManager->_seedsObject)))->Seeds::AchievementUnlocksDisallowed();
if (isEffectAddable == 0) goto LAB_008f1841;
local_490 = GHIDRA_CAST<Seeds *>(0x0);
LAB_008f174b:
isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("NoAchievement"),1);
if (((isEffectAddable != 0) && ((sprite->_animState)._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat(&sprite->_animState,(float)GHIDRA_INT(local_490)),
(sprite->_animState)._animData != (void *)0x0)) {
(sprite->_animState)._isPlaying = 0;
}
noAchievementPos.x = DAT_00c35e38 + baseX + fVar7 + DAT_00c35e20 + local_4f4;
noAchievementPos.y = DAT_00c35e3c + baseY + paperBottomY + DAT_00c35e24 + 0.0;
if ((sprite->SpecialSeedsSprite)._loaded != 0) {
if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._animState,&noAchievementPos,&g_vectorZero,
&g_vectorZero);
otherAnimState = &(sprite->SpecialSeedsSprite)._overlayAnimState;
}
else {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._overlayAnimState,&noAchievementPos,
&g_vectorZero,&g_vectorZero);
otherAnimState = &(sprite->SpecialSeedsSprite)._animState;
}
textBuf2 = 1.3141177e-38;
AnimationState::Render(otherAnimState,&noAchievementPos,&g_vectorZero,&g_vectorZero);
}
}
else if (iVar3 == 3) {
msvc::set<int>::find_node();
if (*GHIDRA_CAST<char *>((noAchievementEffectNode + 0xd)) == '\0') {
sprite = &sprite->SpecialSeedsSprite;
iVar3 = noAchievementEffectNode;
if (this_00[3] < *GHIDRA_CAST<int *>((noAchievementEffectNode + 0x10))) goto LAB_008f16d6;
}
else {
LAB_008f16d6:
iVar3 = DAT_00c798d0;
}
if (iVar3 != DAT_00c798d0) {
local_490 = GHIDRA_CAST<Seeds *>(&(g_menuManager->_seedsObject)._seedEffects);
msvc::set<int>::find_node();
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(noAchievementCheckNode) + 0xd)) == '\0') &&
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(noAchievementCheckNode) + 0x10)) <= this_00[3])) {
strBuf = noAchievementCheckNode;
}
else {
strBuf = *(void **)local_490;
}
local_490 = GHIDRA_CAST<Seeds *>(GHIDRA_UINT((strBuf == *(void **)local_490)));
goto LAB_008f174b;
}
}
LAB_008f1841:
local_14 = -1;
if (0xf < displayName._capacity) {
uVar5 = displayName._capacity + 1;
strBuf = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)displayName._buf)) + 0x0)));
if (0xfff < uVar5) {
strBuf = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(displayName._buf)) + 0x0))) + -4);
uVar5 = displayName._capacity + 0x24;
if (0x1f < ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(displayName._buf)) + 0x0))) - GHIDRA_INT(strBuf)) - 4U) {
LAB_008f19db:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(strBuf,uVar5);
}
}
if (local_4a8 == sprite->PositionX) {
isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("Cursor"),1);
if (((isEffectAddable != 0) && ((sprite->_animState)._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat(&sprite->_animState,0.0),
(sprite->_animState)._animData != (void *)0x0)) {
(sprite->_animState)._isPlaying = 0;
}
cursorPos.x = 0.0;
if (isChecked == '\0') {
cursorPos.x = 16.0;
}
cursorPos.x = baseX + fVar7 + DAT_00c35e20 + _DAT_00c35e30 + cursorPos.x;
cursorPos.y = baseY + paperBottomY + DAT_00c35e24 + _DAT_00c35e34 + 0.0;
if ((sprite->SpecialSeedsSprite)._loaded != 0) {
if ((sprite->SpecialSeedsSprite)._overlayRenderFirst == 0) {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._animState,&cursorPos,&g_vectorZero,&g_vectorZero
);
otherAnimState = &(sprite->SpecialSeedsSprite)._overlayAnimState;
}
else {
AnimationState::Render
(&(sprite->SpecialSeedsSprite)._overlayAnimState,&cursorPos,&g_vectorZero,
&g_vectorZero);
otherAnimState = &(sprite->SpecialSeedsSprite)._animState;
}
textBuf2 = 1.3141633e-38;
AnimationState::Render(otherAnimState,&cursorPos,&g_vectorZero,&g_vectorZero);
}
}
local_4a8 = (float)(GHIDRA_INT(local_4a8) + 1);
} while (GHIDRA_UINT(local_4a8) <
GHIDRA_UINT((GHIDRA_INT((*GHIDRA_CAST<int *>(sprite[1].SpecialSeedsSprite._animDefaultName._buf) -
sprite[1].SpecialSeedsSprite._filename._capacity)) / 0x28)));
}
ExceptionList = local_1c;
return;
}
// 008f19f0
void Menu_SpecialSeeds::Reset()
{
uint32_t uVar1;
uint32_t uVar2;
uint32_t uVar3;
uint8_t bVar4;
uint32_t uVar5;
int *file;
int iVar6;
uint8_t *text;
void *pvVar7;
uint8_t *attrNameChar;
int ******implementedChars;
char *pcVar8;
uint8_t *pbVar9;
Menu_SpecialSeeds *targetString;
uint8_t *pbVar10;
int entriesBytes;
uint64_t *allocatedBytes;
uint32_t entryIter;
uint32_t *puVar11;
float *entryPos;
uint32_t *puVar12;
uint32_t uVar13;
bool bVar14;
bool isLess;
float layoutX;
float layoutY;
uint8_t *pbVar15;
uint32_t *eraseDst;
uint32_t *eraseSrc;
uint8_t xmlDoc [48];
uint8_t auStack_10080 [65564];
int ******implementedText [4];
int implementedTextSize;
uint32_t implementedTextCapacity;
uint32_t newEntryType;
uint32_t local_48;
uint32_t local_44;
int newEntryId;
void *newEntryName;
uint32_t uStack_38;
uint32_t uStack_34;
uint32_t uStack_30;
uint32_t newEntryNameSize;
uint32_t newEntryNameCapacity;
uint32_t stackCookie;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
int *****local_14;
int entryType;
std_string *entriesEndField;
Manager *manager;
MenuManager *menuManager;
uint64_t oldAllocated;
menuManager = g_menuManager;
puStack_20 = GHIDRA_CAST<uint8_t *>((implementedText + 0x18));
local_14 = GHIDRA_CAST<int *****>(0xffffffff);
puStack_18 = &LAB_00b07590;
local_1c = ExceptionList;
uVar5 = __security_cookie ^ GHIDRA_UINT((implementedText + 0x15));
ExceptionList = &local_1c;
this->PositionX = 0.0;
this->PositionY = 0.0;
menuManager->_viewPositionSet[7].y = -216.0;
menuManager->_state = 1;
stackCookie = uVar5;
file = (GHIDRA_CAST<FileSystem *>((&PTR_vftable_00c37a10)))->FileSystem::Open(GHIDRA_CAST<uint8_t *>("seedmenu.xml"),GHIDRA_CAST<int *>(0x0));
if (file == GHIDRA_CAST<int *>(0x0)) {
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("ERROR Could not read seed menu layout\n"));
}
else {
uVar13 = *GHIDRA_CAST<uint32_t *>(this[1].SpecialSeedsSprite._animDefaultName._buf);
entryIter = this[1].SpecialSeedsSprite._filename._capacity;
if (entryIter != uVar13) {
do {
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((entryIter + 0x10)))))->msvc::string::_Tidy_deallocate();
entryIter = entryIter + 0x28;
} while (entryIter != uVar13);
entryIter = this[1].SpecialSeedsSprite._filename._capacity;
}
*GHIDRA_CAST<uint32_t *>(this[1].SpecialSeedsSprite._animDefaultName._buf) = entryIter;
iVar6 = (**(code **)(*file + 4))(uVar5);
text = operator_new_tracked(iVar6 + 1);
(**(code **)(*file + 0x14))(text,1,iVar6);
text[iVar6] = 0;
(**(code **)*file)(1);
FUN_00413b90();
local_14 = GHIDRA_CAST<int *****>(0x0);
pbVar15 = GHIDRA_CAST<uint8_t *>(0x8f1b22);
pbVar9 = text;
(GHIDRA_CAST<rapidxml::xml_document *>((xmlDoc)))->rapidxml::xml_document::parse(text);
pvVar7 = (GHIDRA_CAST<xml_node *>((xmlDoc)))->xml_node::first_node(GHIDRA_CAST<uint8_t *>("entryDialog"),GHIDRA_INT(pbVar15),(uint8_t)pbVar9);
for (puVar12 = *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(pvVar7) + 0x20)); bVar4 = (uint8_t)pbVar9,
puVar12 != GHIDRA_CAST<uint32_t *>(0x0); puVar12 = GHIDRA_CAST<uint32_t *>(puVar12[6])) {
pbVar10 = GHIDRA_CAST<uint8_t *>(*puVar12);
pcVar8 = "unlock";
attrNameChar = &g_xmlNullStr;
if (pbVar10 != GHIDRA_CAST<uint8_t *>(0x0)) {
attrNameChar = pbVar10;
}
do {
bVar4 = *attrNameChar;
bVar14 = bVar4 < (uint8_t)*pcVar8;
if (bVar4 != *pcVar8) {
LAB_008f1b71:
uVar5 = -GHIDRA_UINT(bVar14) | 1;
goto LAB_008f1b76;
}
if (bVar4 == 0) break;
bVar4 = attrNameChar[1];
bVar14 = bVar4 < (uint8_t)pcVar8[1];
if (bVar4 != pcVar8[1]) goto LAB_008f1b71;
attrNameChar = attrNameChar + 2;
pcVar8 = pcVar8 + 2;
} while (bVar4 != 0);
uVar5 = 0;
LAB_008f1b76:
if (uVar5 == 0) {
pbVar15 = &g_xmlNullStr;
if (GHIDRA_CAST<uint8_t *>(puVar12[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar15 = GHIDRA_CAST<uint8_t *>(puVar12[1]);
}
pbVar9 = pbVar15;
do {
bVar4 = *pbVar9;
pbVar9 = pbVar9 + 1;
} while (bVar4 != 0);
pbVar9 = pbVar9 + -GHIDRA_INT((pbVar15 + 1));
targetString = this + 1;
LAB_008f1c08:
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(targetString))))->msvc::string::assign(pbVar15,GHIDRA_UINT(pbVar9));
}
else {
pcVar8 = "enable";
attrNameChar = &g_xmlNullStr;
if (pbVar10 != GHIDRA_CAST<uint8_t *>(0x0)) {
attrNameChar = pbVar10;
}
do {
bVar4 = *attrNameChar;
bVar14 = bVar4 < (uint8_t)*pcVar8;
if (bVar4 != *pcVar8) {
LAB_008f1bd7:
uVar5 = -GHIDRA_UINT(bVar14) | 1;
goto LAB_008f1bdc;
}
if (bVar4 == 0) break;
bVar4 = attrNameChar[1];
bVar14 = bVar4 < (uint8_t)pcVar8[1];
if (bVar4 != pcVar8[1]) goto LAB_008f1bd7;
attrNameChar = attrNameChar + 2;
pcVar8 = pcVar8 + 2;
} while (bVar4 != 0);
uVar5 = 0;
LAB_008f1bdc:
if (uVar5 == 0) {
pbVar15 = &g_xmlNullStr;
if (GHIDRA_CAST<uint8_t *>(puVar12[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar15 = GHIDRA_CAST<uint8_t *>(puVar12[1]);
}
pbVar9 = pbVar15;
do {
bVar4 = *pbVar9;
pbVar9 = pbVar9 + 1;
} while (bVar4 != 0);
pbVar9 = pbVar9 + -GHIDRA_INT((pbVar15 + 1));
targetString = GHIDRA_CAST<Menu_SpecialSeeds *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x18))));
goto LAB_008f1c08;
}
}
bVar4 = (uint8_t)pbVar9;
if (puVar12[4] == 0) break;
}
pvVar7 = (GHIDRA_CAST<xml_node *>((xmlDoc)))->xml_node::first_node(GHIDRA_CAST<uint8_t *>("seedmenu"),GHIDRA_INT(pbVar15),bVar4);
for (puVar12 = *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(pvVar7) + 0x18)); puVar12 != GHIDRA_CAST<uint32_t *>(0x0);
puVar12 = GHIDRA_CAST<uint32_t *>(puVar12[0xb])) {
pbVar15 = GHIDRA_CAST<uint8_t *>(*puVar12);
pcVar8 = "reset";
pbVar9 = &g_xmlNullStr;
if (pbVar15 != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar9 = pbVar15;
}
do {
bVar4 = *pbVar9;
bVar14 = bVar4 < (uint8_t)*pcVar8;
if (bVar4 != *pcVar8) {
LAB_008f1c77:
uVar5 = -GHIDRA_UINT(bVar14) | 1;
goto LAB_008f1c7c;
}
if (bVar4 == 0) break;
bVar4 = pbVar9[1];
bVar14 = bVar4 < (uint8_t)pcVar8[1];
if (bVar4 != pcVar8[1]) goto LAB_008f1c77;
pbVar9 = pbVar9 + 2;
pcVar8 = pcVar8 + 2;
} while (bVar4 != 0);
uVar5 = 0;
LAB_008f1c7c:
if (uVar5 == 0) {
local_48 = 0;
local_44 = 0;
newEntryId = 0;
newEntryNameSize = 0;
newEntryNameCapacity = 0xf;
newEntryName = (void *)0x0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = (uint3)(GHIDRA_UINT(local_14) >> 8);
local_14 = GHIDRA_CAST<int *****>(CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1));
newEntryType = 1;
pbVar15 = s_name;
do {
pbVar9 = pbVar15;
pbVar15 = pbVar9 + 1;
} while (*pbVar15 != 0);
puVar11 = GHIDRA_CAST<uint32_t *>(puVar12[8]);
if (puVar11 != GHIDRA_CAST<uint32_t *>(0x0)) {
LAB_008f1cd0:
pbVar15 = GHIDRA_CAST<uint8_t *>(*puVar11);
if (pbVar15 == GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar10 = GHIDRA_CAST<uint8_t *>(0x0);
pbVar15 = &g_xmlNullStr;
}
else {
pbVar10 = GHIDRA_CAST<uint8_t *>(puVar11[2]);
}
if (pbVar10 != pbVar9 + -0xb1c13b) goto LAB_008f1d83;
pbVar10 = pbVar10 + GHIDRA_INT(pbVar15);
if (pbVar15 < pbVar10) {
iVar6 = GHIDRA_INT(s_name) - GHIDRA_INT(pbVar15);
while (*pbVar15 == pbVar15[iVar6]) {
pbVar15 = pbVar15 + 1;
if (pbVar10 <= pbVar15) goto LAB_008f1d10;
}
goto LAB_008f1d83;
}
LAB_008f1d10:
pbVar15 = &g_xmlNullStr;
if (GHIDRA_CAST<uint8_t *>(puVar11[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar15 = GHIDRA_CAST<uint8_t *>(puVar11[1]);
}
pbVar9 = pbVar15;
do {
bVar4 = *pbVar9;
pbVar9 = pbVar9 + 1;
} while (bVar4 != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&newEntryName))))->msvc::string::assign(pbVar15,GHIDRA_INT(pbVar9) - GHIDRA_INT((pbVar15 + 1)));
}
LAB_008f1d45:
puVar11 = *GHIDRA_CAST<uint32_t **>(this[1].SpecialSeedsSprite._animDefaultName._buf);
if (puVar11 == *GHIDRA_CAST<uint32_t **>((this[1].SpecialSeedsSprite._animDefaultName._buf + 4))) {
FUN_008f28c0(puVar11,&newEntryType);
}
else {
puVar11[3] = newEntryId;
*puVar11 = newEntryType;
puVar11[1] = local_48;
puVar11[2] = local_44;
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((puVar11 + 4)))))->msvc::string::string(&newEntryName);
entriesEndField = &this[1].SpecialSeedsSprite._animDefaultName;
*GHIDRA_CAST<int *>(entriesEndField->_buf) = *GHIDRA_CAST<int *>(entriesEndField->_buf) + 0x28;
}
local_14 = GHIDRA_CAST<int *****>((GHIDRA_UINT(local_14) & 0xffffff00));
if (0xf < newEntryNameCapacity) {
uVar5 = newEntryNameCapacity + 1;
pvVar7 = newEntryName;
if (0xfff < uVar5) {
pvVar7 = *(void **)(GHIDRA_CAST<char *>(newEntryName) + -4);
uVar5 = newEntryNameCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(newEntryName) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_008f2464;
}
operator_delete(pvVar7,uVar5);
}
pbVar15 = GHIDRA_CAST<uint8_t *>(*puVar12);
}
pcVar8 = "confirm";
pbVar9 = &g_xmlNullStr;
if (pbVar15 != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar9 = pbVar15;
}
do {
bVar4 = *pbVar9;
bVar14 = bVar4 < (uint8_t)*pcVar8;
if (bVar4 != *pcVar8) {
LAB_008f1e12:
uVar5 = -GHIDRA_UINT(bVar14) | 1;
goto LAB_008f1e17;
}
if (bVar4 == 0) break;
bVar4 = pbVar9[1];
bVar14 = bVar4 < (uint8_t)pcVar8[1];
if (bVar4 != pcVar8[1]) goto LAB_008f1e12;
pbVar9 = pbVar9 + 2;
pcVar8 = pcVar8 + 2;
} while (bVar4 != 0);
uVar5 = 0;
LAB_008f1e17:
if (uVar5 == 0) {
local_48 = 0;
local_44 = 0;
newEntryId = 0;
newEntryNameSize = 0;
newEntryNameCapacity = 0xf;
newEntryName = (void *)0x0;
local_14 = GHIDRA_CAST<int *****>(CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2));
newEntryType = 2;
pbVar15 = s_name;
do {
pbVar9 = pbVar15;
pbVar15 = pbVar9 + 1;
} while (*pbVar15 != 0);
puVar11 = GHIDRA_CAST<uint32_t *>(puVar12[8]);
if (puVar11 != GHIDRA_CAST<uint32_t *>(0x0)) {
LAB_008f1e70:
pbVar15 = GHIDRA_CAST<uint8_t *>(*puVar11);
if (pbVar15 == GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar10 = GHIDRA_CAST<uint8_t *>(0x0);
pbVar15 = &g_xmlNullStr;
}
else {
pbVar10 = GHIDRA_CAST<uint8_t *>(puVar11[2]);
}
if (pbVar10 != pbVar9 + -0xb1c13b) goto LAB_008f1f23;
pbVar10 = pbVar10 + GHIDRA_INT(pbVar15);
if (pbVar15 < pbVar10) {
iVar6 = GHIDRA_INT(s_name) - GHIDRA_INT(pbVar15);
while (*pbVar15 == pbVar15[iVar6]) {
pbVar15 = pbVar15 + 1;
if (pbVar10 <= pbVar15) goto LAB_008f1eb0;
}
goto LAB_008f1f23;
}
LAB_008f1eb0:
pbVar15 = &g_xmlNullStr;
if (GHIDRA_CAST<uint8_t *>(puVar11[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar15 = GHIDRA_CAST<uint8_t *>(puVar11[1]);
}
pbVar9 = pbVar15;
do {
bVar4 = *pbVar9;
pbVar9 = pbVar9 + 1;
} while (bVar4 != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&newEntryName))))->msvc::string::assign(pbVar15,GHIDRA_INT(pbVar9) - GHIDRA_INT((pbVar15 + 1)));
}
LAB_008f1ee5:
puVar11 = *GHIDRA_CAST<uint32_t **>(this[1].SpecialSeedsSprite._animDefaultName._buf);
if (puVar11 == *GHIDRA_CAST<uint32_t **>((this[1].SpecialSeedsSprite._animDefaultName._buf + 4))) {
FUN_008f28c0(puVar11,&newEntryType);
}
else {
puVar11[3] = newEntryId;
*puVar11 = newEntryType;
puVar11[1] = local_48;
puVar11[2] = local_44;
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((puVar11 + 4)))))->msvc::string::string(&newEntryName);
entriesEndField = &this[1].SpecialSeedsSprite._animDefaultName;
*GHIDRA_CAST<int *>(entriesEndField->_buf) = *GHIDRA_CAST<int *>(entriesEndField->_buf) + 0x28;
}
local_14 = GHIDRA_CAST<int *****>((GHIDRA_UINT(local_14) & 0xffffff00));
if (0xf < newEntryNameCapacity) {
uVar5 = newEntryNameCapacity + 1;
pvVar7 = newEntryName;
if (0xfff < uVar5) {
pvVar7 = *(void **)(GHIDRA_CAST<char *>(newEntryName) + -4);
uVar5 = newEntryNameCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(newEntryName) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_008f2464;
}
operator_delete(pvVar7,uVar5);
}
pbVar15 = GHIDRA_CAST<uint8_t *>(*puVar12);
}
pbVar10 = &DAT_00b658e4;
pbVar9 = &g_xmlNullStr;
if (pbVar15 != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar9 = pbVar15;
}
do {
bVar4 = *pbVar9;
bVar14 = bVar4 < *pbVar10;
if (bVar4 != *pbVar10) {
LAB_008f1fb0:
uVar5 = -GHIDRA_UINT(bVar14) | 1;
goto LAB_008f1fb5;
}
if (bVar4 == 0) break;
bVar4 = pbVar9[1];
bVar14 = bVar4 < pbVar10[1];
if (bVar4 != pbVar10[1]) goto LAB_008f1fb0;
pbVar9 = pbVar9 + 2;
pbVar10 = pbVar10 + 2;
} while (bVar4 != 0);
uVar5 = 0;
LAB_008f1fb5:
if (uVar5 == 0) {
newEntryNameCapacity = 0xf;
local_48 = 0;
local_44 = 0;
newEntryId = 0;
newEntryNameSize = 0;
newEntryName = (void *)0x0;
local_14 = GHIDRA_CAST<int *****>(CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),3));
puVar11 = GHIDRA_CAST<uint32_t *>(puVar12[8]);
newEntryType = 3;
bVar14 = true;
for (; puVar11 != GHIDRA_CAST<uint32_t *>(0x0); puVar11 = GHIDRA_CAST<uint32_t *>(puVar11[6])) {
pbVar15 = GHIDRA_CAST<uint8_t *>(*puVar11);
pbVar10 = s_id;
pbVar9 = &g_xmlNullStr;
if (pbVar15 != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar9 = pbVar15;
}
do {
bVar4 = *pbVar9;
isLess = bVar4 < *pbVar10;
if (bVar4 != *pbVar10) {
LAB_008f2038:
uVar5 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008f203d;
}
if (bVar4 == 0) break;
bVar4 = pbVar9[1];
isLess = bVar4 < pbVar10[1];
if (bVar4 != pbVar10[1]) goto LAB_008f2038;
pbVar9 = pbVar9 + 2;
pbVar10 = pbVar10 + 2;
} while (bVar4 != 0);
uVar5 = 0;
LAB_008f203d:
if (uVar5 == 0) {
pbVar15 = &g_xmlNullStr;
if (GHIDRA_CAST<uint8_t *>(puVar11[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar15 = GHIDRA_CAST<uint8_t *>(puVar11[1]);
}
newEntryId = atoi(GHIDRA_CAST<char *>(pbVar15));
}
else {
pbVar10 = s_name;
pbVar9 = &g_xmlNullStr;
if (pbVar15 != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar9 = pbVar15;
}
do {
bVar4 = *pbVar9;
isLess = bVar4 < *pbVar10;
if (bVar4 != *pbVar10) {
LAB_008f2091:
uVar5 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008f2096;
}
if (bVar4 == 0) break;
bVar4 = pbVar9[1];
isLess = bVar4 < pbVar10[1];
if (bVar4 != pbVar10[1]) goto LAB_008f2091;
pbVar9 = pbVar9 + 2;
pbVar10 = pbVar10 + 2;
} while (bVar4 != 0);
uVar5 = 0;
LAB_008f2096:
if (uVar5 == 0) {
pbVar15 = &g_xmlNullStr;
if (GHIDRA_CAST<uint8_t *>(puVar11[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar15 = GHIDRA_CAST<uint8_t *>(puVar11[1]);
}
pbVar9 = pbVar15;
do {
bVar4 = *pbVar9;
pbVar9 = pbVar9 + 1;
} while (bVar4 != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&newEntryName))))->msvc::string::assign(pbVar15,GHIDRA_INT(pbVar9) - GHIDRA_INT((pbVar15 + 1)));
}
else {
pcVar8 = "implemented";
pbVar9 = &g_xmlNullStr;
if (pbVar15 != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar9 = pbVar15;
}
do {
bVar4 = *pbVar9;
isLess = bVar4 < (uint8_t)*pcVar8;
if (bVar4 != *pcVar8) {
LAB_008f20f7:
uVar5 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008f20fc;
}
if (bVar4 == 0) break;
bVar4 = pbVar9[1];
isLess = bVar4 < (uint8_t)pcVar8[1];
if (bVar4 != pcVar8[1]) goto LAB_008f20f7;
pbVar9 = pbVar9 + 2;
pcVar8 = pcVar8 + 2;
} while (bVar4 != 0);
uVar5 = 0;
LAB_008f20fc:
if (uVar5 == 0) {
implementedText[0] = GHIDRA_CAST<int ******>(0x0);
implementedTextSize = 0;
pbVar15 = &g_xmlNullStr;
if (GHIDRA_CAST<uint8_t *>(puVar11[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar15 = GHIDRA_CAST<uint8_t *>(puVar11[1]);
}
implementedTextCapacity = 0xf;
pbVar9 = pbVar15;
do {
bVar4 = *pbVar9;
pbVar9 = pbVar9 + 1;
} while (bVar4 != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(implementedText))))->msvc::string::assign(pbVar15,GHIDRA_INT(pbVar9) - GHIDRA_INT((pbVar15 + 1)));
if (implementedTextSize == 0) {
LAB_008f2201:
bVar14 = false;
}
else {
implementedChars = GHIDRA_CAST<int ******>(implementedText);
if (0xf < implementedTextCapacity) {
implementedChars = implementedText[0];
}
if (implementedTextSize == 4) {
if ((*implementedChars == GHIDRA_CAST<int *****>(0x65757274)) ||
((((bVar4 = (uint8_t)*implementedChars, bVar14 = bVar4 < 0x74, bVar4 == 0x74 &&
(bVar14 = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 1)) < 0x72,
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 1)) == 0x72)) &&
(bVar14 = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 2)) < 0x75,
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 2)) == 0x75)) &&
(bVar14 = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 3)) < 0x65,
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 3)) == 0x65)))) {
uVar5 = 0;
}
else {
uVar5 = -GHIDRA_UINT(bVar14) | 1;
}
if (uVar5 != 0) goto LAB_008f2199;
}
else {
LAB_008f2199:
implementedChars = GHIDRA_CAST<int ******>(implementedText);
if (0xf < implementedTextCapacity) {
implementedChars = implementedText[0];
}
if (implementedTextSize == 4) {
if ((*implementedChars == GHIDRA_CAST<int *****>(0x65757254)) ||
(((bVar4 = (uint8_t)*implementedChars, bVar14 = bVar4 < 0x54, bVar4 == 0x54 &&
(bVar14 = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 1)) < 0x72,
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 1)) == 0x72)) &&
((bVar14 = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 2)) < 0x75,
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 2)) == 0x75 &&
(bVar14 = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 3)) < 0x65,
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(implementedChars) + 3)) == 0x65)))))) {
uVar5 = 0;
}
else {
uVar5 = -GHIDRA_UINT(bVar14) | 1;
}
if (uVar5 == 0) goto LAB_008f21f8;
}
implementedChars = GHIDRA_CAST<int ******>(implementedText);
if (0xf < implementedTextCapacity) {
implementedChars = implementedText[0];
}
iVar6 = atoi(GHIDRA_CAST<char *>(implementedChars));
if (iVar6 == 0) goto LAB_008f2201;
}
LAB_008f21f8:
bVar14 = true;
}
if (0xf < implementedTextCapacity) {
uVar5 = implementedTextCapacity + 1;
implementedChars = implementedText[0];
if (0xfff < uVar5) {
implementedChars = GHIDRA_CAST<int ******>(implementedText[0][-1]);
uVar5 = implementedTextCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(implementedText[0]) + (-4 - GHIDRA_INT(implementedChars)))))
goto LAB_008f2464;
}
operator_delete(implementedChars,uVar5);
}
implementedTextSize = 0;
implementedTextCapacity = 0xf;
implementedText[0] = GHIDRA_CAST<int ******>((GHIDRA_UINT(implementedText[0]) & 0xffffff00));
}
}
}
if (puVar11[4] == 0) break;
}
manager = g_manager;
if (bVar14) {
if (*GHIDRA_CAST<char *>((GHIDRA_INT((g_manager->_persistentGameData)._cutsceneCounters) + newEntryId + 0x74))
!= '\0') {
puVar11 = *GHIDRA_CAST<uint32_t **>(this[1].SpecialSeedsSprite._animDefaultName._buf);
if (puVar11 == *GHIDRA_CAST<uint32_t **>((this[1].SpecialSeedsSprite._animDefaultName._buf + 4))) {
FUN_008f28c0(puVar11,&newEntryType);
}
else {
*puVar11 = newEntryType;
puVar11[1] = local_48;
puVar11[2] = local_44;
puVar11[3] = newEntryId;
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((puVar11 + 4)))))->msvc::string::string(&newEntryName);
entriesEndField = &this[1].SpecialSeedsSprite._animDefaultName;
*GHIDRA_CAST<int *>(entriesEndField->_buf) = *GHIDRA_CAST<int *>(entriesEndField->_buf) + 0x28;
}
}
}
else if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_manager->_persistentGameData))) + 0x1))) == '\0') {
*(uint8_t *)
(GHIDRA_INT((g_manager->_persistentGameData)._cutsceneCounters) + newEntryId + 0x74) = 0;
*GHIDRA_CAST<uint8_t *>(&manager->_persistentGameData) = 1;
}
local_14 = GHIDRA_CAST<int *****>((GHIDRA_UINT(local_14) & 0xffffff00));
if (0xf < newEntryNameCapacity) {
uVar5 = newEntryNameCapacity + 1;
pvVar7 = newEntryName;
if (0xfff < uVar5) {
pvVar7 = *(void **)(GHIDRA_CAST<char *>(newEntryName) + -4);
uVar5 = newEntryNameCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(newEntryName) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_008f2464;
}
operator_delete(pvVar7,uVar5);
}
pbVar15 = GHIDRA_CAST<uint8_t *>(*puVar12);
}
pcVar8 = "spacer";
pbVar9 = &g_xmlNullStr;
if (pbVar15 != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar9 = pbVar15;
}
do {
bVar4 = *pbVar9;
bVar14 = bVar4 < (uint8_t)*pcVar8;
if (bVar4 != *pcVar8) {
LAB_008f2360:
uVar5 = -GHIDRA_UINT(bVar14) | 1;
goto LAB_008f2365;
}
if (bVar4 == 0) break;
bVar4 = pbVar9[1];
bVar14 = bVar4 < (uint8_t)pcVar8[1];
if (bVar4 != pcVar8[1]) goto LAB_008f2360;
pbVar9 = pbVar9 + 2;
pcVar8 = pcVar8 + 2;
} while (bVar4 != 0);
uVar5 = 0;
LAB_008f2365:
if ((uVar5 == 0) &&
(puVar11 = *GHIDRA_CAST<uint32_t **>(this[1].SpecialSeedsSprite._animDefaultName._buf),
puVar11[-10] != 0)) {
newEntryType = 0;
local_44 = 0;
local_48 = 0;
newEntryId = 0;
newEntryNameSize = 0;
newEntryNameCapacity = 0xf;
newEntryName = (void *)0x0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
if (puVar11 == *GHIDRA_CAST<uint32_t **>((this[1].SpecialSeedsSprite._animDefaultName._buf + 4))) {
FUN_008f27b0(puVar11,&newEntryType);
}
else {
*puVar11 = 0;
puVar11[1] = 0;
puVar11[2] = 0;
puVar11[3] = 0;
puVar11[8] = 0;
puVar11[9] = 0;
puVar11[4] = 0;
puVar11[5] = uStack_38;
puVar11[6] = uStack_34;
puVar11[7] = uStack_30;
newEntryName = (void *)0x0;
puVar11[8] = 0;
puVar11[9] = 0xf;
entriesEndField = &this[1].SpecialSeedsSprite._animDefaultName;
*GHIDRA_CAST<int *>(entriesEndField->_buf) = *GHIDRA_CAST<int *>(entriesEndField->_buf) + 0x28;
}
local_14 = GHIDRA_CAST<int *****>(((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8));
if (0xf < newEntryNameCapacity) {
uVar5 = newEntryNameCapacity + 1;
pvVar7 = newEntryName;
if (0xfff < uVar5) {
pvVar7 = *(void **)(GHIDRA_CAST<char *>(newEntryName) + -4);
uVar5 = newEntryNameCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(newEntryName) + (-4 - GHIDRA_INT(pvVar7))))) {
LAB_008f2464:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar7,uVar5);
}
}
}
puVar12 = *GHIDRA_CAST<uint32_t **>(this[1].SpecialSeedsSprite._animDefaultName._buf);
if (puVar12[-10] == 0) {
uVar5 = this[1].SpecialSeedsSprite._filename._capacity;
eraseDst = GHIDRA_CAST<uint32_t *>((uVar5 + ((GHIDRA_INT((GHIDRA_INT(puVar12) - uVar5)) / 0x28) * 5 + -5) * 8));
eraseSrc = eraseDst + 10;
if (eraseSrc != puVar12) {
pcVar8 = GHIDRA_CAST<char *>((eraseDst + 4));
puVar11 = eraseDst + 0x12;
do {
*eraseDst = *eraseSrc;
*GHIDRA_CAST<uint32_t *>((pcVar8 + -0xc)) = puVar11[-7];
*GHIDRA_CAST<uint32_t *>((pcVar8 + -8)) = puVar11[-6];
*GHIDRA_CAST<uint32_t *>((pcVar8 + -4)) = puVar11[-5];
if (pcVar8 != GHIDRA_CAST<char *>((puVar11 + -4))) {
(GHIDRA_CAST<msvc::string *>((pcVar8)))->msvc::string::_Tidy_deallocate();
uVar1 = puVar11[-3];
uVar2 = puVar11[-2];
uVar3 = puVar11[-1];
*GHIDRA_CAST<uint32_t *>(pcVar8) = puVar11[-4];
*GHIDRA_CAST<uint32_t *>((pcVar8 + 4)) = uVar1;
*GHIDRA_CAST<uint32_t *>((pcVar8 + 8)) = uVar2;
*GHIDRA_CAST<uint32_t *>((pcVar8 + 0xc)) = uVar3;
uVar1 = puVar11[1];
*GHIDRA_CAST<uint32_t *>((pcVar8 + 0x10)) = *puVar11;
*GHIDRA_CAST<uint32_t *>((pcVar8 + 0x14)) = uVar1;
*puVar11 = 0;
puVar11[1] = 0xf;
*GHIDRA_CAST<uint8_t *>((puVar11 + -4)) = 0;
}
eraseDst = eraseDst + 10;
eraseSrc = eraseSrc + 10;
pcVar8 = pcVar8 + 0x28;
puVar11 = puVar11 + 10;
} while (eraseSrc != puVar12);
puVar12 = *GHIDRA_CAST<uint32_t **>(this[1].SpecialSeedsSprite._animDefaultName._buf);
}
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((puVar12 + -6)))))->msvc::string::_Tidy_deallocate();
entriesEndField = &this[1].SpecialSeedsSprite._animDefaultName;
*GHIDRA_CAST<int *>(entriesEndField->_buf) = *GHIDRA_CAST<int *>(entriesEndField->_buf) + -0x28;
}
local_14 = GHIDRA_CAST<int *****>(0x5);
(GHIDRA_CAST<xml_memory_pool *>((auStack_10080)))->xml_memory_pool::clear();
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
if (text != GHIDRA_CAST<uint8_t *>(0x0)) {
uVar5 = *GHIDRA_CAST<uint32_t *>((text + -4));
oldAllocated = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar5;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < uVar5));
free(text + -4);
}
uVar5 = this[1].SpecialSeedsSprite._filename._capacity;
uVar13 = 0;
entriesBytes = *GHIDRA_CAST<int *>(this[1].SpecialSeedsSprite._animDefaultName._buf) - uVar5;
layoutY = 0.0;
layoutX = 0.0;
iVar6 = entriesBytes >> 0x1f;
if (entriesBytes / 0x28 + iVar6 != iVar6) {
entryPos = GHIDRA_CAST<float *>((uVar5 + 4));
do {
*entryPos = layoutX;
entryPos[1] = layoutY;
entryType = GHIDRA_INT(entryPos[-1]);
if ((entryType == 1) || (entryType == 2)) {
layoutX = layoutX + _DAT_00c35e40;
layoutY = layoutY + _DAT_00c35e44;
}
else if (entryType == 0) {
layoutX = layoutX + _DAT_00c35e50;
layoutY = layoutY + _DAT_00c35e54;
}
else {
layoutX = layoutX + _DAT_00c35e48;
layoutY = layoutY + DAT_00c35e4c;
}
uVar13 = uVar13 + 1;
entryPos = entryPos + 10;
} while (uVar13 < GHIDRA_UINT((GHIDRA_INT((*GHIDRA_CAST<int *>(this[1].SpecialSeedsSprite._animDefaultName._buf) -
this[1].SpecialSeedsSprite._filename._capacity)) / 0x28)));
}
}
ExceptionList = local_1c;
return;
LAB_008f1d83:
puVar11 = GHIDRA_CAST<uint32_t *>(puVar11[6]);
if (puVar11 == GHIDRA_CAST<uint32_t *>(0x0)) goto LAB_008f1d45;
goto LAB_008f1cd0;
LAB_008f1f23:
puVar11 = GHIDRA_CAST<uint32_t *>(puVar11[6]);
if (puVar11 == GHIDRA_CAST<uint32_t *>(0x0)) goto LAB_008f1ee5;
goto LAB_008f1e70;
}