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

Disassembly:
sub esp, 0x60
mov eax, dword [0x58605c]
xor eax, esp
mov dword [esp + 0x5c], eax
push ebx
push ebp
push esi
mov esi, edx
mov eax, dword [esi + 0x68]
push edi
mov edi, dword [esp + 0x74]
mov ebx, ecx
mov dword [esp + 0x44], edi
test al, 1
jne 0x40ecb5
push esi
mov ecx, str.Missing_IHDR_before_cHRM
call fcn.0040d490
add esp, 4
jmp 0x40ecef
test al, 4
je 0x40ece1
mov edx, str.Invalid_cHRM_after_IDAT
call fcn.0040d550
push ebx
mov ecx, esi
call fcn.0040df40
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x5c]
xor ecx, esp
call fcn.00413201
add esp, 0x60
ret
test al, 2
je 0x40ecef
mov edx, str.Missing_PLTE_before_cHRM
call fcn.0040d550
test edi, edi
je 0x40ed08
mov eax, dword [edi + 8]
test al, 4
je 0x40ed08
test eax, 0x800
jne 0x40ed08
mov edx, str.Duplicate_cHRM_chunk
jmp 0x40ecbe
cmp ebx, 0x20
je 0x40ed14
mov edx, str.Incorrect_cHRM_chunk_length
jmp 0x40ecbe
mov edi, 0x20
lea ebx, [esp + 0x4c]
call fcn.0040dee0
push 0
mov ecx, esi
call fcn.0040df40
add esp, 4
test eax, eax
jne 0x40f05a
movzx eax, byte [esp + 0x4c]
movzx ecx, byte [esp + 0x4d]
movzx edx, byte [esp + 0x4e]
shl eax, 8
add eax, ecx
movzx ecx, byte [esp + 0x4f]
shl eax, 8
add eax, edx
movzx edx, byte [esp + 0x51]
shl eax, 8
add eax, ecx
movzx ecx, byte [esp + 0x50]
shl ecx, 8
add ecx, edx
movzx edx, byte [esp + 0x52]
shl ecx, 8
add ecx, edx
movzx edx, byte [esp + 0x53]
shl ecx, 8
add ecx, edx
cmp eax, 0x13880
ja 0x40f050
cmp ecx, 0x13880
ja 0x40f050
lea edx, [ecx + eax]
cmp edx, 0x186a0
ja 0x40f050
mov dword [esp + 0x18], ecx
lea ecx, [esp + 0x54]
mov dword [esp + 0x1c], eax
call fcn.0040dde0
lea ecx, [esp + 0x58]
mov edi, eax
call fcn.0040dde0
lea ecx, [eax + edi]
cmp ecx, 0x186a0
jbe 0x40edd3
mov edx, str.Invalid_cHRM_red_point
jmp 0x40f055
lea ecx, [esp + 0x5c]
mov dword [esp + 0x28], edi
mov dword [esp + 0x20], eax
call fcn.0040dde0
lea ecx, [esp + 0x60]
mov edi, eax
call fcn.0040dde0
lea edx, [eax + edi]
cmp edx, 0x186a0
jbe 0x40ee04
mov edx, str.Invalid_cHRM_green_point
jmp 0x40f055
lea ecx, [esp + 0x64]
mov dword [esp + 0x3c], edi
mov dword [esp + 0x24], eax
call fcn.0040dde0
mov ebx, eax
lea ecx, [esp + 0x68]
mov dword [esp + 0x10], ebx
call fcn.0040dde0
mov ebp, eax
lea eax, [ebx + ebp]
mov dword [esp + 0x14], ebp
cmp eax, 0x186a0
jbe 0x40ee3e
mov edx, str.Invalid_cHRM_blue_point
jmp 0x40f055
fild dword [esp + 0x1c]
mov eax, dword [esp + 0x44]
fld qword [0x57c0e8]
fdiv st(1), st(0)
fxch st(1)
fstp dword [esp + 0x34]
fild dword [esp + 0x18]
fdiv st(1)
fstp dword [esp + 0x30]
fild dword [esp + 0x28]
fdiv st(1)
fstp dword [esp + 0x48]
fild dword [esp + 0x20]
fdiv st(1)
fstp dword [esp + 0x38]
fild dword [esp + 0x3c]
fdiv st(1)
fstp dword [esp + 0x40]
fild dword [esp + 0x24]
fdiv st(1)
fstp dword [esp + 0x2c]
fild dword [esp + 0x10]
fdiv st(1)
fstp dword [esp + 0x10]
fidivr dword [esp + 0x14]
fstp dword [esp + 0x14]
test eax, eax
je 0x40efc1
test dword [eax + 8], 0x800
je 0x40efc1
mov ecx, dword [esp + 0x1c]
add ecx, 0xffff89c2
cmp ecx, 0x7d0
ja 0x40ef37
mov edx, dword [esp + 0x18]
add edx, 0xffff8364
cmp edx, 0x7d0
ja 0x40ef37
mov eax, dword [esp + 0x28]
add eax, 0xffff09e8
cmp eax, 0x7d0
ja 0x40ef37
mov ecx, dword [esp + 0x20]
add ecx, 0xffff8300
cmp ecx, 0x7d0
ja 0x40ef37
add edi, 0xffff8eb8
cmp edi, 0x7d0
ja 0x40ef37
mov edx, dword [esp + 0x24]
add edx, 0xffff1988
cmp edx, 0x7d0
ja 0x40ef37
cmp ebx, 0x36b0
jl 0x40ef37
cmp ebx, 0x3e80
jg 0x40ef37
cmp ebp, 0x1388
jl 0x40ef37
cmp ebp, 0x1b58
jle 0x40f05a
mov edx, str.Ignoring_incorrect_cHRM_value_when_sRGB_is_also_present
call fcn.0040d550
fld dword [esp + 0x38]
sub esp, 0x20
fstp qword [esp + 0x18]
fld dword [esp + 0x68]
fstp qword [esp + 0x10]
fld dword [esp + 0x50]
fstp qword [esp + 8]
fld dword [esp + 0x54]
fstp qword [esp]
push str.wx_f__wy_f__rx_f__ry_f_n
call fcn.004137fc
add eax, 0x40
push eax
call fcn.00483bd5
fld dword [esp + 0x3c]
fstp qword [esp + 0x20]
add esp, 8
fld dword [esp + 0x30]
fstp qword [esp + 0x10]
fld dword [esp + 0x4c]
fstp qword [esp + 8]
fld dword [esp + 0x60]
fstp qword [esp]
push str.gx_f__gy_f__bx_f__by_f_n
call fcn.004137fc
add eax, 0x40
push eax
call fcn.00483bd5
add esp, 0x28
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x5c]
xor ecx, esp
call fcn.00413201
add esp, 0x60
ret
fld dword [esp + 0x14]
sub esp, 0x40
fstp qword [esp + 0x38]
mov edi, eax
fld dword [esp + 0x50]
mov eax, esi
fstp qword [esp + 0x30]
fld dword [esp + 0x6c]
fstp qword [esp + 0x28]
fld dword [esp + 0x80]
fstp qword [esp + 0x20]
fld dword [esp + 0x78]
fstp qword [esp + 0x18]
fld dword [esp + 0x88]
fstp qword [esp + 0x10]
fld dword [esp + 0x70]
fstp qword [esp + 8]
fld dword [esp + 0x74]
fstp qword [esp]
call fcn.00411f50
mov eax, dword [esp + 0x64]
mov ecx, dword [esp + 0x7c]
mov edx, dword [esp + 0x60]
push ebp
push ebx
push eax
mov eax, dword [esp + 0x74]
push ecx
mov ecx, dword [esp + 0x68]
push edx
mov edx, dword [esp + 0x70]
push eax
push ecx
push edx
push esi
mov eax, edi
call fcn.00412260
add esp, 0x64
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x5c]
xor ecx, esp
call fcn.00413201
add esp, 0x60
ret
mov edx, str.Invalid_cHRM_white_point
call fcn.0040d550
mov ecx, dword [esp + 0x6c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00413201
add esp, 0x60
ret