Function at 0x402059
Capabilities:
Check for time delay via queryperformancecounter

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
cmp dword [ebp + 0x10], 1
jae 0x40206c
xor eax, eax
jmp 0x4022f6
mov eax, dword [0x40803c]
imul eax, dword [0x408040]
mov ecx, dword [0x408040]
imul ecx, ecx, 5
sub eax, ecx
mov dword [0x40803c], eax
mov edx, dword [ebp + 8]
mov al, byte [edx]
mov byte [ebp - 0x18], al
push 0x40f320
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov dword [ebp - 0x14], 1
mov ecx, dword [0x40803c]
imul ecx, dword [0x408040]
mov edx, dword [0x408040]
imul edx, edx, 5
sub ecx, edx
mov dword [0x40803c], ecx
mov eax, dword [0x40803c]
imul eax, eax, 0x63
mov dword [0x40803c], eax
mov dword [ebp - 0x10], 0
mov ecx, dword [0x408040]
imul ecx, dword [0x408040]
sub ecx, 3
mov dword [0x40803c], ecx
mov edx, dword [0x408040]
shl edx, 1
mov dword [0x40803c], edx
mov eax, dword [ebp + 8]
add eax, dword [ebp - 0x14]
mov cl, byte [eax]
mov byte [ebp - 4], cl
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 4]
and eax, 0xff
mov ecx, dword [ebp - 0x18]
and ecx, 0xff
cmp eax, ecx
jne 0x40227f
mov edx, dword [ebp + 8]
add edx, dword [ebp - 0x14]
xor eax, eax
mov al, byte [edx]
test eax, eax
jne 0x402173
mov ecx, dword [0x40803c]
sub ecx, 4
mov dword [0x408040], ecx
mov edx, dword [0x408040]
add edx, 7
mov dword [0x40803c], edx
mov eax, dword [ebp + 0xc]
add eax, dword [ebp - 0x10]
mov cl, byte [ebp - 0x18]
mov byte [eax], cl
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
jmp 0x40227d
mov ecx, dword [ebp + 8]
add ecx, dword [ebp - 0x14]
push ecx
lea edx, [ebp - 8]
push edx
call fcn.004022fa
add esp, 8
mov ecx, dword [ebp - 0x14]
add ecx, eax
mov dword [ebp - 0x14], ecx
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp + 8]
add edx, dword [ebp - 0x14]
push edx
lea eax, [ebp - 0xc]
push eax
call fcn.004022fa
add esp, 8
mov ecx, dword [ebp - 0x14]
add ecx, eax
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], 0
jmp 0x4021c3
mov edx, dword [ebp - 0x1c]
add edx, 1
mov dword [ebp - 0x1c], edx
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 8]
jae 0x40227d
mov ecx, dword [0x40803c]
imul ecx, dword [0x408040]
mov edx, dword [0x408040]
imul edx, edx, 5
sub ecx, edx
mov dword [0x40803c], ecx
mov eax, dword [0x408040]
add eax, 7
mov dword [0x40803c], eax
mov ecx, dword [0x408040]
shl ecx, 3
mov dword [0x408040], ecx
mov edx, dword [ebp - 0x10]
sub edx, dword [ebp - 0xc]
mov eax, dword [ebp + 0xc]
add eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 0xc]
mov dl, byte [ecx + edx]
mov byte [eax], dl
mov eax, dword [0x408040]
xor edx, edx
mov ecx, 0xc
div ecx
mov dword [0x408040], eax
mov edx, dword [0x408040]
shl edx, 3
mov dword [0x408040], edx
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov eax, dword [0x408040]
xor edx, edx
mov ecx, 0xc
div ecx
mov dword [0x408040], eax
mov edx, dword [0x40803c]
imul edx, dword [0x408040]
mov eax, dword [0x408040]
imul eax, eax, 5
sub edx, eax
mov dword [0x40803c], edx
jmp 0x4021ba
jmp 0x4022c6
mov ecx, dword [0x40803c]
mov edx, dword [0x408040]
lea eax, [edx + ecx - 9]
mov dword [0x40803c], eax
mov ecx, dword [0x408040]
shl ecx, 3
mov dword [0x408040], ecx
mov edx, dword [0x40803c]
imul edx, edx, 0x63
mov dword [0x40803c], edx
mov eax, dword [ebp + 0xc]
add eax, dword [ebp - 0x10]
mov cl, byte [ebp - 4]
mov byte [eax], cl
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp + 0x10]
jb 0x4020d4
mov ecx, dword [0x408040]
imul ecx, dword [0x408040]
sub ecx, 3
mov dword [0x40803c], ecx
push 0x40f320
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov eax, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret