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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xac
mov ecx, dword [ebp + 0x18]
xor edx, edx
push ebx
push esi
movsx eax, word [ecx + 0x24]
cmp eax, edx
push edi
mov dword [esp + 0x2c], edx
mov dword [esp + 0x24], edx
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], eax
jne 0x49ada3
mov eax, dword [ebp + 0x1c]
mov dword [esp + 0x18], eax
mov esi, dword [ebp + 0xc]
mov ebx, dword [esi + 0x18]
mov eax, dword [esi]
mov edi, dword [esi + 4]
sub ebx, eax
mov eax, dword [esi + 0x1c]
mov dword [esp + 0xc], ebx
sub eax, edi
movsx edi, word [ecx + 0x14]
mov dword [esp + 0x14], eax
lea edi, [edi + edi*4]
shl edi, 1
cmp edi, 0x3e8
mov dword [esp + 0x1c], edi
jg 0x49addc
cmp edi, edx
jge 0x49ade8
mov dword [esp + 0x1c], edx
jmp 0x49ade4
mov dword [esp + 0x1c], 0x3e8
mov edi, dword [esp + 0x1c]
fild dword [esp + 0x1c]
fst qword [esp + 0xb0]
fild dword [esp + 0xc]
fmul st(1)
fmul qword [0x51c3c8]
call sub.MSVCRT.dll__ftol
fild dword [esp + 0x14]
mov dword [esp + 0x28], eax
fmul st(1)
fmul qword [0x51c3c8]
call sub.MSVCRT.dll__ftol
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x40], eax
neg ecx
neg eax
lea edx, [ebx + ecx*2]
mov ecx, dword [esp + 0x14]
mov ebx, dword [ebp + 8]
mov dword [esp + 0xc], edx
lea edx, [ecx + eax*2]
push 0
mov eax, dword [ebx]
push 0
push 6
mov ecx, ebx
fstp st(0)
mov dword [esp + 0x20], edx
call dword [eax + 0x188]
test eax, eax
je 0x49aee8
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x14]
mov dword [esp + 0xa8], ecx
xor eax, eax
mov dword [esp + 0xac], edx
lea ecx, [esp + 0x50]
lea edx, [esp + 0xa0]
mov dword [esp + 0xa0], eax
mov dword [esp + 0xa4], eax
mov eax, dword [ebx]
push ecx
push edx
push 2
mov ecx, ebx
call dword [eax + 0xd4]
mov eax, dword [esp + 0x5c]
mov edx, dword [esp + 0x54]
mov ecx, dword [esp + 0x58]
sub eax, edx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x50]
fild dword [esp + 0x20]
sub esp, 8
sub ecx, eax
mov dword [esp + 0x28], ecx
fstp qword [esp]
fild dword [esp + 0x28]
sub esp, 8
fstp qword [esp]
call dword [sym.imp.MSVCRT.dll__hypot]
add esp, 0x10
call sub.MSVCRT.dll__ftol
cmp eax, dword [esp + 0x18]
jge 0x49aee8
cmp eax, 2
mov dword [esp + 0x18], 2
jl 0x49aee8
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0x20]
mov edx, dword [esp + 0x18]
test ecx, ecx
mov word [eax + 0x24], dx
je 0x49af1b
mov ebx, dword [ebp + 0x24]
push ebx
push 0
push ecx
push edx
push eax
push 0
call dword [sym.imp.CRLCLR110.dll_int___cdecl_CMGMakeInterColorSpecsEx_int__struct_CGE_FOUNTAINFILL___int__struct_CLR_BUFFERS___unsigned_short_int___class_WAppColorInfo__]
mov ebx, eax
add esp, 0x18
test ebx, ebx
je 0x49af45
mov edx, dword [ebp + 0x20]
mov eax, dword [edx]
jmp 0x49af41
mov ecx, dword [ebp + 0x24]
push ecx
lea ecx, [esp + 0x30]
push ecx
push edx
push eax
push 0
call dword [sym.imp.CRLCLR110.dll_int___cdecl_CMGMakeInterColorSpecs_int__struct_CGE_FOUNTAINFILL___int__struct_HMEM______class_WAppColorInfo__]
mov ebx, eax
add esp, 0x14
test ebx, ebx
je 0x49af45
mov edx, dword [esp + 0x2c]
push edx
call sub.CRLUTL110.dll__MEMMANLock_4
mov dword [esp + 0x24], eax
mov ecx, dword [ebp + 0x18]
mov ax, word [esp + 0x10]
test ebx, ebx
mov word [ecx + 0x24], ax
je 0x49b296
fild dword [esp + 0x18]
fild dword [esp + 0xc]
mov edx, 0x1f4
mov ebx, dword [esi]
sub edx, edi
mov ecx, dword [esp + 0x28]
fdiv st(1)
shl edx, 1
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x40]
lea eax, [ebx + ecx]
mov dword [esp + 0x20], edi
mov dword [esp + 0x28], eax
mov eax, dword [esi + 4]
add eax, edx
mov dword [esp + 0xc], eax
mov eax, dword [esi + 8]
add eax, ecx
fstp qword [esp + 0x88]
fild dword [esp + 0x14]
mov dword [esp + 0x14], eax
mov eax, dword [esi + 0xc]
add eax, edx
fdiv st(1)
fstp qword [esp + 0x48]
fild dword [esp + 0x10]
mov dword [esp + 0x10], eax
fdiv st(1)
fstp qword [esp + 0xa0]
fstp st(0)
fild dword [esp + 0x28]
fst qword [esp + 0x50]
fadd qword [esp + 0x88]
call sub.MSVCRT.dll__ftol
fild dword [esp + 0xc]
mov dword [esp + 0x78], eax
fst qword [esp + 0x30]
fadd qword [esp + 0x48]
call sub.MSVCRT.dll__ftol
fild dword [esp + 0x14]
mov dword [esp + 0x7c], eax
fst qword [esp + 0x38]
fadd qword [esp + 0x88]
call sub.MSVCRT.dll__ftol
fild dword [esp + 0x10]
mov dword [esp + 0x70], eax
fst qword [esp + 0x40]
fadd qword [esp + 0x48]
call sub.MSVCRT.dll__ftol
mov dword [esp + 0x74], eax
mov eax, dword [ebp + 0x10]
cmp eax, edi
jg 0x49b05f
mov ecx, dword [esi + 8]
mov eax, dword [esi + 4]
mov dword [esp + 0x68], ecx
mov ecx, dword [esi + 0xc]
mov dword [esp + 0x64], eax
mov dword [esp + 0x84], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x6c], ecx
mov ecx, dword [ebp + 8]
push eax
lea eax, [esp + 0x64]
push 5
mov edx, dword [ecx]
push eax
mov dword [esp + 0x6c], ebx
mov dword [esp + 0x8c], ebx
call dword [edx + pe_nt_image_headers32]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x50]
mov edx, dword [esp + 0x54]
mov dword [esp + 0x90], eax
mov eax, dword [esp + 0x3c]
mov edi, dword [esp + 0x28]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0xb0]
mov ebx, dword [esp + 0xc]
mov dword [esp + 0x98], ecx
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x9c], edx
mov edx, dword [esp + 0x38]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x94], ecx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x38], edx
mov edx, dword [esp + 0x44]
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x30], ecx
mov ecx, dword [esp + 0xb4]
mov dword [esp + 0x34], edx
mov edx, dword [esp + 0x14]
cmp eax, 1
mov dword [esp + 0x54], ecx
mov dword [esp + 0x60], edi
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], edx
mov dword [esp + 0x80], edi
mov dword [esp + 0x84], ebx
jl 0x49b237
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], ecx
fld qword [esp + 0x98]
fadd qword [esp + 0x88]
fst qword [esp + 0x98]
fadd qword [esp + 0x88]
call sub.MSVCRT.dll__ftol
fld qword [esp + 0x90]
fadd qword [esp + 0x48]
mov dword [esp + 0x78], eax
fst qword [esp + 0x90]
fadd qword [esp + 0x48]
call sub.MSVCRT.dll__ftol
fld qword [esp + 0x38]
fadd qword [esp + 0x88]
mov dword [esp + 0x7c], eax
fst qword [esp + 0x38]
fadd qword [esp + 0x88]
call sub.MSVCRT.dll__ftol
fld qword [esp + 0x30]
fadd qword [esp + 0x48]
mov dword [esp + 0x70], eax
fst qword [esp + 0x30]
fadd qword [esp + 0x48]
call sub.MSVCRT.dll__ftol
fld qword [esp + 0x50]
fadd qword [esp + 0xa0]
mov dword [esp + 0x74], eax
fst qword [esp + 0x50]
call sub.MSVCRT.dll__ftol
mov ecx, dword [ebp + 0x10]
mov dword [esp + 0x40], eax
cmp ecx, eax
jg 0x49b1c5
mov edx, dword [esp + 0x20]
mov eax, dword [ebp + 0x14]
cmp eax, edx
jl 0x49b1c5
mov edx, dword [esp + 0xc]
mov ecx, dword [ebp + 8]
push edx
lea edx, [esp + 0x64]
mov eax, dword [ecx]
push 5
push edx
call dword [eax + pe_nt_image_headers32]
fld qword [esp + 0x98]
call sub.MSVCRT.dll__ftol
fld qword [esp + 0x90]
mov edi, eax
mov dword [esp + 0x60], edi
call sub.MSVCRT.dll__ftol
fld qword [esp + 0x38]
mov ebx, eax
mov dword [esp + 0x64], ebx
call sub.MSVCRT.dll__ftol
fld qword [esp + 0x30]
mov dword [esp + 0x68], eax
call sub.MSVCRT.dll__ftol
mov ecx, dword [esp + 0xc]
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x40]
add ecx, 0xc
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x80], edi
mov dword [esp + 0x84], ebx
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], eax
jne 0x49b108
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov ecx, 0x3e8
sub ecx, edx
mov edx, dword [ebp + 0x14]
cmp edx, ecx
jl 0x49b291
mov edx, dword [esi + 0x18]
mov ecx, dword [esi + 0x1c]
mov dword [esp + 0x78], edx
mov edx, dword [esi + 0x10]
mov dword [esp + 0x7c], ecx
mov ecx, dword [esi + 0x14]
mov esi, dword [esp + 0x24]
lea eax, [eax + eax*2]
mov dword [esp + 0x74], ecx
mov ecx, dword [ebp + 8]
lea eax, [esi + eax*4 - 0xc]
mov dword [esp + 0x70], edx
mov edx, dword [ecx]
push eax
lea eax, [esp + 0x64]
push 5
push eax
mov dword [esp + 0x8c], edi
mov dword [esp + 0x90], ebx
call dword [edx + pe_nt_image_headers32]
mov ebx, 1
mov eax, dword [ebp + 0x20]
test eax, eax
jne 0x49b2b5
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x49b2b5
push eax
call sub.CRLUTL110.dll__MEMMANUnlock_4
mov ecx, dword [esp + 0x2c]
push ecx
call sub.CRLUTL110.dll__MEMMANFree_4
pop edi
mov eax, ebx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret