#include "classes.h" // 0040b520 int AnimationData::find_null_index(uint8_t *name) { int iVar1; uint8_t *nameChars; uint32_t cmpResult; uint8_t *queryChars; uint8_t *nullName; int nullIndex; bool isLess; uint8_t ch; iVar1 = *GHIDRA_CAST((GHIDRA_INT(&this[2]._layerCount) + 2)); nullIndex = 0; if (0 < iVar1) { nullName = *GHIDRA_CAST((GHIDRA_INT(&this[2]._animLayers) + 2)); do { nameChars = nullName; if (0xf < *GHIDRA_CAST((nullName + 0x14))) { nameChars = *GHIDRA_CAST(nullName); } queryChars = name; do { ch = *nameChars; isLess = ch < *queryChars; if (ch != *queryChars) { LAB_0040b565: cmpResult = -GHIDRA_UINT(isLess) | 1; goto LAB_0040b56a; } if (ch == 0) break; ch = nameChars[1]; isLess = ch < queryChars[1]; if (ch != queryChars[1]) goto LAB_0040b565; nameChars = nameChars + 2; queryChars = queryChars + 2; } while (ch != 0); cmpResult = 0; LAB_0040b56a: if (cmpResult == 0) { return nullIndex; } nullIndex = nullIndex + 1; nullName = nullName + 0x18; } while (nullIndex < iVar1); } return -1; }