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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x58997e
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push esi
push edi
mov eax, dword [0x5f4000]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], edx
mov edi, ecx
mov dword [ebp - 0x18], edi
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], 0
call fcn.00404dd0
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], 1
test edx, edx
jle 0x40d2f9
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
mov esi, 0x1a
cmp dword [0x5fdd64], 0
jne 0x40d112
mov dword [0x5fdd64], 1
call ebx
push eax
call fcn.0056f3d9
add esp, 4
call fcn.0056f3b8
cdq
mov ecx, 3
idiv ecx
inc edx
sub edx, 1
je 0x40d25a
sub edx, 1
je 0x40d1c6
cmp dword [0x5fdd64], 0
jne 0x40d150
mov dword [0x5fdd64], 1
call ebx
push eax
call fcn.0056f3d9
add esp, 4
call fcn.0056f3b8
cdq
idiv esi
add edx, 0x61
movzx esi, dx
test si, si
je 0x40d2ea
mov ecx, edi
call fcn.00414db0
mov edx, eax
mov eax, dword [edx + 0x14]
cmp eax, 2
jb 0x40d189
mov ecx, dword [edx + 0xc]
cmp word [ecx + eax - 2], 0
jne 0x40d189
add eax, 0xfffffffe
mov dword [edx + 0x14], eax
xor eax, eax
mov word [ebp - 0x20], si
mov esi, dword [edi + 0x24]
mov word [ebp - 0x1e], ax
mov eax, dword [edi + 0x20]
sub eax, esi
cmp eax, 4
jl 0x40d1b2
mov ecx, dword [edi + 0x1c]
mov eax, dword [ebp - 0x20]
mov dword [esi + ecx], eax
add dword [edi + 0x24], 4
jmp 0x40d2ea
lea eax, [esi + 4]
push eax
lea ecx, [edi + 0x10]
call fcn.00413740
mov ecx, dword [ebp - 0x20]
jmp 0x40d2e7
cmp dword [0x5fdd64], 0
jne 0x40d1e4
mov dword [0x5fdd64], 1
call ebx
push eax
call fcn.0056f3d9
add esp, 4
call fcn.0056f3b8
cdq
idiv esi
add edx, 0x41
movzx esi, dx
test si, si
je 0x40d2ea
mov ecx, edi
call fcn.00414db0
mov edx, eax
mov eax, dword [edx + 0x14]
cmp eax, 2
jb 0x40d21d
mov ecx, dword [edx + 0xc]
cmp word [ecx + eax - 2], 0
jne 0x40d21d
add eax, 0xfffffffe
mov dword [edx + 0x14], eax
xor eax, eax
mov word [ebp - 0x28], si
mov esi, dword [edi + 0x24]
mov word [ebp - 0x26], ax
mov eax, dword [edi + 0x20]
sub eax, esi
cmp eax, 4
jl 0x40d246
mov ecx, dword [edi + 0x1c]
mov eax, dword [ebp - 0x28]
mov dword [esi + ecx], eax
add dword [edi + 0x24], 4
jmp 0x40d2ea
lea eax, [esi + 4]
push eax
lea ecx, [edi + 0x10]
call fcn.00413740
mov ecx, dword [ebp - 0x28]
jmp 0x40d2e7
cmp dword [0x5fdd64], 0
jne 0x40d278
mov dword [0x5fdd64], 1
call ebx
push eax
call fcn.0056f3d9
add esp, 4
call fcn.0056f3b8
cdq
mov ecx, 0xa
idiv ecx
add edx, 0x30
movzx esi, dx
test si, si
je 0x40d2ea
mov ecx, edi
call fcn.00414db0
mov edx, eax
mov eax, dword [edx + 0x14]
cmp eax, 2
jb 0x40d2b2
mov ecx, dword [edx + 0xc]
cmp word [ecx + eax - 2], 0
jne 0x40d2b2
add eax, 0xfffffffe
mov dword [edx + 0x14], eax
xor eax, eax
mov word [ebp - 0x30], si
mov esi, dword [edi + 0x24]
mov word [ebp - 0x2e], ax
mov eax, dword [edi + 0x20]
sub eax, esi
cmp eax, 4
jl 0x40d2d8
mov ecx, dword [edi + 0x1c]
mov eax, dword [ebp - 0x30]
mov dword [esi + ecx], eax
add dword [edi + 0x24], 4
jmp 0x40d2ea
lea eax, [esi + 4]
push eax
lea ecx, [edi + 0x10]
call fcn.00413740
mov ecx, dword [ebp - 0x30]
mov dword [eax + esi], ecx
sub dword [ebp - 0x10], 1
mov esi, 0x1a
jne 0x40d0f4
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret