//
// sub_1800D8880 from 0x1800d8880 to 0x1800d8c83 (1027 bytes)
//
// 4 xrefs:
// > sub_1800DBBB0 @ 0x1800dbc9d
// > ??> @ 0x18014c138
// > ??> @ 0x18014c148
// > ??> @ 0x1801c4a64
//
// 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:22:33 +0000
//
int __fastcall sub_1800D8880(__int64 a1, __int64 a2, LONG a3, LONG a4, int a5, int a6)
{
__int64 v6; // rax
int v11; // eax
__int64 v12; // rcx
DWORD v13; // esi
unsigned int v14; // ebx
int v15; // eax
DWORD v16; // ebx
UINT uFlags; // ebx
unsigned int v18; // eax
int v19; // ebx
HWND v20; // rcx
LONG WindowLongW; // eax
DWORD v22; // ebx
UINT v23; // r12d
int v24; // eax
int v25; // r8d
_BOOL8 v26; // r15
int v27; // eax
__int64 v28; // rcx
DWORD v29; // esi
int v30; // eax
struct tagRECT Rect; // [rsp+40h] [rbp-31h] BYREF
struct tagMONITORINFO mi; // [rsp+50h] [rbp-21h] BYREF
v6 = *(_QWORD *)(a1 + 72);
if ( v6 == a2 )
{
if ( a2 )
{
if ( *(_QWORD *)(a2 + 144) == a1 )
{
sub_1800D90E0(a1);
LODWORD(v6) = sub_1800D99E0(a1);
}
}
else
{
Rect.left = a3;
Rect.right = a3 + a5;
Rect.top = a4;
Rect.bottom = a4 + a6;
v11 = sub_1800E1C00(14393);
v12 = *(_QWORD *)(a1 + 72);
v13 = 0x40000;
if ( v11 )
{
if ( (v12 || *(_DWORD *)(a1 + 20)) && (v13 = 262152, v12) )
{
v14 = -2046820352;
}
else if ( *(_DWORD *)(a1 + 12) )
{
v14 = 114229248;
if ( !*(_DWORD *)(a1 + 8) )
v14 = 113901568;
}
else
{
v14 = -2046164992;
}
v15 = qword_1801B60E0(*(_QWORD *)(a1 + 880));
qword_1801B60E8(&Rect, v14, 0, v13, v15);
}
else
{
if ( (v12 || *(_DWORD *)(a1 + 20)) && (v13 = 262152, v12) )
{
v16 = -2046820352;
}
else if ( *(_DWORD *)(a1 + 12) )
{
v16 = 114229248;
if ( !*(_DWORD *)(a1 + 8) )
v16 = 113901568;
}
else
{
v16 = -2046164992;
}
AdjustWindowRectEx(&Rect, v16, 0, v13);
}
LODWORD(v6) = SetWindowPos(
*(HWND *)(a1 + 880),
nullptr,
Rect.left,
Rect.top,
Rect.right - Rect.left,
Rect.bottom - Rect.top,
0x114u);
}
}
else
{
if ( v6 )
sub_1800D9F00();
Concurrency::details::ListArray::SetScheduler(a1, a2);
if ( *(_QWORD *)(a1 + 72) )
{
mi.cbSize = 40;
uFlags = 336;
memset(&mi.rcMonitor, 0, 36);
if ( *(_DWORD *)(a1 + 12) )
{
v18 = GetWindowLongW(*(HWND *)(a1 + 880), -16) & 0xFF30FFFF;
if ( *(_QWORD *)(a1 + 72) )
{
v19 = -2046820352;
}
else if ( *(_DWORD *)(a1 + 12) )
{
v19 = 114229248;
if ( !*(_DWORD *)(a1 + 8) )
v19 = 113901568;
}
else
{
v19 = -2046164992;
}
SetWindowLongW(*(HWND *)(a1 + 880), -16, v18 | v19);
uFlags = 368;
}
sub_1800D90E0(a1);
GetMonitorInfoW(*(HMONITOR *)(*(_QWORD *)(a1 + 72) + 256LL), &mi);
LODWORD(v6) = SetWindowPos(
*(HWND *)(a1 + 880),
HWND_MESSAGE|0x2LL,
mi.rcMonitor.left,
mi.rcMonitor.top,
mi.rcMonitor.right - mi.rcMonitor.left,
mi.rcMonitor.bottom - mi.rcMonitor.top,
uFlags);
}
else
{
Rect.right = a3 + a5;
Rect.bottom = a4 + a6;
v20 = *(HWND *)(a1 + 880);
Rect.left = a3;
Rect.top = a4;
WindowLongW = GetWindowLongW(v20, -16);
v22 = -2046820352;
v23 = 272;
if ( *(_DWORD *)(a1 + 12) )
{
v24 = WindowLongW & 0x7FFFFFFF;
if ( *(_QWORD *)(a1 + 72) )
{
v25 = -2046820352;
}
else
{
v25 = 114229248;
if ( !*(_DWORD *)(a1 + 8) )
v25 = 113901568;
}
SetWindowLongW(*(HWND *)(a1 + 880), -16, v24 | v25);
v23 = 304;
}
v26 = *(_DWORD *)(a1 + 20) != 0;
v27 = sub_1800E1C00(14393);
v28 = *(_QWORD *)(a1 + 72);
v29 = 0x40000;
if ( v27 )
{
if ( !v28 && !*(_DWORD *)(a1 + 20) || (v29 = 262152, !v28) )
{
if ( *(_DWORD *)(a1 + 12) )
{
v22 = 114229248;
if ( !*(_DWORD *)(a1 + 8) )
v22 = 113901568;
}
else
{
v22 = -2046164992;
}
}
v30 = qword_1801B60E0(*(_QWORD *)(a1 + 880));
qword_1801B60E8(&Rect, v22, 0, v29, v30);
}
else
{
if ( !v28 && !*(_DWORD *)(a1 + 20) || (v29 = 262152, !v28) )
{
if ( *(_DWORD *)(a1 + 12) )
{
v22 = 114229248;
if ( !*(_DWORD *)(a1 + 8) )
v22 = 113901568;
}
else
{
v22 = -2046164992;
}
}
AdjustWindowRectEx(&Rect, v22, 0, v29);
}
LODWORD(v6) = SetWindowPos(
*(HWND *)(a1 + 880),
(HWND)(v26 - 2),
Rect.left,
Rect.top,
Rect.right - Rect.left,
Rect.bottom - Rect.top,
v23);
}
}
return v6;
}