Function at 0x403920
Capabilities:
Check for time delay via gettickcount

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5e8108
mov eax, dword fs:[0]
push eax
sub esp, 0x15c
push ebx
push esi
push edi
mov eax, dword [0x6396a8]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov edi, edx
lea esi, [edi + 0x3c]
push esi
mov dword [ebp - 0x38], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], 0
cmp byte [edi + 0xccc], 0
je 0x4039a4
push 0x64
lea eax, [ebp - 0xf8]
push 0
push eax
call fcn.005b30e0
add esp, 0xc
cmp byte [edi + 0x38], 0
mov dword [ebp - 0xf8], 0x64
mov byte [edi + 0x54], 1
je 0x4039c7
cmp dword [0x63dc9c], 0
je 0x4039bf
mov byte [edi + 0x54], 0
mov byte [edi + 0x38], 0
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [edi + 0x30]
call fcn.00408cd0
test ebx, ebx
je 0x403a04
cmp byte [edi + 0x8c], 0
jne 0x403a04
mov ecx, dword [ebx + 4]
mov esi, dword [ebx + 0xc]
mov eax, dword [ebx]
mov edx, dword [ebx + 8]
mov dword [ebp - 0x14], esi
add esi, ecx
mov ebx, ecx
add edx, eax
mov dword [ebp - 0x20], ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x18], esi
add ecx, ebx
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x2c], edx
jmp 0x403a3f
mov edx, dword [edi + 0xa0]
mov eax, dword [edi + 0xa8]
mov ebx, dword [edi + 0xa4]
mov ecx, dword [edi + 0xac]
add eax, edx
add ecx, ebx
mov dword [ebp - 0x24], edx
xor edx, edx
mov dword [ebp - 0x1c], eax
mov eax, dword [edi + 0x6c]
xor esi, esi
mov dword [ebp - 0x18], ecx
mov ecx, dword [edi + 0x70]
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x2c], eax
cmp byte [edi + 0x8c], 0
mov dword [ebp - 0x28], ecx
je 0x403a55
mov dword [ebp - 0xf4], 1
mov eax, dword [edi + 0xcd0]
lea edx, [ebp - 0x40]
push edx
xor esi, esi
push eax
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x3c], esi
call dword [sym.imp.USER32.dll_ClientToScreen]
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x40]
push ecx
push edx
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.USER32.dll_OffsetRect]
mov eax, dword [edi + 0x68]
push esi
push 0x11
lea edx, [ebp - 0x168]
push edx
mov dword [ebp - 0x168], esi
mov dword [ebp - 0x168], 0x6c
mov ecx, dword [eax]
push esi
push eax
mov eax, dword [ecx + 0x64]
call eax
mov eax, dword [edi + 0x68]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x80]
push esi
push eax
call edx
cmp byte [edi + 0xcd4], 0
je 0x403d50
push 1
call dword [sym.imp.USER32.dll_GetSystemMetrics]
cmp byte [edi + 0xce8], 0
mov dword [ebp - 0x4c], eax
jne 0x403cd8
mov edx, dword [edi + 0x68]
mov eax, dword [edi + 0xcf8]
mov ecx, dword [edi + 0xcfc]
push esi
push edx
mov esi, edi
mov dword [edi + 0xd00], eax
mov dword [edi + 0xd04], ecx
call fcn.00403f50
mov eax, dword [edi + 0x2c]
cmp byte [eax + 0x5c0], 0
je 0x403bad
cmp byte [eax + 0x5c1], 0
jne 0x403bad
cmp dword [edi + 0xbc], 3
jge 0x403b9e
mov eax, dword [eax + 0xc4]
cdq
sub eax, edx
mov esi, eax
mov eax, dword [ebp - 0x20]
sar esi, 1
lea ecx, [eax + esi]
mov dword [ebp - 0x14], ecx
mov ecx, dword [edi + 0x70]
add ecx, eax
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x10], connect
xor bl, bl
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x48], eax
mov eax, dword [edi + 0x58]
mov edx, dword [eax]
mov edx, dword [edx + 0x40]
lea ecx, [ebp - 0x10]
push ecx
push eax
call edx
test eax, eax
jne 0x403b7c
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x10]
sub ecx, eax
test ecx, ecx
jle 0x403b83
cmp eax, dword [ebp - 0x4c]
jge 0x403b83
mov bl, 1
jmp 0x403b87
cmp eax, 0x88760219
jne 0x403b97
test bl, bl
jne 0x403bfc
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x48]
cmp eax, 0xc8
jb 0x403b54
add dword [edi + 0xbc], 1
mov eax, dword [edi + 0x58]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x58]
push 0
push 1
push eax
call edx
lea edx, [ebp - 0xf8]
push edx
push 0x1000000
lea edx, [ebp - 0x34]
push edx
mov edx, dword [edi + 0x68]
push edx
lea edx, [ebp - 0x24]
mov eax, dword [edi + 0x60]
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
cmp byte [edi + 0xd0c], 0
mov ebx, eax
je 0x403d45
mov ecx, dword [edi + 0x68]
push ecx
mov esi, edi
call fcn.00403e40
push ebx
mov byte [edi + 0xd0c], 1
mov ebx, str.Redraw_Windowed
jmp 0x403e09
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x7c], edx
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x70], edx
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x54], edx
lea edx, [ebp - 0xf8]
push edx
push 0x1000000
mov dword [ebp - 0x78], eax
mov eax, dword [ebp - 0x34]
lea edx, [ebp - 0x5c]
push edx
mov edx, dword [edi + 0x68]
push edx
mov dword [ebp - 0x74], ecx
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x5c], eax
mov eax, dword [edi + 0x60]
lea edx, [ebp - 0x7c]
mov dword [edi + 0xbc], 0
mov dword [ebp - 0x58], ecx
mov dword [ebp - 0x50], esi
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
mov ebx, dword [ebp - 0x10]
lea esp, [esp]
mov eax, dword [edi + 0x58]
mov ecx, dword [eax]
lea edx, [ebp - 0x10]
push edx
push eax
mov eax, dword [ecx + 0x40]
call eax
test eax, eax
jl 0x403c60
mov eax, dword [ebp - 0x10]
cmp eax, ebx
jb 0x403c83
mov ecx, dword [ebp - 0x44]
sub ecx, eax
test ecx, ecx
jg 0x403c60
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x6c], edx
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x60], edx
mov edx, dword [ebp - 0x28]
mov dword [ebp - 0x80], edx
lea edx, [ebp - 0xf8]
push edx
push 0x1000000
lea edx, [ebp - 0x8c]
push edx
mov edx, dword [edi + 0x68]
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x64], ecx
mov ecx, dword [ebp - 0x2c]
push edx
mov dword [ebp - 0x8c], eax
mov dword [ebp - 0x88], esi
mov dword [ebp - 0x84], ecx
lea edx, [ebp - 0x6c]
jmp 0x403bc4
mov eax, dword [edi + 0x2c]
cmp byte [eax + 0x5c0], 0
je 0x403cfb
cmp byte [eax + 0x5c1], 0
jne 0x403cfb
mov eax, dword [edi + 0x58]
mov edx, dword [eax]
push esi
push 1
push eax
mov eax, dword [edx + 0x58]
call eax
mov eax, dword [edi + 0x64]
mov ecx, dword [edi + 0xcf8]
mov edx, dword [edi + 0xcfc]
push 1
push eax
mov esi, edi
mov dword [edi + 0xd00], ecx
mov dword [edi + 0xd04], edx
call fcn.00403f50
mov eax, dword [edi + 0x60]
mov ecx, dword [eax]
lea edx, [ebp - 0xf8]
push edx
push 0x1000000
lea edx, [ebp - 0x34]
push edx
mov edx, dword [edi + 0x64]
push edx
lea edx, [ebp - 0x24]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
mov ebx, eax
push ebx
mov ebx, str.Redraw_Windowed
jmp 0x403e09
mov eax, dword [edi + 0x2c]
cmp byte [eax + 0x368], 0
jne 0x403de0
cmp byte [eax + 0x369], 0
je 0x403de0
cmp byte [edi + 0xce8], 0
jne 0x403d95
mov eax, dword [edi + 0x64]
mov edx, dword [eax]
mov edx, dword [edx + 0x14]
lea ecx, [ebp - 0xf8]
push ecx
push 0x1000000
lea ecx, [ebp - 0x34]
push ecx
mov ecx, dword [edi + 0x68]
push ecx
lea ecx, [ebp - 0x24]
push ecx
push eax
call edx
mov edx, dword [edi + 0x64]
mov eax, dword [edi + 0xcf8]
mov ecx, dword [edi + 0xcfc]
push 1
push edx
mov esi, edi
mov dword [edi + 0xd00], eax
mov dword [edi + 0xd04], ecx
call fcn.00403f50
mov eax, dword [edi + 0x60]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x2c]
push 1
push 0
push eax
call edx
push eax
mov ebx, str.Redraw_FullScreen_Flip
mov byte [edi + 0x54], 0
call fcn.004020e0
test al, al
mov eax, dword [ebp - 0x38]
push eax
jmp 0x403e18
mov eax, dword [edi + 0x60]
mov ecx, dword [eax]
lea edx, [ebp - 0xf8]
push edx
push 0x1000000
lea edx, [ebp - 0x34]
push edx
mov edx, dword [edi + 0x68]
push edx
lea edx, [ebp - 0x24]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
push eax
mov ebx, str.Redraw_FullScreen_Blt
mov byte [edi + 0x54], 0
call fcn.004020e0
mov ecx, dword [ebp - 0x38]
test al, al
push ecx
sete bl
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret