//
// sub_1800D6EF0 from 0x1800d6ef0 to 0x1800d72f3 (1027 bytes)
//
// 4 xrefs:
// > sub_1800D3E80 @ 0x1800d3f6d
// > ??> @ 0x180142eac
// > ??> @ 0x180142ebc
// > ??> @ 0x1801ba9a4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_1800D6EF0(__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_1800D7750(a1);
LODWORD(v6) = sub_1800D8050(a1);
}
}
else
{
Rect.left = a3;
Rect.right = a3 + a5;
Rect.top = a4;
Rect.bottom = a4 + a6;
v11 = sub_1800D9CB0(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_1801AC060(*(_QWORD *)(a1 + 880));
qword_1801AC068(&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_1800D8570();
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_1800D7750(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_1800D9CB0(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_1801AC060(*(_QWORD *)(a1 + 880));
qword_1801AC068(&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;
}