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

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xa68
mov rbx, rcx
mov ecx, dword [rcx + 0x10]
mov r9d, dword [rbx + 0x14]
cmp ecx, 4
jle 0x140031160
mov r8d, r9d
sub ecx, 5
shr r8d, 5
mov dword [rbx + 0x10], ecx
mov dword [rbx + 0x14], r8d
cmp ecx, 4
jle 0x140031110
mov edi, r8d
sub ecx, 5
shr edi, 5
mov dword [rbx + 0x10], ecx
mov dword [rbx + 0x14], edi
cmp ecx, 3
jg 0x140030710
mov rdx, qword [rbx + 8]
jmp 0x140030704
mov rax, qword [rbx]
cmp rax, rdx
jae 0x1400306f6
lea r10, [rax + 1]
mov qword [rbx], r10
movzx eax, byte [rax]
shl eax, cl
or edi, eax
add ecx, 8
mov dword [rbx + 0x14], edi
mov dword [rbx + 0x10], ecx
cmp ecx, 0x18
jg 0x140030710
mov eax, edi
shr eax, cl
test eax, eax
je 0x1400306e0
mov qword [rbx], rdx
nop
mov eax, edi
lea edx, [rcx - 4]
and edi, 0xf
xor r11d, r11d
shr eax, 4
pxor xmm0, xmm0
mov dword [rbx + 0x10], edx
add edi, 4
movaps xmmword [rsp + 0x40], xmm0
lea rbp, [0x140165120]
mov ecx, edx
mov dword [rbx + 0x14], eax
mov dword [rsp + 0x4f], 0
jmp 0x14003076f
movzx edx, byte [rbp + r11]
mov r10d, eax
sub ecx, 3
shr eax, 3
and r10d, 7
add r11, 1
mov dword [rbx + 0x14], eax
mov dword [rbx + 0x10], ecx
mov byte [rsp + rdx + 0x40], r10b
cmp edi, r11d
jle 0x1400307b8
cmp ecx, 2
jg 0x140030748
mov r10, qword [rbx + 8]
jmp 0x1400307a4
mov rdx, qword [rbx]
cmp rdx, r10
jae 0x140030796
lea rsi, [rdx + 1]
mov qword [rbx], rsi
movzx edx, byte [rdx]
shl edx, cl
or eax, edx
add ecx, 8
mov dword [rbx + 0x14], eax
mov dword [rbx + 0x10], ecx
cmp ecx, 0x18
jg 0x140030748
mov edx, eax
shr edx, cl
test edx, edx
je 0x140030780
mov qword [rbx], r10
jmp 0x140030748
lea r10, [rsp + 0x270]
pxor xmm0, xmm0
xor eax, eax
mov edx, ecx
mov rdi, r10
mov ecx, pe_nt_image_headers64
mov dword [rsp + 0xe0], 0
lea r11, [rsp + 0x40]
rep stosq qword [rdi], rax
movaps xmmword [rsp + 0xa0], xmm0
mov rax, r11
lea rsi, [rsp + 0x53]
movaps xmmword [rsp + 0xb0], xmm0
movaps xmmword [rsp + 0xc0], xmm0
movaps xmmword [rsp + 0xd0], xmm0
nop dword [rax + rax]
movzx ecx, byte [rax]
add rax, 1
add dword [rsp + rcx*4 + 0xa0], 1
cmp rsi, rax
jne 0x140030810
mov esi, dword [rsp + 0xa4]
mov dword [rsp + 0xa0], 0
cmp esi, 2
jg 0x140030e72
mov ecx, dword [rsp + 0xa8]
cmp ecx, 4
jg 0x140030e72
mov edi, dword [rsp + 0xac]
cmp edi, 8
jg 0x140030e72
mov ebp, dword [rsp + 0xb0]
cmp ebp, 0x10
jg 0x140030e72
mov r12d, dword [rsp + 0xb4]
cmp r12d, 0x20
jg 0x140030e72
mov r13d, dword [rsp + 0xb8]
cmp r13d, 0x40
jg 0x140030e72
mov r14d, dword [rsp + 0xbc]
cmp r14d, 0x80
jg 0x140030e72
mov eax, dword [rsp + 0xc0]
mov dword [rsp + 0x20], eax
cmp eax, 0x100
jg 0x140030e72
mov eax, dword [rsp + 0xc4]
mov dword [rsp + 0x24], eax
cmp eax, 0x200
jg 0x140030e72
mov eax, dword [rsp + 0xc8]
mov dword [rsp + 0x28], eax
cmp eax, 0x400
jg 0x140030e72
mov eax, dword [rsp + 0xcc]
mov dword [rsp + 0x2c], eax
cmp eax, 0x800
jg 0x140030e72
mov eax, dword [rsp + 0xd0]
mov dword [rsp + 0x30], eax
cmp eax, 0x1000
jg 0x140030e72
mov eax, dword [rsp + 0xd4]
mov dword [rsp + 0x34], eax
cmp eax, 0x2000
jg 0x140030e72
mov eax, dword [rsp + 0xd8]
mov dword [rsp + 0x38], eax
cmp eax, 0x4000
jg 0x140030e72
mov eax, dword [rsp + 0xdc]
mov dword [rsp + 0x3c], eax
cmp eax, 0x8000
jg 0x140030e72
xor eax, eax
xor r15d, r15d
mov dword [rsp + 0x64], 0
mov word [rsp + 0x672], ax
mov eax, esi
shl eax, 0xf
mov word [rsp + 0x6d8], si
mov dword [rsp + 0x694], eax
lea eax, [rsi + rsi]
mov dword [rsp + 0x68], eax
mov word [rsp + 0x674], ax
add eax, ecx
mov word [rsp + 0x6d6], r15w
test ecx, ecx
je 0x1400309a8
cmp eax, 4
jg 0x140030e72
mov r15d, eax
add ecx, esi
add eax, eax
shl r15d, 0xe
mov dword [rsp + 0x6c], eax
mov word [rsp + 0x676], ax
add eax, edi
mov dword [rsp + 0x698], r15d
mov word [rsp + 0x6da], cx
test edi, edi
je 0x1400309de
cmp eax, 8
jg 0x140030e72
mov esi, eax
add ecx, edi
add eax, eax
shl esi, 0xd
mov dword [rsp + 0x70], eax
mov word [rsp + 0x678], ax
add eax, ebp
mov dword [rsp + 0x69c], esi
mov word [rsp + 0x6dc], cx
test ebp, ebp
je 0x140030a11
cmp eax, 0x10
jg 0x140030e72
mov esi, eax
add ecx, ebp
add eax, eax
shl esi, 0xc
mov dword [rsp + 0x74], eax
mov word [rsp + 0x67a], ax
add eax, r12d
mov dword [rsp + 0x6a0], esi
mov word [rsp + 0x6de], cx
test r12d, r12d
je 0x140030a46
cmp eax, 0x20
jg 0x140030e72
mov esi, eax
add ecx, r12d
add eax, eax
shl esi, 0xb
mov dword [rsp + 0x78], eax
mov word [rsp + 0x67c], ax
add eax, r13d
mov dword [rsp + 0x6a4], esi
mov word [rsp + 0x6e0], cx
test r13d, r13d
je 0x140030a7c
cmp eax, 0x40
jg 0x140030e72
mov esi, eax
add ecx, r13d
add eax, eax
shl esi, 0xa
mov dword [rsp + 0x7c], eax
mov word [rsp + 0x67e], ax
add eax, r14d
mov dword [rsp + 0x6a8], esi
mov word [rsp + 0x6e2], cx
test r14d, r14d
je 0x140030ab4
cmp eax, 0x80
jg 0x140030e72
mov esi, eax
mov edi, dword [rsp + 0x20]
add eax, eax
add ecx, r14d
shl esi, 9
mov dword [rsp + 0x80], eax
mov word [rsp + 0x680], ax
add eax, edi
mov dword [rsp + 0x6ac], esi
mov word [rsp + 0x6e4], cx
test edi, edi
je 0x140030af1
cmp eax, 0x100
jg 0x140030e72
mov edi, dword [rsp + 0x20]
mov esi, eax
add eax, eax
shl esi, 8
mov dword [rsp + 0x84], eax
add ecx, edi
mov edi, dword [rsp + 0x24]
mov word [rsp + 0x682], ax
mov dword [rsp + 0x6b0], esi
mov word [rsp + 0x6e6], cx
add eax, edi
test edi, edi
je 0x140030b31
cmp eax, 0x200
jg 0x140030e72
mov edi, dword [rsp + 0x24]
mov esi, eax
add eax, eax
shl esi, 7
mov dword [rsp + 0x88], eax
add ecx, edi
mov edi, dword [rsp + 0x28]
mov word [rsp + 0x684], ax
mov dword [rsp + 0x6b4], esi
mov word [rsp + 0x6e8], cx
add eax, edi
test edi, edi
je 0x140030b71
cmp eax, 0x400
jg 0x140030e72
mov edi, dword [rsp + 0x28]
mov r12d, eax
add eax, eax
shl r12d, 6
mov dword [rsp + 0x8c], eax
add ecx, edi
mov edi, dword [rsp + 0x2c]
mov word [rsp + 0x686], ax
mov dword [rsp + 0x6b8], r12d
mov word [rsp + 0x6ea], cx
add eax, edi
test edi, edi
je 0x140030bb4
cmp eax, 0x800
jg 0x140030e72
mov edi, dword [rsp + 0x2c]
mov r13d, eax
add eax, eax
shl r13d, 5
mov dword [rsp + 0x90], eax
add ecx, edi
mov edi, dword [rsp + 0x30]
mov word [rsp + 0x688], ax
mov dword [rsp + 0x6bc], r13d
mov word [rsp + 0x6ec], cx
add eax, edi
test edi, edi
je 0x140030bf7
cmp eax, 0x1000
jg 0x140030e72
mov edi, dword [rsp + 0x30]
mov r14d, eax
add eax, eax
shl r14d, 4
mov dword [rsp + 0x94], eax
add ecx, edi
mov edi, dword [rsp + 0x34]
mov word [rsp + 0x68a], ax
mov dword [rsp + 0x6c0], r14d
mov word [rsp + 0x6ee], cx
add eax, edi
test edi, edi
je 0x140030c3a
cmp eax, 0x2000
jg 0x140030e72
mov edi, dword [rsp + 0x34]
lea r15d, [rax*8]
add eax, eax
mov dword [rsp + 0x98], eax
add ecx, edi
mov edi, dword [rsp + 0x38]
mov word [rsp + 0x68c], ax
mov dword [rsp + 0x6c4], r15d
mov word [rsp + 0x6f0], cx
add eax, edi
test edi, edi
je 0x140030c7e
cmp eax, 0x4000
jg 0x140030e72
lea edi, [rax*4]
add eax, eax
mov dword [rsp + 0x20], edi
mov dword [rsp + 0x6c8], edi
mov edi, dword [rsp + 0x38]
mov dword [rsp + 0x9c], eax
add ecx, edi
mov edi, dword [rsp + 0x3c]
mov word [rsp + 0x68e], ax
mov word [rsp + 0x6f2], cx
add eax, edi
test edi, edi
jne 0x1400312bf
add eax, eax
mov dword [rsp + 0x28], r8d
xor esi, esi
mov dword [rsp + 0x24], eax
mov dword [rsp + 0x6cc], eax
mov dword [rsp + 0x6d0], 0x10000
mov dword [rsp + 0x2c], r12d
mov dword [rsp + 0x30], r13d
mov dword [rsp + 0x34], r14d
jmp 0x140030d06
add ebp, 1
mov dword [rsp + r12*4 + 0x60], ebp
add rsi, 1
cmp rsi, 0x13
je 0x140030ea0
movzx edi, byte [r11 + rsi]
mov ecx, edi
test edi, edi
je 0x140030cf8
movsxd r12, edi
movzx r8d, word [rsp + r12*2 + 0x670]
mov ebp, dword [rsp + r12*4 + 0x60]
mov eax, ebp
sub eax, r8d
movzx r8d, word [rsp + r12*2 + 0x6d4]
add eax, r8d
cdqe
mov byte [rsp + rax + 0x6f4], dil
mov word [rsp + rax*2 + 0x814], si
cmp edi, 9
jg 0x140030cf0
mov r8d, ebp
lea eax, [rbp + rbp]
mov r14d, edi
sar r8d, 1
and eax, 0xaaaa
shl r14d, 9
and r8d, 0x5555
or r14d, esi
or eax, r8d
mov r13d, eax
lea r8d, [rax*4]
sar r13d, 2
and r8d, 0xcccc
and r13d, 0x3333
or r8d, r13d
mov r13d, 1
mov eax, r8d
shl r8d, 4
sar eax, 4
and r8d, 0xf0f0
shl r13d, cl
mov ecx, 0x10
and eax, 0xf0f
sub ecx, edi
movsxd r13, r13d
or r8d, eax
mov eax, r8d
shl r8d, 8
sar eax, 8
movzx r8d, r8w
or eax, r8d
sar eax, cl
cdqe
nop
mov word [r10 + rax*2], r14w
add rax, r13
cmp eax, 0x1ff
jle 0x140030dd0
jmp 0x140030cf0
mov ecx, eax
lea esi, [rax + rax]
sar ecx, 1
and esi, 0xaaaa
and ecx, 0x5555
or esi, ecx
mov ecx, esi
shl esi, 2
sar ecx, 2
and esi, 0xcccc
and ecx, 0x3333
or esi, ecx
mov ecx, esi
shl esi, 4
sar ecx, 4
and esi, 0xf0f0
and ecx, 0xf0f
or esi, ecx
mov ecx, esi
shl esi, 8
sar ecx, 8
movzx esi, si
mov edi, ecx
or edi, esi
cmp r12d, edi
jg 0x140031200
cmp r13d, edi
jg 0x140031268
cmp edi, r14d
jl 0x1400312b8
cmp edi, r15d
jl 0x1400312d7
mov esi, dword [rsp + 0x20]
cmp edi, esi
jl 0x1400312de
cmp dword [rsp + 0x24], edi
jg 0x1400312d0
lea rcx, [0x140158020]
lea rdi, str.Corrupt_PNG
call sym.__emutls_get_address
mov qword [rax], rdi
xor eax, eax
add rsp, 0xa68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r8d, dword [rsp + 0x28]
and r9d, 0x1f
mov r12d, dword [rsp + 0x2c]
lea r11, [rsp + 0xa0]
lea ebp, [r9 + 0x101]
mov r13d, dword [rsp + 0x30]
mov r14d, dword [rsp + 0x34]
movabs r10, 0x101010101010101
and r8d, 0x1f
mov dword [rsp + 0x28], ebp
lea esi, [r8 + 1]
xor r8d, r8d
mov dword [rsp + 0x2c], esi
lea r9d, [rbp + rsi]
cmp edx, 0xf
jg 0x140030fa4
nop word [rax + rax]
mov rsi, qword [rbx + 8]
cmp qword [rbx], rsi
jae 0x140030e72
mov eax, dword [rbx + 0x14]
mov ecx, edx
jmp 0x140030f38
mov rdx, qword [rbx]
cmp rdx, rsi
jae 0x140030f26
lea rdi, [rdx + 1]
mov qword [rbx], rdi
movzx edx, byte [rdx]
shl edx, cl
or eax, edx
add ecx, 8
mov dword [rbx + 0x14], eax
mov dword [rbx + 0x10], ecx
cmp ecx, 0x18
jg 0x140031078
mov edx, eax
shr edx, cl
test edx, edx
je 0x140030f10
mov qword [rbx], rsi
mov edx, ecx
mov ecx, eax
and ecx, 0x1ff
movzx ecx, word [rsp + rcx*2 + 0x270]
mov esi, ecx
test ecx, ecx
je 0x140030de8
sar ecx, 9
and esi, 0x1ff
shr eax, cl
sub edx, ecx
mov dword [rbx + 0x14], eax
mov dword [rbx + 0x10], edx
cmp esi, 0x12
jg 0x140030e72
cmp esi, 0xf
jg 0x140030fb0
movsxd rax, r8d
add r8d, 1
mov byte [rsp + rax + 0xa0], sil
cmp r9d, r8d
jle 0x140031028
mov edx, dword [rbx + 0x10]
cmp edx, 0xf
jle 0x140030ef8
mov eax, dword [rbx + 0x14]
jmp 0x140030f45
mov ecx, dword [rbx + 0x10]
mov eax, dword [rbx + 0x14]
cmp esi, 0x10
je 0x1400310a8
cmp esi, 0x11
je 0x1400310e8
cmp ecx, 6
jle 0x1400311b0
sub ecx, 7
mov edx, eax
and eax, 0x7f
mov dword [rbx + 0x10], ecx
shr edx, 7
mov dword [rbx + 0x14], edx
lea edx, [rax + 0xb]
xor eax, eax
mov ecx, r9d
sub ecx, r8d
cmp ecx, edx
jl 0x140030e72
movsxd rcx, r8d
imul rax, r10
add rcx, r11
cmp edx, 8
jae 0x140031080
test dl, 4
jne 0x14003134b
test edx, edx
je 0x14003101c
mov byte [rcx], al
test dl, 2
jne 0x140031358
add r8d, edx
cmp r9d, r8d
jg 0x140030f98
mov ebp, dword [rsp + 0x28]
mov esi, dword [rsp + 0x2c]
jne 0x140030e72
lea rdi, [rsp + 0xa0]
lea rcx, [rbx + 0x34]
mov r8d, ebp
mov rdx, rdi
call sym.stbi__zbuild_huffman_stbi__zhuffman__unsigned_char_const__int_
test eax, eax
je 0x140030e88
lea rdx, [rdi + rbp]
lea rcx, [rbx + 0x818]
mov r8d, esi
call sym.stbi__zbuild_huffman_stbi__zhuffman__unsigned_char_const__int_
test eax, eax
setne al
movzx eax, al
jmp 0x140030e8a
mov edx, ecx
jmp 0x140030f45
lea rdi, [rcx + 8]
mov esi, edx
mov qword [rcx], rax
and rdi, 0xfffffffffffffff8
mov qword [rcx + rsi - 8], rax
sub rcx, rdi
add ecx, edx
shr ecx, 3
rep stosq qword [rdi], rax
jmp 0x14003101c
cmp ecx, 1
jle 0x140031276
mov edx, eax
sub ecx, 2
and eax, 3
shr edx, 2
mov dword [rbx + 0x10], ecx
mov dword [rbx + 0x14], edx
lea edx, [rax + 3]
test r8d, r8d
je 0x140030e72
lea eax, [r8 - 1]
cdqe
movzx eax, byte [rsp + rax + 0xa0]
jmp 0x140030fe7
cmp ecx, 2
jle 0x1400312e5
mov edx, eax
sub ecx, 3
and eax, 7
shr edx, 3
mov dword [rbx + 0x10], ecx
mov dword [rbx + 0x14], edx
lea edx, [rax + 3]
xor eax, eax
jmp 0x140030fe7
mov rdx, qword [rbx + 8]
jmp 0x14003114a
mov rax, qword [rbx]
cmp rax, rdx
jae 0x140031137
lea r10, [rax + 1]
mov qword [rbx], r10
movzx eax, byte [rax]
shl eax, cl
or r8d, eax
add ecx, 8
mov dword [rbx + 0x14], r8d
mov dword [rbx + 0x10], ecx
cmp ecx, 0x18
jg 0x14003133d
mov eax, r8d
shr eax, cl
test eax, eax
je 0x140031120
mov qword [rbx], rdx
jmp 0x1400306c0
mov rdx, qword [rbx + 8]
jmp 0x14003119a
mov rax, qword [rbx]
cmp rax, rdx
jae 0x140031187
lea r8, [rax + 1]
mov qword [rbx], r8
movzx eax, byte [rax]
shl eax, cl
or r9d, eax
add ecx, 8
mov dword [rbx + 0x14], r9d
mov dword [rbx + 0x10], ecx
cmp ecx, 0x18
jg 0x140031328
mov eax, r9d
shr eax, cl
test eax, eax
je 0x140031170
mov qword [rbx], rdx
jmp 0x1400306a6
mov rsi, qword [rbx + 8]
jmp 0x1400311e8
mov rdx, qword [rbx]
cmp rdx, rsi
jae 0x1400311d6
lea rdi, [rdx + 1]
mov qword [rbx], rdi
movzx edx, byte [rdx]
shl edx, cl
or eax, edx
add ecx, 8
mov dword [rbx + 0x14], eax
mov dword [rbx + 0x10], ecx
cmp ecx, 0x18
jg 0x140030fd1
mov edx, eax
shr edx, cl
test edx, edx
je 0x1400311c0
mov qword [rbx], rsi
jmp 0x140030fd1
mov ecx, 6
mov esi, 0xa
nop word [rax + rax]
sar edi, cl
mov ecx, edi
movsxd rdi, esi
movzx ebp, word [rsp + rdi*2 + 0x670]
movzx edi, word [rsp + rdi*2 + 0x6d4]
sub ecx, ebp
add ecx, edi
cmp ecx, 0x11f
jg 0x140030e72
movsxd rdi, ecx
movzx ecx, byte [rsp + rdi + 0x6f4]
cmp esi, ecx
jne 0x140030e72
mov ecx, esi
sub edx, esi
movzx esi, word [rsp + rdi*2 + 0x814]
shr eax, cl
mov dword [rbx + 0x10], edx
mov dword [rbx + 0x14], eax
jmp 0x140030f72
mov esi, 0xb
mov ecx, 0x10
sub ecx, esi
jmp 0x140031210
mov rsi, qword [rbx + 8]
jmp 0x1400312a8
mov rdx, qword [rbx]
cmp rdx, rsi
jae 0x140031296
lea rdi, [rdx + 1]
mov qword [rbx], rdi
movzx edx, byte [rdx]
shl edx, cl
or eax, edx
add ecx, 8
mov dword [rbx + 0x14], eax
mov dword [rbx + 0x10], ecx
cmp ecx, 0x18
jg 0x1400310b1
mov edx, eax
shr edx, cl
test edx, edx
je 0x140031280
mov qword [rbx], rsi
jmp 0x1400310b1
mov esi, 0xc
jmp 0x14003126d
cmp eax, 0x8000
jle 0x140030cbd
jmp 0x140030e72
mov esi, 0xf
jmp 0x14003126d
mov esi, 0xd
jmp 0x14003126d
mov esi, 0xe
jmp 0x14003126d
mov rsi, qword [rbx + 8]
jmp 0x140031318
mov rdx, qword [rbx]
cmp rdx, rsi
jae 0x140031306
lea rdi, [rdx + 1]
mov qword [rbx], rdi
movzx edx, byte [rdx]
shl edx, cl
or eax, edx
add ecx, 8
mov dword [rbx + 0x14], eax
mov dword [rbx + 0x10], ecx
cmp ecx, 0x18
jg 0x1400310f1
mov edx, eax
shr edx, cl
test edx, edx
je 0x1400312f0
mov qword [rbx], rsi
jmp 0x1400310f1
mov r8d, r9d
mov edi, r9d
sub ecx, 0xa
shr r8d, 5
shr edi, 0xa
jmp 0x140030710
mov edi, r8d
sub ecx, 5
shr edi, 5
jmp 0x140030710
mov esi, edx
mov dword [rcx], eax
mov dword [rcx + rsi - 4], eax
jmp 0x14003101c
mov esi, edx
mov word [rcx + rsi - 2], ax
jmp 0x14003101c