Function at 0x6166e0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x38
push edi
xor edi, edi
cmp dword [esi + 0x9c], edi
mov dword [esp + 8], 0xffffffff
jne 0x6166fd
xor eax, eax
pop edi
add esp, 0x38
ret
push 0xb32390
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x44], edi
je 0x61673c
cmp dword [0xb5a42c], edi
je 0x616727
movzx ecx, word [esi + 0x78]
imul ecx, dword [esi + 0x54]
mov dword [esp + 4], ecx
mov dword [esp + 0x10], ecx
jmp 0x616740
mov eax, dword [esi + 0x48]
mov ecx, dword [eax]
lea edx, [esp + 0x10]
push edx
lea edx, [esp + 8]
push edx
push eax
mov eax, dword [ecx + 0x10]
call eax
mov ecx, dword [esp + 4]
mov edx, dword [esi + 0x88]
cmp edx, 0xffffffff
je 0x616783
cmp dword [esi + 0x90], edi
jne 0x616783
mov eax, dword [esi + 0x8c]
cmp ecx, eax
jbe 0x616767
cmp eax, edx
ja 0x616765
cmp ecx, edx
jae 0x616771
cmp ecx, eax
jae 0x61677d
cmp eax, edx
jbe 0x616771
cmp ecx, edx
jb 0x61677d
mov dword [esi + 0x90], 1
jmp 0x616783
mov dword [esi + 0x8c], ecx
mov edx, dword [esi + 0x84]
push ebx
mov ebx, dword [esi + 0x98]
mov eax, edx
sub eax, ebx
jns 0x61679c
add eax, dword [esi + 0x80]
cmp eax, edx
jbe 0x6167aa
cmp eax, ecx
jbe 0x6167a8
cmp edx, ecx
jb 0x6167b4
cmp eax, edx
jae 0x6167cb
cmp eax, ecx
ja 0x6167b4
cmp edx, ecx
jae 0x6167cb
push 0xb32390
mov dword [esp + 0x10], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop ebx
mov eax, edi
pop edi
add esp, 0x38
ret
cmp eax, edx
jbe 0x6167df
cmp eax, ecx
jb 0x6167df
mov edx, dword [esi + 0x80]
sub edx, eax
add edx, ecx
jmp 0x6167e3
sub ecx, eax
mov edx, ecx
movzx ecx, word [esi + 0x14]
lea eax, [ebx + edx]
cdq
idiv ecx
push ebp
mov ebp, eax
cmp ebp, edi
jge 0x6167fd
mov dword [esp + 0x10], edi
jmp 0x616a5b
mov eax, dword [esi + 0x2c]
cmp ebp, eax
mov dword [esp + 0x14], edi
jle 0x616814
sub ebp, eax
mov dword [esp + 0x14], ebp
mov edi, dword [esp + 0x14]
mov ebp, eax
lea ebx, [edi + ebp]
imul ebx, ecx
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x2c]
push edx
lea eax, [esp + 0x34]
push eax
mov eax, dword [esi + 0x84]
lea ecx, [esp + 0x30]
push ecx
lea ecx, [esi + 0x44]
mov dword [esp + 0x2c], ebx
call fcn.00614210
add esp, 0x10
test eax, eax
jne 0x616a5b
xor edx, edx
cmp edi, edx
je 0x616891
cmp dword [esi + 0x88], 0xffffffff
jne 0x616891
movzx eax, word [esi + 0x14]
mov ecx, dword [esi + 0x84]
imul eax, ebp
add eax, ecx
mov ecx, dword [esi + 0x80]
cmp eax, ecx
mov dword [esi + 0x88], eax
jle 0x616881
sub eax, ecx
mov dword [esi + 0x88], eax
mov eax, dword [esp + 0xc]
mov dword [esi + 0x8c], eax
mov dword [esi + 0x90], edx
cmp dword [esi + 0x90], edx
je 0x6168b3
cmp ebp, edx
je 0x6168b3
mov dword [esi + 0x90], edx
mov dword [esi + 0x8c], edx
mov dword [esi + 0x88], 0xffffffff
mov ecx, dword [esi + 0x84]
mov eax, dword [esp + 0x2c]
sub dword [esi + 0x2c], ebp
cmp eax, edx
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x34], edx
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], ecx
je 0x61691b
cmp ebp, edx
je 0x61691b
movzx edi, word [esi + 0x14]
imul edi, ebp
cmp edi, eax
jbe 0x6168ed
mov edi, eax
mov edx, dword [esp + 0x24]
push 0
push edi
push edx
lea eax, [esi + 0x30]
push eax
call fcn.0057be32
movzx ecx, word [esi + 0x14]
mov eax, edi
xor edx, edx
div ecx
add dword [esp + 0x44], edi
sub dword [esp + 0x4c], edi
mov edi, dword [esp + 0x24]
add esp, 0x10
sub ebp, eax
xor edx, edx
mov eax, dword [esp + 0x40]
cmp eax, edx
je 0x61695d
cmp ebp, edx
je 0x61695d
movzx ebx, word [esi + 0x14]
imul ebx, ebp
cmp ebx, eax
jbe 0x616934
mov ebx, eax
mov eax, dword [esp + 0x38]
push edx
mov edx, dword [esp + 0x2c]
push ebx
add edx, eax
push edx
lea ecx, [esi + 0x30]
push ecx
call fcn.0057be32
mov eax, dword [esp + 0x50]
add dword [esp + 0x48], ebx
sub eax, ebx
add esp, 0x10
mov dword [esp + 0x40], eax
xor edx, edx
mov ecx, dword [esp + 0x3c]
cmp ecx, edx
je 0x6169c3
cmp edi, edx
je 0x6169c3
movzx ebp, word [esi + 0x14]
imul ebp, edi
cmp ebp, ecx
jbe 0x616976
mov ebp, ecx
movzx eax, word [esi + 0x16]
cmp eax, 8
je 0x616993
cmp eax, 0x10
jne 0x6169a9
mov eax, dword [esp + 0x34]
push ebp
push edx
mov edx, dword [esp + 0x2c]
add edx, eax
push edx
jmp 0x6169a1
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x34]
push ebp
push 0x7f
add ecx, edx
push ecx
call fcn.0057f8f2
add esp, 0xc
movzx ecx, word [esi + 0x14]
xor edx, edx
mov eax, ebp
div ecx
add dword [esp + 0x34], ebp
sub dword [esp + 0x3c], ebp
sub edi, eax
mov eax, dword [esp + 0x40]
xor edx, edx
cmp eax, edx
je 0x616a13
cmp edi, edx
je 0x616a13
movzx ebx, word [esi + 0x14]
imul ebx, edi
cmp ebx, eax
jbe 0x6169d8
mov ebx, eax
movzx eax, word [esi + 0x16]
cmp eax, 8
je 0x6169f5
cmp eax, 0x10
jne 0x616a0b
mov eax, dword [esp + 0x38]
push ebx
push edx
mov edx, dword [esp + 0x30]
add edx, eax
push edx
jmp 0x616a03
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x38]
push ebx
push 0x7f
add ecx, edx
push ecx
call fcn.0057f8f2
add esp, 0xc
add dword [esp + 0x38], ebx
sub dword [esp + 0x40], ebx
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x24]
push eax
push ecx
push edx
mov edx, dword [esp + 0x3c]
lea eax, [esi + 0x44]
call fcn.00614300
mov eax, dword [esp + 0x28]
add dword [esi + 0x84], eax
mov eax, dword [esi + 0x84]
mov ecx, dword [esi + 0x80]
add esp, 0xc
cmp eax, ecx
jl 0x616a53
sub eax, ecx
mov dword [esi + 0x84], eax
mov dword [esp + 0x10], 0
pop ebp
push 0xb32390
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0xc]
pop ebx
pop edi
add esp, 0x38
ret