//
// SecretLayer4::getThreadMessage from 0x140587c50 to 0x140588070 (1056 bytes)
//
// 2 xrefs:
// > SecretLayer4::getMessage @ 0x140587c3b
// > ??> @ 0x14092caa4
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:34:28 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall SecretLayer4::getThreadMessage(_DWORD *a1, __int64 a2)
{
size_t v4; // r8
char *v5; // rdx
int v6; // ecx
int v7; // ecx
int v8; // ecx
int v9; // ecx
int v10; // ecx
int v11; // ecx
int v12; // ecx
int v13; // ecx
int v14; // ecx
int v15; // ecx
int v16; // ecx
int v17; // ecx
int v18; // ecx
int v19; // ecx
int v20; // ecx
int v21; // ecx
int v22; // ecx
int v23; // ecx
a1[112] = 0;
*(_OWORD *)a2 = 0;
*(_QWORD *)(a2 + 16) = 15;
*(_QWORD *)(a2 + 24) = 15;
strcpy((char *)a2, "zzzzzzZZZZZZZZZ");
switch ( a1[110] )
{
case 1:
switch ( a1[111] )
{
case 0:
v4 = 29;
v5 = "I hide behind rocks and rills";
goto LABEL_58;
case 1:
v4 = 29;
v5 = "under the mountains and hills";
goto LABEL_58;
case 2:
v4 = 24;
v5 = "I cannot be seen or felt";
goto LABEL_58;
case 3:
v4 = 18;
v5 = "nor heard or smelt";
goto LABEL_58;
case 4:
v4 = 30;
v5 = "the more I am the less you see";
goto LABEL_58;
case 5:
sub_1400405A0((void **)a2, "what am I?", 0xAu);
a1[110] = 0;
break;
default:
goto LABEL_59;
}
goto LABEL_59;
case 2:
v6 = a1[111];
if ( !v6 )
{
v4 = 11;
v5 = "Shh, quiet!";
goto LABEL_58;
}
v7 = v6 - 1;
if ( !v7 )
{
v4 = 27;
v5 = "Can you feel it closing in?";
goto LABEL_58;
}
v8 = v7 - 1;
if ( !v8 )
{
v4 = 29;
v5 = "Shadows creep where it begins";
goto LABEL_58;
}
v9 = v8 - 1;
if ( !v9 )
{
v4 = 29;
v5 = "Speak its name and it is gone";
goto LABEL_58;
}
if ( v9 == 1 )
{
sub_1400405A0((void **)a2, "from every moment dusk till dawn", 0x20u);
a1[110] = 0;
}
goto LABEL_59;
case 3:
v10 = a1[111];
if ( !v10 )
{
v4 = 33;
v5 = "What always runs, but never walks";
goto LABEL_58;
}
v11 = v10 - 1;
if ( !v11 )
{
v4 = 26;
v5 = "Often murmurs, never talks";
goto LABEL_58;
}
v12 = v11 - 1;
if ( !v12 )
{
v4 = 27;
v5 = "Has a bed, but never sleeps";
goto LABEL_58;
}
if ( v12 == 1 )
{
sub_1400405A0((void **)a2, "Has a mouth, but never eats?", 0x1Cu);
a1[110] = 0;
}
goto LABEL_59;
case 4:
v13 = a1[111];
if ( v13 )
{
v14 = v13 - 1;
if ( v14 )
{
v15 = v14 - 1;
if ( v15 )
{
v16 = v15 - 1;
if ( v16 )
goto LABEL_31;
v4 = 19;
v5 = "and death will come";
}
else
{
v4 = 13;
v5 = "wait too long";
}
}
else
{
v4 = 21;
v5 = "the stronger I become";
}
}
else
{
v4 = 20;
v5 = "The less you consume";
}
goto LABEL_58;
case 5:
v17 = a1[111];
if ( !v17 )
{
v4 = 36;
v5 = "My thunder comes before my lightning";
goto LABEL_58;
}
v18 = v17 - 1;
if ( !v18 )
{
v4 = 33;
v5 = "My lightning comes before my rain";
goto LABEL_58;
}
v16 = v18 - 1;
if ( !v16 )
{
v4 = 40;
v5 = "My rain dries up all the land it touches";
goto LABEL_58;
}
LABEL_31:
if ( v16 == 1 )
{
sub_1400405A0((void **)a2, "What am I?", 0xAu);
a1[110] = 0;
}
goto LABEL_59;
case 6:
v19 = a1[111];
if ( !v19 )
{
v4 = 50;
v5 = "Legend tells of a level so hard no one can beat it";
goto LABEL_58;
}
v20 = v19 - 1;
if ( !v20 )
{
v4 = 37;
v5 = "Anything harder than it is impossible";
goto LABEL_58;
}
if ( v20 == 1 )
{
sub_1400405A0((void **)a2, "Don't even get me started", 0x19u);
a1[110] = 0;
}
goto LABEL_59;
case 7:
v21 = a1[111];
if ( !v21 )
{
v4 = 38;
v5 = "Good levels are hard to find sometimes";
goto LABEL_58;
}
v22 = v21 - 1;
if ( !v22 )
{
v4 = 45;
v5 = "Wish I had someone who could find them for me";
goto LABEL_58;
}
v23 = v22 - 1;
if ( !v23 )
{
v4 = 3;
v5 = "...";
LABEL_58:
sub_1400405A0((void **)a2, v5, v4);
goto LABEL_59;
}
if ( v23 == 1 )
{
sub_1400405A0((void **)a2, "Forget it...", 0xCu);
a1[110] = 0;
}
LABEL_59:
++a1[111];
return a2;
default:
v4 = 7;
v5 = "zzzZZZZ";
goto LABEL_58;
}
}