Files
isaac-port/generated-src/xml_memory_pool.cpp
T
shweetandClaude Opus 5.5 9d4d4f5c64 Build 29: zero-length placeholder structs, generated-src with standard types
--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:41:34 -05:00

57 lines
1.9 KiB
C++

#include "classes.h"
// 00414730
void xml_memory_pool::clear()
{
int staticPool;
void **ppvVar2;
uint32_t blockSize;
uint64_t *allocCounter;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
uint32_t blockSize;
int nextBlock;
uint64_t oldCount;
int staticPool;
local_8 = 0xffffffff;
puStack_c = &LAB_00af12f0;
blockSize = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
staticPool = GHIDRA_INT(this) + 0xc;
ppvVar2 = &local_10;
staticPool = *GHIDRA_CAST<int *>(this);
local_10 = ExceptionList;
while (ExceptionList = ppvVar2, staticPool != staticPool) {
nextBlock = *GHIDRA_CAST<int *>((staticPool + (-staticPool & 3U)));
if (*(code **)(GHIDRA_CAST<char *>(this) + 0x10010) == (code *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocCounter = &g_allocatedBytesNoHeap;
}
else {
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
if (staticPool != 0) {
blockSize = *GHIDRA_CAST<uint32_t *>((staticPool + -4));
oldCount = *allocCounter;
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - blockSize;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldCount) < blockSize));
free((void *)(staticPool + -4));
}
local_8 = 0xffffffff;
}
else {
(**(code **)(GHIDRA_CAST<char *>(this) + 0x10010))(staticPool,blockSize);
}
*GHIDRA_CAST<int *>(this) = nextBlock;
ppvVar2 = ExceptionList;
staticPool = nextBlock;
}
*GHIDRA_CAST<int *>(this) = staticPool;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 4)) = (-staticPool & 3U) + staticPool;
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 8)) = GHIDRA_INT(this) + 0x1000c;
ExceptionList = local_10;
return;
}