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

Disassembly:
sub esp, 0xb8
push ebx
mov ebx, dword [esp + 0xc4]
mov eax, dword [ebx]
mov edx, dword [eax + 0x20]
push ebp
mov ebp, dword [esp + 0xcc]
push esi
push edi
xor esi, esi
push esi
push str.Generating_color_palette
mov ecx, ebx
call edx
mov edi, dword [ebp]
cmp dword [edi + 0x40], esi
je 0x4d5820
cmp dword [edi], 0xffffffff
je 0x4d5820
cmp dword [edi + 4], esi
jle 0x4d5820
cmp dword [edi + 8], esi
jg 0x4d5848
mov eax, dword [ebx]
mov edx, dword [eax + 0x1c]
push str.Invalid_source_image
mov ecx, ebx
call edx
mov eax, dword [esp + 0xcc]
mov dword [eax], 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 0xc
cmp dword [ebp + 8], 1
jne 0x4d5899
movzx eax, byte [ebp + 0xc]
mov edx, dword [ebp + 4]
push eax
mov esi, edi
lea eax, [esp + 0x84]
call fcn.004d4af0
mov ecx, dword [ebp + 0xd]
mov edi, dword [esp + 0xcc]
push ecx
push ebx
push edi
lea edx, [esp + 0x8c]
push edx
call fcn.004d5060
lea esi, [esp + 0x80]
call fcn.004d5b60
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 0xc
cmp byte [ebp + 0xc], 0
mov eax, dword [ebp + 4]
jne 0x4d58a9
cmp dword [edi], esi
jne 0x4d58a9
sub eax, 1
mov ecx, 0x70dfa4
mov dword [esp + 0x4b], eax
push esi
lea eax, [esp + 0x5c]
mov dword [esp + 0x3c], esi
mov dword [esp + 0x40], ecx
mov dword [esp + 0x47], esi
mov dword [esp + 0x4b], esi
mov dword [esp + 0x53], esi
mov dword [esp + 0x38], 0x70dfb8
mov dword [esp + 0x30], ecx
call fcn.004d2430
fldz
cmp dword [edi + 8], esi
fst dword [esp + 0x28]
fst dword [esp + 0x24]
mov dword [esp + 0x18], esi
fstp dword [esp + 0x20]
mov dword [esp + 0x1c], esi
jg 0x4d5a07
mov edi, dword [ebp + 0xd]
lea eax, [esp + 0x34]
call fcn.004cd640
mov eax, dword [esp + 0x18]
cmp eax, esi
jbe 0x4d59b8
test eax, eax
mov dword [esp + 0x54], eax
fild dword [esp + 0x54]
jge 0x4d5925
fadd dword [0x7236cc]
fld1
mov edi, dword [ebp + 0xd]
fdivrp st(1)
fld dword [esp + 0x28]
fnstcw word [esp + 0x18]
fmul st(1)
movzx eax, word [esp + 0x18]
or eax, 0xc00
mov dword [esp + 0x14], eax
fldcw word [esp + 0x14]
fistp dword [esp + 0x14]
mov dl, byte [esp + 0x14]
mov byte [esp + 0x1e], dl
lea edx, [esp + 0x1c]
push edx
fldcw word [esp + 0x1c]
fld dword [esp + 0x28]
fnstcw word [esp + 0x1c]
fmul st(1)
movzx eax, word [esp + 0x1c]
or eax, 0xc00
mov dword [esp + 0x18], eax
fldcw word [esp + 0x18]
fistp dword [esp + 0x18]
mov al, byte [esp + 0x18]
mov byte [esp + 0x21], al
fldcw word [esp + 0x1c]
fmul dword [esp + 0x24]
fnstcw word [esp + 0x1c]
movzx eax, word [esp + 0x1c]
or eax, 0xc00
mov dword [esp + 0x18], eax
fldcw word [esp + 0x18]
fistp dword [esp + 0x18]
mov cl, byte [esp + 0x18]
mov byte [esp + 0x20], cl
fldcw word [esp + 0x1c]
call fcn.0055aa70
mov edi, dword [esp + 0xcc]
mov dword [edi], esi
mov ecx, dword [esp + 0x47]
cmp ecx, esi
mov dword [esp + 0x34], 0x70dfac
je 0x4d59ec
mov eax, dword [ecx - 4]
push 0x57d580
lea esi, [ecx - 4]
push 4
call fcn.00407720
push esi
call fcn.0069c8fa
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 0xc
mov ebx, dword [esp + 0xd0]
mov eax, dword [ebx]
mov edx, dword [eax]
mov ecx, ebx
call edx
test al, al
jne 0x4d5b48
fild dword [esp + 0x1c]
mov eax, dword [ebx]
mov edx, dword [eax + 0x24]
sub esp, 8
fidiv dword [edi + 8]
mov ecx, ebx
fstp qword [esp]
call edx
xor ebx, ebx
cmp dword [edi + 4], esi
jle 0x4d5b2f
jmp 0x4d5a40
lea edx, [esp + 0x58]
lea ecx, [esp + 0x54]
call dword [esp + 0x78]
cmp byte [ebp + 0xc], 0
mov eax, dword [eax]
mov dword [esp + 0x14], eax
mov cl, byte [esp + 0x16]
jne 0x4d5aa1
cmp byte [esp + 0x17], 0
jne 0x4d5aa1
movzx edx, cl
add dword [esp + 0x18], 1
mov dword [esp + 0x14], edx
movzx edx, ah
fild dword [esp + 0x14]
mov dword [esp + 0x14], edx
fadd dword [esp + 0x28]
movzx edx, al
fstp dword [esp + 0x28]
fild dword [esp + 0x14]
mov dword [esp + 0x14], edx
fadd dword [esp + 0x24]
fstp dword [esp + 0x24]
fild dword [esp + 0x14]
fadd dword [esp + 0x20]
fstp dword [esp + 0x20]
mov byte [esp + 0x31], ah
mov byte [esp + 0x30], al
push esi
lea eax, [esp + 0x30]
mov byte [esp + 0x36], cl
push eax
lea ecx, [esp + 0x3c]
call fcn.0057d620
test al, al
je 0x4d5ac5
add dword [esp + 0x4f], 1
mov eax, dword [esp + 0x4b]
mov ecx, dword [esp + 0x4f]
lea edx, [eax + 0x100]
cmp ecx, edx
jbe 0x4d5aeb
add eax, 1
cmp ecx, eax
seta al
lea esi, [esp + 0x34]
push eax
call fcn.0055a950
xor esi, esi
mov ecx, dword [esp + 0x6c]
cmp ecx, dword [esp + 0x58]
jae 0x4d5b23
mov eax, dword [esp + 0x70]
mov ecx, dword [esp + 0x74]
add eax, dword [esp + 0x64]
add dword [esp + 0x6c], 1
add ecx, 1
cmp ecx, dword [esp + 0x5c]
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], ecx
jne 0x4d5b23
add eax, dword [esp + 0x60]
mov dword [esp + 0x74], esi
mov dword [esp + 0x70], eax
add ebx, 1
cmp ebx, dword [edi + 4]
jl 0x4d5a40
mov eax, dword [esp + 0x1c]
add eax, 1
cmp eax, dword [edi + 8]
mov dword [esp + 0x1c], eax
jl 0x4d5a00
jmp 0x4d58fb
mov edi, dword [esp + 0xcc]
mov dword [edi], 1
jmp 0x4d59c1