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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4a4290
push eax
mov eax, dword [ebp + 8]
mov dword fs:[0], esp
sub esp, 0x144
cmp dword [eax], 0x100
push ebx
push esi
push edi
mov edi, ecx
jg 0x407882
cmp dword [ebp + 0x38], 0
je 0x4073c5
cmp byte [edi + 0x825], 1
je 0x407882
xor ebx, ebx
mov byte [ebp - 0x15], bl
cmp byte [ebp + 0x28], bl
jne 0x40743f
lea eax, [ebx + 8]
call fcn.00479d20
mov eax, dword [ebp + 0x20]
mov ebx, esp
push 0
sub esp, 8
mov dword [ebp - 0x24], ebx
mov ecx, esp
mov dword [ecx], eax
mov ax, word [ebp + 0x24]
mov word [ecx + 4], ax
mov ecx, edi
call fcn.00408dd0
cmp eax, 0xffffffff
je 0x407427
mov ecx, dword [edi + 0x334]
imul edx, eax, 0x7f2
mov ecx, dword [edx + ecx + 0x7ee]
cmp ecx, 1
je 0x407427
cmp ecx, 2
je 0x407427
cmp ecx, 3
je 0x407427
mov dword [ebx], eax
mov ebx, 1
jmp 0x40749d
cmp dword [edi + 0x826], 0
je 0x407882
mov byte [ebp - 0x15], 1
mov ebx, 1
jmp 0x40749d
movzx esi, word [edi + 7]
lea eax, [esi*4]
call fcn.00479670
xor ecx, ecx
mov dword [ebp - 0x24], esp
test esi, esi
je 0x407882
xor esi, esi
nop
mov edx, dword [edi + 0x334]
cmp byte [edx + esi], 0
je 0x407486
mov eax, dword [edx + esi + 1]
cmp eax, dword [ebp + 0x20]
jne 0x407480
mov ax, word [edx + esi + 5]
cmp ax, word [ebp + 0x24]
je 0x407486
mov eax, esp
mov dword [eax + ebx*4], ecx
inc ebx
movzx eax, word [edi + 7]
inc ecx
add esi, 0x7f2
cmp ecx, eax
jb 0x407460
test ebx, ebx
je 0x407882
lea eax, [ebp - 0x13b]
mov dword [ebp - 0x14c], 0
mov dword [ebp - 0x148], 0x800
mov dword [ebp - 0x144], 0
mov dword [ebp - 0x140], eax
mov byte [ebp - 0x13c], 1
mov eax, dword [ebp + 0x18]
mov dword [ebp - 4], 0
mov dword [ebp - 0x20], 0
test ebx, ebx
je 0x40771d
cmp byte [ebp + 0x2c], 0
mov esi, dword [ebp + 0x10]
mov byte [ebp - 0x14], 0x14
mov dword [ebp - 0x28], esi
je 0x407642
mov byte [ebp - 0x1c], 0x28
nop
push 1
push 8
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x14c], 0
push eax
lea ecx, [ebp - 0x14c]
call fcn.004022e0
cmp byte [0x5e6940], 0
jne 0x407538
push 0x5e6944
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov byte [0x5e6940], 1
lea eax, [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
push 0
push 0x3e8
push dword [ebp - 0x2c]
push dword [ebp - 0x30]
call fcn.004796a0
push dword [0x5e6948]
push dword [0x5e6944]
push edx
push eax
call fcn.004a1970
push 1
mov dword [ebp + 0x2c], eax
lea ecx, [ebp - 0x14c]
push 0x20
lea eax, [ebp + 0x2c]
push eax
call fcn.004022e0
push 1
push 8
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x14c]
call fcn.004022e0
mov ecx, dword [ebp + 8]
push 1
push 8
mov al, byte [ecx]
lea ecx, [ebp - 0x14c]
mov byte [ebp + 0x2c], al
lea eax, [ebp + 0x2c]
push eax
call fcn.004022e0
push ecx
push 0x20
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp - 0x14c]
call fcn.00402380
test esi, esi
je 0x4075d4
push 0
push esi
push dword [ebp + 0xc]
lea ecx, [ebp - 0x14c]
call fcn.004022e0
jmp 0x4075ed
push ecx
push 0x20
lea eax, [ebp + 0x2c]
mov dword [ebp + 0x2c], 0
push eax
lea ecx, [ebp - 0x14c]
call fcn.00402380
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x24]
mov esi, dword [edi]
push 0
sub esp, 8
imul edx, dword [ecx + eax*4], 0x7f2
mov ecx, esp
push dword [ebp + 0x1c]
add edx, dword [edi + 0x334]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
mov eax, dword [edx + 1]
mov dword [ecx], eax
mov ax, word [edx + 5]
mov word [ecx + 4], ax
lea eax, [ebp - 0x14c]
push eax
mov ecx, edi
call dword [esi + 0x30]
mov eax, dword [ebp - 0x20]
mov esi, dword [ebp + 0x10]
inc eax
mov dword [ebp - 0x20], eax
cmp eax, ebx
jb 0x407500
jmp 0x40771a
mov dword [ebp - 0x20], 0
nop dword [eax]
push 1
push 8
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14c], 0
push eax
lea ecx, [ebp - 0x14c]
call fcn.004022e0
mov ecx, dword [ebp + 8]
push 1
push 8
mov al, byte [ecx]
lea ecx, [ebp - 0x14c]
mov byte [ebp + 0x2c], al
lea eax, [ebp + 0x2c]
push eax
call fcn.004022e0
push ecx
push 0x20
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp - 0x14c]
call fcn.00402380
test esi, esi
je 0x4076b1
push 0
push esi
push dword [ebp + 0xc]
lea ecx, [ebp - 0x14c]
call fcn.004022e0
jmp 0x4076ca
push ecx
push 0x20
lea eax, [ebp + 0x2c]
mov dword [ebp + 0x2c], 0
push eax
lea ecx, [ebp - 0x14c]
call fcn.00402380
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x24]
mov esi, dword [edi]
push 0
sub esp, 8
imul edx, dword [ecx + eax*4], 0x7f2
mov ecx, esp
push dword [ebp + 0x1c]
add edx, dword [edi + 0x334]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
mov eax, dword [edx + 1]
mov dword [ecx], eax
mov ax, word [edx + 5]
mov word [ecx + 4], ax
lea eax, [ebp - 0x14c]
push eax
mov ecx, edi
call dword [esi + 0x30]
mov eax, dword [ebp - 0x20]
mov esi, dword [ebp + 0x10]
inc eax
mov dword [ebp - 0x20], eax
cmp eax, ebx
jb 0x407650
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0x38]
test ecx, ecx
je 0x407859
mov dx, word [ebp + 0x24]
mov ebx, dword [ebp + 0x28]
mov byte [edi + 0x825], 1
mov dword [edi + 0x81a], ecx
mov ecx, dword [ebp + 0x20]
mov dword [edi + 0x81e], ecx
mov word [edi + 0x822], dx
mov byte [edi + 0x824], bl
cmp eax, 6
jne 0x4077a0
cmp ecx, 0xffffffff
jne 0x407776
mov eax, 0xffff
cmp dx, ax
jne 0x407776
call fcn.004031c0
lea ebx, [eax + 0x5dc]
mov eax, dword [ebp + 0x18]
jmp 0x4077a3
mov eax, dword [edi]
sub esp, 8
mov ecx, esp
mov edx, dword [eax + 0x7c]
mov eax, dword [ebp + 0x20]
mov dword [ecx], eax
mov ax, word [ebp + 0x24]
mov word [ecx + 4], ax
mov ecx, edi
call edx
lea ebx, [eax + eax*2]
call fcn.004031c0
add ebx, eax
mov eax, dword [ebp + 0x18]
jmp 0x4077a3
mov ebx, dword [ebp + 0x2c]
cmp byte [edi + 0x825], 0
je 0x407852
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
cmp eax, 8
je 0x407813
cmp eax, 9
je 0x407813
cmp eax, 0xa
je 0x407813
cmp byte [0x5e6940], 0
jne 0x4077e0
push 0x5e6944
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov byte [0x5e6940], 1
lea eax, [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
push 0
push 0x3e8
push dword [ebp - 0x2c]
push dword [ebp - 0x30]
call fcn.004796a0
push dword [0x5e6948]
push dword [0x5e6944]
push edx
push eax
call fcn.004a1970
cmp eax, ebx
jae 0x407852
push 0x1e
call esi
cmp byte [ebp - 0x15], 0
jne 0x40783d
push dword [ebp + 0x28]
mov eax, dword [ebp + 0x20]
sub esp, 8
mov ecx, esp
mov dword [ecx], eax
mov ax, word [ebp + 0x24]
mov word [ecx + 4], ax
mov ecx, edi
call fcn.0040a5c0
test al, al
je 0x40784e
cmp byte [edi + 0x825], 0
je 0x407852
mov eax, dword [ebp + 0x18]
jmp 0x4077b6
xor bl, bl
jmp 0x40785b
mov byte [edi + 0x825], 0
mov bl, 1
cmp byte [ebp - 0x13c], 0
je 0x40787e
cmp dword [ebp - 0x148], 0x800
jle 0x40787e
push dword [ebp - 0x140]
call fcn.00480cf1
add esp, 4
mov al, bl
jmp 0x407884
xor al, al
lea esp, [ebp - 0x15c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x34