Function at 0x40d580
Capabilities:
Access peb ldr_data

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x721926
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x78
push ebx
push esi
push edi
mov edi, ecx
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x18], edi
mov ax, word [ecx]
cmp ax, 0x20
jg 0x40d5b5
xor esi, esi
xor ebx, ebx
jmp 0x40d5dc
cmp ax, 0x40
jg 0x40d5c4
mov dword [ebp - 0x10], 4
jmp 0x40d5d7
xor edx, edx
cmp ax, 0x80
setg dl
dec edx
and edx, 0xfffffffc
add edx, 0xc
mov dword [ebp - 0x10], edx
mov ebx, dword [ebp - 0x10]
xor esi, esi
mov ax, word [ecx + 2]
cmp ax, 0x20
jg 0x40d5ea
xor eax, eax
jmp 0x40d605
cmp ax, 0x40
jg 0x40d5f7
mov eax, 1
jmp 0x40d605
xor ecx, ecx
cmp ax, 0x80
setg cl
add ecx, 2
mov eax, ecx
add ebx, eax
mov dword [ebp - 0x10], ebx
call dword [sym.imp.WINMM.dll_timeGetTime]
mov edx, dword [0x76d920]
lea ecx, [ebx + ebx*2 + 0x63]
shr edx, 2
sub eax, edx
lea edx, [edi + ecx*4]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x14], edx
jmp 0x40d632
mov eax, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x10]
xor esi, esi
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx]
mov edi, dword [edx]
cmp edi, edx
je 0x40d65f
mov esi, dword [edi + 0x20]
mov ecx, dword [edi + 0x24]
cmp esi, ecx
je 0x40d657
cmp dword [esi + 8], eax
jb 0x40d8c7
add esi, 0x24
cmp esi, ecx
jne 0x40d647
mov edi, dword [edi]
cmp edi, edx
jne 0x40d63d
xor esi, esi
mov dl, byte [ebp + 0xb]
mov dword [ebp - 0x6c], esi
mov byte [ebp - 0x70], dl
mov dword [ebp - 0x68], esi
mov dword [ebp - 0x64], esi
mov ecx, dword [ebp - 0x18]
lea eax, [ebx + ebx*2]
lea edx, [ebp - 0x84]
mov dword [ebp - 4], esi
lea ecx, [ecx + eax*4 + 0x188]
push edx
mov eax, dword [ecx + 4]
push eax
lea eax, [ebp - 0x20]
push eax
call fcn.00414060
mov ecx, dword [ebp - 0x68]
mov edx, dword [ebp - 0x6c]
push ecx
push edx
lea ecx, [ebp - 0x70]
mov dword [ebp - 4], 0xffffffff
call fcn.00413e30
mov eax, dword [ebp - 0x6c]
push eax
call fcn.006ffa16
mov ecx, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov dword [ebp - 0x6c], esi
mov dword [ebp - 0x68], esi
mov eax, dword [ecx]
mov dword [ebp - 0x64], esi
add esp, 4
mov esi, dword [eax + 4]
mov eax, dword [edi + 0x250]
test eax, eax
jne 0x40d71b
push 0x128
call fcn.0070dddb
add esp, 4
mov dword [ebp - 0x24], eax
test eax, eax
mov dword [ebp - 4], 2
je 0x40d70d
push 0
push 0x100
push 0x100
mov ecx, eax
call fcn.00416f10
mov dword [ebp - 4], 0xffffffff
mov dword [esi + 8], eax
jmp 0x40d758
xor eax, eax
mov dword [ebp - 4], 0xffffffff
mov dword [esi + 8], eax
jmp 0x40d758
mov eax, dword [edi + 0x24c]
mov edx, dword [eax + 4]
mov eax, dword [edx + 8]
mov dword [esi + 8], eax
mov ecx, dword [edi + 0x24c]
mov eax, dword [ecx + 4]
push eax
mov edx, dword [eax + 4]
mov ecx, dword [eax]
mov dword [edx], ecx
mov edx, dword [eax]
mov ecx, dword [eax + 4]
mov dword [edx + 4], ecx
call fcn.006ffa16
mov eax, dword [edi + 0x250]
add esp, 4
dec eax
mov dword [edi + 0x250], eax
mov ecx, dword [esi + 8]
push 0
push 0
mov edx, dword [ecx]
call dword [edx + 8]
mov eax, dword [ebx*8 + 0x765990]
lea edi, [ebp - 0x58]
mov dword [esi + 0x14], eax
mov eax, 0x100
cdq
idiv dword [esi + 0x14]
mov ecx, dword [ebx*8 + 0x765994]
mov dword [esi + 0x18], ecx
mov ebx, eax
mov eax, 0x100
cdq
idiv ecx
mov ecx, 9
mov dword [esi + 0xc], ebx
mov edx, eax
xor eax, eax
mov dword [esi + 0x10], edx
imul edx, ebx
rep stosd dword es:[edi], eax
mov ecx, dword [esi + 0x20]
lea edi, [esi + 0x1c]
test ecx, ecx
mov ebx, edx
jne 0x40d7b2
xor edx, edx
jmp 0x40d7c8
mov edx, dword [edi + 8]
mov eax, 0x38e38e39
sub edx, ecx
imul edx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp edx, ebx
jae 0x40d7fe
test ecx, ecx
jne 0x40d7d4
xor edx, edx
jmp 0x40d7ea
mov edx, dword [edi + 8]
mov eax, 0x38e38e39
sub edx, ecx
imul edx
sar edx, 3
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
mov ecx, dword [edi + 8]
lea eax, [ebp - 0x58]
sub ebx, edx
push eax
push ebx
push ecx
mov ecx, edi
call fcn.00413b40
jmp 0x40d841
test ecx, ecx
je 0x40d841
mov edx, dword [edi + 8]
mov eax, 0x38e38e39
sub edx, ecx
imul edx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp ebx, edx
jae 0x40d841
mov eax, dword [edi + 8]
lea edx, [ebx + ebx*8]
lea ecx, [ecx + edx*4]
push ecx
push eax
push eax
call fcn.004153f0
add esp, 0xc
mov ebx, eax
mov eax, dword [edi + 8]
mov ecx, edi
push eax
push ebx
call fcn.00413e30
mov dword [edi + 8], ebx
mov eax, dword [esi + 0x10]
xor edi, edi
test eax, eax
jle 0x40d62a
mov eax, dword [esi + 0xc]
xor ecx, ecx
test eax, eax
jle 0x40d8ba
mov edx, dword [esi + 0x14]
imul eax, edi
imul edx, ecx
mov ebx, dword [esi + 0x20]
add eax, ecx
lea eax, [eax + eax*8]
shl eax, 2
mov dword [eax + ebx + 0x1c], edx
mov edx, dword [esi + 0x18]
imul edx, edi
mov ebx, dword [esi + 0x20]
mov dword [eax + ebx + 0x20], edx
mov edx, dword [esi + 0x20]
add edx, eax
mov ebx, dword [edx + 0x1c]
mov dword [ebp - 0x2c], ebx
xor ebx, ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x30], ebx
fild qword [ebp - 0x2c]
fmul dword [0x7366a0]
fstp dword [edx + 0xc]
mov edx, dword [esi + 0x20]
add eax, edx
inc ecx
mov edx, dword [eax + 0x20]
mov dword [ebp - 0x34], edx
fild qword [ebp - 0x34]
fmul dword [0x7366a0]
fstp dword [eax + 0x10]
mov eax, dword [esi + 0xc]
cmp ecx, eax
jl 0x40d857
mov eax, dword [esi + 0x10]
inc edi
cmp edi, eax
jl 0x40d84e
jmp 0x40d62a
mov eax, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
mov dword [esi], eax
mov dword [esi + 4], ebx
cmp dword [0x80fe3c], 0xa
je 0x40d90a
movsx ecx, word [eax]
add ecx, dword [esi + 0x1c]
mov dword [ebp - 0x34], ecx
xor ecx, ecx
mov dword [ebp - 0x30], ecx
fild qword [ebp - 0x34]
mov dword [ebp - 0x30], ecx
fmul dword [0x7366a0]
fstp dword [esi + 0x14]
movsx edx, word [eax + 2]
add edx, dword [esi + 0x20]
mov dword [ebp - 0x34], edx
fild qword [ebp - 0x34]
jmp 0x40d98a
mov cx, word [eax]
cmp cx, 0x40
jle 0x40d937
mov edx, dword [esi + 0x1c]
movsx ecx, cx
add ecx, edx
xor edx, edx
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x30], edx
fild qword [ebp - 0x34]
fmul dword [0x7366a0]
fsub dword [0x7366ec]
fstp dword [esi + 0x14]
jmp 0x40d957
movsx edx, cx
mov ecx, dword [esi + 0x1c]
mov dword [ebp - 0x30], 0
add edx, ecx
mov dword [ebp - 0x34], edx
xor edx, edx
fild qword [ebp - 0x34]
fmul dword [0x7366a0]
fstp dword [esi + 0x14]
mov cx, word [eax + 2]
cmp cx, 0x40
movsx ecx, cx
jle 0x40d97e
add ecx, dword [esi + 0x20]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x34], ecx
fild qword [ebp - 0x34]
fmul dword [0x7366a0]
fsub dword [0x7366ec]
jmp 0x40d990
add ecx, dword [esi + 0x20]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x34], ecx
fild qword [ebp - 0x34]
fmul dword [0x7366a0]
fstp dword [esi + 0x18]
mov edx, dword [edi + 0x18]
mov ecx, dword [esi + 0x20]
push ebx
push eax
mov eax, dword [edi + 0x14]
push edx
mov edx, dword [esi + 0x1c]
push eax
push ecx
mov ecx, dword [edi + 8]
push edx
call fcn.00417690
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [esi + 8], eax
mov dword [edi + 0x30], eax
mov eax, dword [ebp + 0x10]
mov ecx, dword [esi + 0xc]
mov dword [eax + 0xc], ecx
mov edx, dword [esi + 0x10]
mov dword [eax + 0x10], edx
mov ecx, dword [esi + 0x14]
mov dword [eax + 0x14], ecx
mov edx, dword [esi + 0x18]
mov ecx, dword [ebp - 0xc]
mov dword [eax + 0x18], edx
mov eax, dword [edi + 8]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 0xc