Function at 0x558540
Capabilities:
Terminate process

Disassembly:
sub esp, 0x14
push ebx
push esi
mov esi, ecx
mov ebx, eax
mov eax, dword [esi + 0x6c]
test al, 1
push edi
jne 0x55855d
mov edi, str.Missing_IHDR_before_pCAL
mov eax, esi
jmp fcn.0054c480
test al, 4
je 0x55857a
mov ecx, str.Invalid_pCAL_after_IDAT
call fcn.0054c4a0
pop edi
mov ecx, esi
pop esi
mov eax, ebx
pop ebx
add esp, 0x14
jmp fcn.00556840
mov eax, dword [esp + 0x24]
test eax, eax
je 0x5585a4
test dword [eax + 8], 0x400
je 0x5585a4
mov ecx, str.Duplicate_pCAL_chunk
call fcn.0054c4a0
pop edi
mov ecx, esi
pop esi
mov eax, ebx
pop ebx
add esp, 0x14
jmp fcn.00556840
mov ecx, dword [esi + 0x2a8]
test ecx, ecx
je 0x5585c9
mov eax, dword [esi + 0x240]
test eax, eax
push ecx
je 0x5585c1
push esi
call eax
add esp, 8
jmp 0x5585c9
call fcn.005d27e0
add esp, 4
lea ecx, [ebx + 1]
call fcn.005600d0
test eax, eax
mov dword [esi + 0x2a8], eax
jne 0x5585ec
mov ecx, str.No_memory_for_pCAL_purpose
call fcn.0054c4a0
pop edi
pop esi
pop ebx
add esp, 0x14
ret
call fcn.005567d0
xor eax, eax
mov ecx, esi
call fcn.00556840
test eax, eax
je 0x55861c
mov edx, dword [esi + 0x2a8]
mov ecx, esi
call fcn.005600a0
pop edi
mov dword [esi + 0x2a8], 0
pop esi
pop ebx
add esp, 0x14
ret
mov eax, dword [esi + 0x2a8]
mov byte [ebx + eax], 0
mov ecx, dword [esi + 0x2a8]
mov eax, ecx
cmp byte [eax], 0
je 0x55863b
add eax, 1
cmp byte [eax], 0
jne 0x558633
add ecx, ebx
lea edx, [eax + 0xc]
cmp ecx, edx
mov dword [esp + 0x1c], ecx
ja 0x558697
mov ecx, str.Invalid_pCAL_data
call fcn.0054c4a0
mov ecx, dword [esi + 0x2a8]
test ecx, ecx
je 0x558686
mov eax, dword [esi + 0x240]
test eax, eax
push ecx
je 0x55867e
push esi
call eax
add esp, 8
pop edi
mov dword [esi + 0x2a8], 0
pop esi
pop ebx
add esp, 0x14
ret
call fcn.005d27e0
add esp, 4
pop edi
mov dword [esi + 0x2a8], 0
pop esi
pop ebx
add esp, 0x14
ret
mov cl, byte [eax + 1]
movzx ebx, cl
shl ebx, 8
test cl, cl
jns 0x5586be
movzx ecx, byte [eax + 2]
movzx edx, byte [eax + 3]
add ebx, ecx
movzx ecx, byte [eax + 4]
shl ebx, 8
add ebx, edx
shl ebx, 8
add ebx, ecx
jmp 0x5586d6
movzx edx, byte [eax + 2]
movzx ecx, byte [eax + 3]
add ebx, edx
movzx edx, byte [eax + 4]
shl ebx, 8
add ebx, ecx
shl ebx, 8
add ebx, edx
mov cl, byte [eax + 5]
push ebp
movzx ebp, cl
shl ebp, 8
test cl, cl
jns 0x5586fe
movzx ecx, byte [eax + 6]
movzx edx, byte [eax + 7]
add ebp, ecx
movzx ecx, byte [eax + 8]
shl ebp, 8
add ebp, edx
shl ebp, 8
add ebp, ecx
jmp 0x558716
movzx edx, byte [eax + 6]
movzx ecx, byte [eax + 7]
add ebp, edx
movzx edx, byte [eax + 8]
shl ebp, 8
add ebp, ecx
shl ebp, 8
add ebp, edx
mov cl, byte [eax + 9]
mov dl, byte [eax + 0xa]
add eax, 0xb
test cl, cl
mov byte [esp + 0x13], cl
mov byte [esp + 0x12], dl
mov dword [esp + 0x1c], eax
jne 0x558736
cmp dl, 2
jne 0x558758
jmp 0x558798
cmp cl, 1
jne 0x558742
cmp dl, 3
jne 0x558758
jmp 0x558798
cmp cl, 2
jne 0x55874e
cmp dl, 3
jne 0x558758
jmp 0x558798
cmp cl, 3
jne 0x558781
cmp dl, 4
je 0x558798
mov ecx, str.Invalid_pCAL_parameters_for_equation_type
call fcn.0054c4a0
mov edx, dword [esi + 0x2a8]
mov ecx, esi
call fcn.005600a0
pop ebp
pop edi
mov dword [esi + 0x2a8], 0
pop esi
pop ebx
add esp, 0x14
ret
cmp cl, 4
jb 0x558798
mov ecx, str.Unrecognized_equation_type_for_pCAL_chunk
call fcn.0054c4a0
mov dl, byte [esp + 0x12]
mov eax, dword [esp + 0x1c]
cmp byte [eax], 0
mov edi, eax
je 0x5587a8
nop
add edi, 1
cmp byte [edi], 0
jne 0x5587a0
movzx eax, dl
lea ecx, [eax*4]
mov dword [esp + 0x18], eax
call fcn.005600d0
test eax, eax
mov dword [esp + 0x14], eax
jne 0x558804
mov ecx, dword [esi + 0x2a8]
test ecx, ecx
je 0x5587e8
mov eax, dword [esi + 0x240]
test eax, eax
push ecx
je 0x5587e0
push esi
call eax
add esp, 8
jmp 0x5587e8
call fcn.005d27e0
add esp, 4
mov ecx, str.No_memory_for_pCAL_params
mov dword [esi + 0x2a8], 0
call fcn.0054c4a0
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x14
ret
xor edx, edx
cmp dword [esp + 0x18], edx
jle 0x558860
lea esp, [esp]
mov ecx, dword [esp + 0x20]
add edi, 1
cmp edi, ecx
mov dword [eax + edx*4], edi
ja 0x55882c
mov edi, edi
cmp byte [edi], 0
je 0x558853
add edi, 1
cmp edi, ecx
jbe 0x558820
mov ecx, str.Invalid_pCAL_data
call fcn.0054c4a0
mov ecx, dword [esi + 0x2a8]
test ecx, ecx
je 0x5588ac
mov eax, dword [esi + 0x240]
test eax, eax
push ecx
je 0x5588a4
push esi
call eax
add esp, 8
jmp 0x5588ac
cmp edi, ecx
ja 0x55882c
add edx, 1
cmp edx, dword [esp + 0x18]
jl 0x558810
mov ecx, dword [esp + 0x18]
movzx edx, byte [esp + 0x13]
push eax
mov eax, dword [esp + 0x20]
push eax
mov eax, dword [esi + 0x2a8]
push ecx
push edx
push ebp
push ebx
push eax
mov eax, dword [esp + 0x44]
push esi
call fcn.0054ce50
mov eax, dword [esi + 0x2a8]
add esp, 0x20
test eax, eax
je 0x5588dc
mov ecx, dword [esi + 0x240]
test ecx, ecx
push eax
je 0x5588d4
push esi
call ecx
add esp, 8
jmp 0x5588dc
call fcn.005d27e0
add esp, 4
mov eax, dword [esi + 0x240]
test eax, eax
mov dword [esi + 0x2a8], 0
jne 0x5588f0
mov edx, dword [esp + 0x14]
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x14
mov dword [esp + 4], edx
jmp fcn.005d27e0
call fcn.005d27e0
add esp, 4
mov eax, dword [esi + 0x240]
test eax, eax
mov dword [esi + 0x2a8], 0
je 0x558903
mov ecx, dword [esp + 0x14]
push ecx
push esi
call eax
add esp, 8
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x14
ret
mov edx, dword [esp + 0x14]
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x14
mov dword [esp + 4], edx
jmp fcn.005d27e0