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

Disassembly:
sub esp, 0x4c
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x54]
push ebx
push ebp
sub ecx, dword [eax + 0x20]
xor ebx, ebx
mov eax, dword [eax + 0x1c]
sar ecx, 5
push esi
mov esi, dword [esp + 0x68]
imul ecx, ecx, 0x1e8
push edi
mov dword [esp + 0x64], 0
mov edx, dword [esi + 0x1c]
mov dword [esp + 0x10], ebx
add ecx, dword [eax + 0x18]
mov dword [esp + 0x14], ecx
mov ecx, dword [edx + 0x30]
mov eax, dword [edx + 0x34]
add ecx, 2
adc eax, ebx
push eax
mov eax, dword [edx + 0x2c]
push ecx
mov ecx, dword [edx + 0x28]
add ecx, 2
adc eax, ebx
push eax
push ecx
call fcn.004e20b0
mov edi, eax
add esp, 0x10
mov dword [esp + 0x60], edi
test edi, edi
je 0x500bc9
mov ebp, dword [esi + 4]
mov ecx, dword [esp + 0x70]
mov dword [esp + 0x2c], ebp
test ebp, ebp
je 0x500bd4
cmp ebp, dword [esi + 0xc]
jne 0x5005fa
test ecx, ecx
je 0x500bf5
mov eax, dword [esp + 0x74]
test eax, eax
js 0x50060b
cmp dword [ebp + 0x24], eax
jae 0x500bd4
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp + 0x10]
jae 0x50062e
test ecx, ecx
jne 0x50062e
push 0xe1
push str.C:DeveloperVisual_Package_vcpkg_buildtreesjasper_src5eb260a2e4_ca02e25be6.clean_srclibjasperjpcjpc_t1dec.c
push str.seg__numpasses___seg__maxpasses__dopartial
call fcn.006adcf2
add esp, 0xc
cmp dword [ebp + 0x18], 0
jne 0x50064b
push 0xe2
push str.C:DeveloperVisual_Package_vcpkg_buildtreesjasper_src5eb260a2e4_ca02e25be6.clean_srclibjasperjpcjpc_t1dec.c
push str.seg__stream
call fcn.006adcf2
add esp, 0xc
push dword [ebp + 0x18]
call fcn.004df760
push 0
push dword [ebp + 0x18]
call fcn.004df840
mov eax, dword [ebp + 0x14]
add esp, 0xc
cmp eax, 1
jne 0x5006b2
mov eax, dword [esp + 0x64]
test eax, eax
jne 0x50069b
push eax
push 0x13
call fcn.0050a130
add esp, 8
mov dword [esp + 0x64], eax
test eax, eax
je 0x500bb3
push 0x7be580
push 0x13
push eax
call fcn.0050a5f0
mov eax, dword [esp + 0x70]
add esp, 0xc
push dword [ebp + 0x18]
push eax
call fcn.0050a650
push dword [esp + 0x6c]
call fcn.0050a400
add esp, 0xc
jmp 0x5006f0
cmp eax, 2
je 0x5006ce
push 0xef
push str.C:DeveloperVisual_Package_vcpkg_buildtreesjasper_src5eb260a2e4_ca02e25be6.clean_srclibjasperjpcjpc_t1dec.c
push str.seg__type__JPC_SEG_RAW
call fcn.006adcf2
add esp, 0xc
test ebx, ebx
jne 0x5006f0
push 0x6f5be0
push dword [ebp + 0x18]
call fcn.0050a0d0
mov ebx, eax
add esp, 8
mov dword [esp + 0x10], ebx
test ebx, ebx
je 0x500ba2
cmp dword [ebp + 0xc], 0
mov dword [esp + 0x20], 0
jbe 0x500ad2
mov edx, dword [esp + 0x68]
mov ecx, dword [esi + 0x10]
mov edx, dword [edx + 0x18]
cmp ecx, edx
jbe 0x500734
mov eax, dword [esp + 0x14]
mov al, byte [eax + 0x1a1]
test al, al
je 0x500727
movzx eax, al
sub eax, edx
cmp ecx, eax
jae 0x500734
push str.warning:_corrupt_code_stream_n
call fcn.004f71f0
add esp, 4
mov edi, dword [ebp + 8]
mov eax, edi
sub eax, dword [esi + 0x18]
mov ecx, dword [esp + 0x20]
add ecx, 2
add ecx, eax
mov eax, 0xaaaaaaab
mul ecx
mov eax, dword [esp + 0x68]
shr edx, 1
mov ecx, dword [eax + 0x20]
sub ecx, edx
sub ecx, dword [esi + 0x10]
mov esi, dword [eax + 0x18]
dec esi
add esi, ecx
js 0x500bf5
mov eax, dword [esp + 0x20]
add eax, edi
push eax
call fcn.004fb9a0
add esp, 4
mov edi, eax
mov dword [esp + 0x58], edi
cmp esi, 0x1f
jl 0x500797
push 0x108
push str.C:DeveloperVisual_Package_vcpkg_buildtreesjasper_src5eb260a2e4_ca02e25be6.clean_srclibjasperjpcjpc_t1dec.c
push str.bpno___0__bpno___31
call fcn.006adcf2
add esp, 0xc
mov eax, edi
sub eax, 0
je 0x500a43
sub eax, 1
je 0x500812
sub eax, 1
jne 0x500b73
cmp dword [ebp + 0x14], 1
je 0x5007cd
push 0x11a
push str.C:DeveloperVisual_Package_vcpkg_buildtreesjasper_src5eb260a2e4_ca02e25be6.clean_srclibjasperjpcjpc_t1dec.c
push str.seg__type__JPC_SEG_MQ
call fcn.006adcf2
add esp, 0xc
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x60]
mov ebx, dword [esp + 0x64]
mov cl, byte [eax + 0x1a2]
mov eax, dword [esp + 0x6c]
push dword [eax + 0x1c]
mov al, cl
shr cl, 3
shr al, 5
and cl, 1
and al, 1
push edi
movzx eax, al
push eax
movzx eax, cl
push eax
mov eax, dword [esp + 0x78]
push dword [eax + 8]
push esi
push ebx
call fcn.004ff180
add esp, 0x1c
jmp 0x500a8d
cmp dword [ebp + 0x14], 1
mov eax, dword [esp + 0x6c]
jne 0x500837
push dword [eax + 0x1c]
mov edi, dword [esp + 0x64]
mov ebx, dword [esp + 0x68]
push edi
push esi
push ebx
call fcn.004ffe50
add esp, 0x10
jmp 0x500a8d
mov ecx, dword [eax + 0x1c]
mov edx, dword [esp + 0x60]
mov eax, dword [ecx + 0x30]
cmp dword [edx + 0x2c], 0
mov dword [esp + 0x4c], eax
mov eax, dword [ecx + 0x28]
mov dword [esp + 0x28], eax
jl 0x500867
jg 0x50085a
cmp dword [edx + 0x28], 1
jbe 0x500867
mov eax, dword [edx + 0x38]
mov ebx, dword [eax + 4]
sub ebx, dword [eax]
sar ebx, 3
jmp 0x500869
xor ebx, ebx
mov eax, edx
mov dword [esp + 0x1c], ebx
mov edx, 0x38
add edx, eax
cmp dword [ecx + 0x2c], 0
jl 0x500891
jg 0x500884
cmp dword [ecx + 0x28], 1
jbe 0x500891
mov eax, dword [ecx + 0x38]
mov edi, dword [eax + 4]
sub edi, dword [eax]
sar edi, 3
jmp 0x500893
xor edi, edi
xor ebp, ebp
mov dword [esp + 0x24], edi
mov eax, 0x38
mov ebx, ebp
add ecx, eax
mov eax, esi
bts ebx, eax
cmp eax, 0x20
cmovae ebp, ebx
xor ebx, ebp
cmp eax, 0x40
mov eax, ebx
mov dword [esp + 0x18], ebx
mov ebx, dword [esp + 0x1c]
cmovae ebp, eax
shrd eax, ebp, 1
sar ebp, 1
mov dword [esp + 0x18], eax
mov dword [esp + 0x50], ebp
test esi, esi
je 0x5008e4
mov esi, eax
neg esi
mov dword [esp + 0x30], esi
adc ebp, 0
neg ebp
mov dword [esp + 0x34], ebp
jmp 0x5008f4
mov dword [esp + 0x30], 0xffffffff
mov dword [esp + 0x34], 0xffffffff
mov eax, dword [edx]
mov ebp, dword [esp + 0x28]
mov edx, dword [eax + 4]
mov eax, dword [ecx]
add edx, 8
mov dword [esp + 0x44], edx
mov esi, dword [eax]
mov dword [esp + 0x48], esi
test ebp, ebp
jle 0x500a22
mov edi, dword [esp + 0x4c]
mov eax, 4
cmp ebp, eax
mov dword [esp + 0x38], edi
mov ecx, edx
mov edx, esi
cmovl eax, ebp
mov dword [esp + 0x3c], ecx
test edi, edi
mov dword [esp + 0x40], edx
mov edi, dword [esp + 0x24]
mov dword [esp + 0x54], eax
je 0x5009fb
xor ebp, ebp
mov esi, ecx
mov ebx, edx
test eax, eax
je 0x5009d0
mov eax, dword [esi]
and eax, 0x5000
cmp eax, 0x1000
jne 0x5009b5
push dword [esp + 0x10]
call fcn.00509910
add esp, 4
test eax, eax
js 0x500a32
je 0x50097e
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x50]
jmp 0x500986
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x34]
mov edi, dword [ebx + 4]
mov edx, dword [ebx]
test edi, edi
jg 0x50099c
jl 0x500995
test edx, edx
jae 0x50099c
neg ecx
adc eax, 0
neg eax
add edx, ecx
mov dword [ebx], edx
adc edi, eax
mov dword [ebx + 4], edi
mov eax, dword [esi + 4]
or dword [esi], 0x2000
mov edi, dword [esp + 0x24]
mov dword [esi + 4], eax
mov eax, dword [esp + 0x1c]
lea ebx, [ebx + edi*8]
inc ebp
lea esi, [esi + eax*8]
mov eax, dword [esp + 0x54]
cmp ebp, eax
jb 0x500950
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x40]
mov ebx, dword [esp + 0x38]
add ecx, 8
dec ebx
mov dword [esp + 0x3c], ecx
add edx, 8
mov dword [esp + 0x38], ebx
mov dword [esp + 0x40], edx
test ebx, ebx
jne 0x500942
mov ebx, dword [esp + 0x1c]
mov ebp, dword [esp + 0x28]
mov esi, dword [esp + 0x48]
mov edx, dword [esp + 0x44]
mov eax, ebx
shl eax, 5
sub ebp, 4
shl edi, 5
add edx, eax
add esi, edi
mov dword [esp + 0x28], ebp
mov dword [esp + 0x44], edx
mov dword [esp + 0x48], esi
test ebp, ebp
jg 0x500914
mov ebp, dword [esp + 0x2c]
xor esi, esi
mov edi, dword [esp + 0x60]
mov ebx, dword [esp + 0x64]
jmp 0x500a8f
mov ebp, dword [esp + 0x2c]
or esi, 0xffffffff
mov edi, dword [esp + 0x60]
mov ebx, dword [esp + 0x64]
jmp 0x500a8f
mov eax, dword [esp + 0x6c]
mov edi, dword [esp + 0x60]
push dword [eax + 0x1c]
mov eax, dword [esp + 0x18]
push edi
mov al, byte [eax + 0x1a2]
shr al, 3
and al, 1
cmp dword [ebp + 0x14], 1
movzx eax, al
push eax
jne 0x500a7f
mov eax, dword [esp + 0x74]
mov ebx, dword [esp + 0x70]
push dword [eax + 8]
push esi
push ebx
call fcn.00500080
add esp, 0x18
jmp 0x500a8d
push esi
push ebx
call fcn.004ffad0
mov ebx, dword [esp + 0x78]
add esp, 0x14
mov esi, eax
mov eax, dword [esp + 0x14]
test byte [eax + 0x1a2], 2
je 0x500ab0
test ebx, ebx
je 0x500ab0
push 0x7be580
push 0x13
push ebx
call fcn.0050a5f0
add esp, 0xc
test esi, esi
jne 0x500b8a
mov eax, dword [esp + 0x20]
mov ebx, dword [esp + 0x10]
inc eax
mov esi, dword [esp + 0x6c]
mov dword [esp + 0x20], eax
cmp eax, dword [ebp + 0xc]
jb 0x500702
mov eax, dword [ebp + 0x14]
cmp eax, 1
je 0x500b4e
cmp eax, 2
je 0x500af6
push 0x134
push str.C:DeveloperVisual_Package_vcpkg_buildtreesjasper_src5eb260a2e4_ca02e25be6.clean_srclibjasperjpcjpc_t1dec.c
push str.seg__type__JPC_SEG_RAW
call fcn.006adcf2
add esp, 0xc
mov eax, dword [esp + 0x14]
mov edx, 0
mov ebx, dword [esp + 0x10]
mov cl, byte [eax + 0x1a2]
mov eax, 0x2a
test cl, 0x10
cmove eax, edx
test cl, 0x10
push eax
mov eax, 0x7f
cmove eax, edx
push eax
push ebx
call fcn.00509bc0
add esp, 0xc
test eax, eax
js 0x500ba2
jle 0x500b3d
push str.warning:_bad_termination_pattern_detected_n
call fcn.004f71f0
add esp, 4
push ebx
call fcn.00509830
add esp, 4
xor ebx, ebx
mov dword [esp + 0x10], ebx
jmp 0x500b52
mov ebx, dword [esp + 0x10]
mov eax, dword [ebp]
mov dword [esi + 0xc], eax
lea eax, [esi + 4]
push ebp
push eax
call fcn.004efb50
push ebp
call fcn.004efb00
mov ebp, dword [esi + 0xc]
add esp, 0xc
jmp 0x5005dd
push 0x122
push str.C:DeveloperVisual_Package_vcpkg_buildtreesjasper_src5eb260a2e4_ca02e25be6.clean_srclibjasperjpcjpc_t1dec.c
push 0x6fccd8
call fcn.006adcf2
add esp, 0xc
push dword [ebp + 0x14]
push dword [esp + 0x5c]
push str.coding_pass_failed_passtype_d_segtype_d_n
call fcn.004f7130
mov ebx, dword [esp + 0x1c]
add esp, 0xc
mov eax, dword [esp + 0x64]
test eax, eax
je 0x500bb3
push eax
call fcn.00501020
add esp, 4
test ebx, ebx
je 0x500bc0
push ebx
call fcn.00509830
add esp, 4
push edi
call fcn.004e2250
add esp, 4
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x4c
ret
test ecx, ecx
je 0x500bf5
cmp dword [esi + 0xc], 0
je 0x500bf5
push 0x14c
push str.C:DeveloperVisual_Package_vcpkg_buildtreesjasper_src5eb260a2e4_ca02e25be6.clean_srclibjasperjpcjpc_t1dec.c
push str.dopartial_____cblk__curseg__:_1
call fcn.006adcf2
add esp, 0xc
mov eax, dword [esp + 0x64]
test eax, eax
je 0x500c06
push eax
call fcn.00501020
add esp, 4
test ebx, ebx
je 0x500c13
push ebx
call fcn.00509830
add esp, 4
push dword [esp + 0x60]
call fcn.004e2250
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret