Function at 0x14005089a
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x558
mov r15, rcx
mov dword [rsp + 0x5a8], edx
mov edi, r8d
mov word [rsp + 0x14d], 0
mov byte [rsp + 0x14f], 0
mov rax, qword [rcx]
mov qword [rsp + 0x58], rax
mov qword [rcx + 0x10], 0
mov qword [rcx + 8], 0
mov qword [rcx + 0x18], 0
mov rcx, rax
call sym.stbi__check_png_header
mov r14d, eax
test eax, eax
je 0x140050909
mov r14d, dword [rsp + 0x5a8]
cmp r14d, 1
jne 0x140050920
mov eax, r14d
add rsp, 0x558
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov dword [rsp + 0x70], 0
mov dword [rsp + 0x64], 0
mov dword [rsp + 0x50], 0
mov r14d, 1
mov esi, 0
mov r12d, 0
mov ebp, 0
mov byte [rsp + 0x77], 0
mov byte [rsp + 0x76], 0
mov dword [rsp + 0x48], ebp
mov rbx, qword [rsp + 0x58]
mov dword [rsp + 0x5b0], edi
jmp 0x140050a2c
cmp eax, 0x504c5445
je 0x140050d46
cmp eax, 0x74524e53
jne 0x140050a68
test r14d, r14d
jne 0x140050df6
cmp qword [r15 + 8], 0
jne 0x140050e0f
cmp byte [rsp + 0x76], 0
jne 0x140050e22
mov edx, dword [rbx + 8]
mov r8d, edx
and r8d, 1
je 0x140050ead
lea eax, [rdx + rdx]
cmp eax, edi
jne 0x140050ec3
cmp dword [rsp + 0x5a8], 2
je 0x140050ed6
cmp dword [r15 + 0x20], 0x10
je 0x140050ef3
mov edi, 0
lea r13, [0x14019db28]
test edx, edx
jle 0x140050ee9
mov rcx, rbx
call sym.stbi__get16be
movsxd rcx, dword [r15 + 0x20]
mul byte [r13 + rcx]
mov byte [rsp + rdi + 0x14d], al
add rdi, 1
cmp dword [rbx + 8], edi
jg 0x1400509ea
mov byte [rsp + 0x77], 1
jmp 0x140050a24
mov edx, edi
mov rcx, rbx
call sym.stbi__skip
mov dword [rsp + 0x70], 1
mov rcx, rbx
call sym.stbi__get32be
mov rcx, rbx
call sym.stbi__get32be
mov edi, eax
mov rcx, rbx
call sym.stbi__get32be
cmp eax, 0x49484452
je 0x140050a88
ja 0x14005096d
cmp eax, 0x49444154
je 0x140050f28
cmp eax, 0x49454e44
je 0x1400510e8
cmp eax, 0x43674249
je 0x140050a12
test r14d, r14d
jne 0x140051a61
test eax, 0x20000000
je 0x140051a7a
mov edx, edi
mov rcx, rbx
call sym.stbi__skip
jmp 0x140050a24
test r14d, r14d
je 0x140050bba
cmp edi, 0xd
jne 0x140050bcd
mov rcx, rbx
call sym.stbi__get32be
mov dword [rbx], eax
mov rcx, rbx
call sym.stbi__get32be
mov dword [rbx + 4], eax
cmp eax, 0x1000000
ja 0x140050be6
cmp dword [rbx], 0x1000000
ja 0x140050bff
mov rcx, rbx
call sym.stbi__get8
movzx edx, al
mov dword [r15 + 0x20], edx
cmp al, 0x10
ja 0x140050c18
mov edx, 0x10116
bt rdx, rax
jae 0x140050c18
mov rcx, rbx
call sym.stbi__get8
mov edi, eax
movzx eax, al
mov dword [rsp + 0x64], eax
cmp eax, 6
jg 0x140050c31
cmp dword [rsp + 0x64], 3
je 0x140050c4a
test dil, 1
jne 0x140050c74
mov rcx, rbx
call sym.stbi__get8
test al, al
jne 0x140050c8d
mov rcx, rbx
call sym.stbi__get8
test al, al
jne 0x140050ca6
mov rcx, rbx
call sym.stbi__get8
movzx eax, al
mov dword [rsp + 0x50], eax
cmp eax, 1
jg 0x140050cbf
mov ecx, dword [rbx]
test ecx, ecx
je 0x140050cd8
mov r8d, dword [rbx + 4]
test r8d, r8d
je 0x140050cd8
cmp byte [rsp + 0x76], 0
jne 0x140050d0a
test dil, 2
mov eax, 3
cmovne r14d, eax
mov r9d, dword [rsp + 0x64]
sar r9d, 2
add r9d, r14d
mov dword [rbx + 8], r9d
mov eax, 0x40000000
mov edx, 0
div ecx
mov edx, 0
div r9d
cmp eax, r8d
jb 0x140050cf1
mov r14d, 0
jmp 0x140050a24
lea rax, str.multiple_IHDR
mov qword [0x1401ec9f0], rax
jmp 0x140050909
lea rax, str.bad_IHDR_len
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.too_large
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.too_large
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.1_2_4_8_16_bit_only
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.bad_ctype
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
cmp dword [r15 + 0x20], 0x10
je 0x140050c5b
mov byte [rsp + 0x76], 3
jmp 0x140050b1b
lea rax, str.bad_ctype
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.bad_ctype
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.bad_comp_method
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.bad_filter_method
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.bad_interlace_method
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.0_pixel_image
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.too_large
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
mov dword [rbx + 8], 1
mov eax, 0x10000000
mov edx, 0
div ecx
cmp eax, r8d
jb 0x140050d2d
mov r14d, 0
jmp 0x140050a24
lea rax, str.too_large
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
test r14d, r14d
jne 0x140050db7
cmp edi, 0x300
ja 0x140050dd0
mov esi, edi
mov eax, 0xaaaaaaab
imul rsi, rax
shr rsi, 0x21
lea eax, [rsi + rsi*2]
cmp eax, edi
jne 0x140050de3
lea rbp, [rsp + 0x150]
mov r13d, 0
cmp edi, 2
jbe 0x140050a24
mov rcx, rbx
call sym.stbi__get8
mov byte [rbp], al
mov rcx, rbx
call sym.stbi__get8
mov byte [rbp + 1], al
mov rcx, rbx
call sym.stbi__get8
mov byte [rbp + 2], al
mov byte [rbp + 3], 0xff
add r13d, 1
add rbp, 4
cmp r13d, esi
jb 0x140050d80
jmp 0x140050a24
lea rax, str.first_not_IHDR
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.invalid_PLTE
mov qword [0x1401ec9f0], rax
jmp 0x140050909
lea rax, str.invalid_PLTE
mov qword [0x1401ec9f0], rax
jmp 0x140050909
lea rax, str.first_not_IHDR
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.tRNS_after_IDAT
mov qword [0x1401ec9f0], rax
jmp 0x140050909
cmp dword [rsp + 0x5a8], 2
je 0x140050e66
test esi, esi
je 0x140050e7d
cmp esi, edi
jb 0x140050e9a
test edi, edi
je 0x140050e90
lea r13, [rsp + 0x150]
mov edi, edi
lea rdi, [r13 + rdi*4]
mov rcx, rbx
call sym.stbi__get8
mov byte [r13 + 3], al
add r13, 4
cmp r13, rdi
jne 0x140050e47
mov byte [rsp + 0x76], 4
jmp 0x140050a24
mov rax, qword [rsp + 0x58]
mov dword [rax + 8], 4
mov r14d, 1
jmp 0x140050909
lea rax, str.tRNS_before_PLTE
mov qword [0x1401ec9f0], rax
jmp 0x140050909
mov byte [rsp + 0x76], 4
jmp 0x140050a24
lea rax, str.bad_tRNS_len
mov qword [0x1401ec9f0], rax
jmp 0x140050909
lea rax, str.tRNS_with_alpha
mov qword [0x1401ec9f0], rax
mov r14d, r8d
jmp 0x140050909
lea rax, str.bad_tRNS_len
mov qword [0x1401ec9f0], rax
jmp 0x140050909
add edx, 1
mov rax, qword [rsp + 0x58]
mov dword [rax + 8], edx
mov r14d, r8d
jmp 0x140050909
mov byte [rsp + 0x77], 1
jmp 0x140050a24
mov byte [rsp + 0x77], 1
test edx, edx
jle 0x140050a24
mov edi, 0
mov rcx, rbx
call sym.stbi__get16be
mov word [rsp + rdi*2 + 0x146], ax
add rdi, 1
cmp dword [rbx + 8], edi
jg 0x140050f05
mov byte [rsp + 0x77], 1
jmp 0x140050a24
test r14d, r14d
jne 0x140050fcf
cmp byte [rsp + 0x76], 0
je 0x140050f40
test esi, esi
je 0x140050fe8
cmp dword [rsp + 0x5a8], 2
je 0x140050ffb
cmp edi, 0x40000000
ja 0x14005101e
mov eax, dword [rsp + 0x48]
lea r13d, [rax + rdi]
cmp r13d, eax
jl 0x140050909
cmp r12d, r13d
jb 0x140051031
mov ebp, dword [rsp + 0x48]
add rbp, qword [r15 + 8]
cmp qword [rbx + 0x10], 0
je 0x140050fa1
mov rdx, qword [rbx + 0xc0]
mov rax, qword [rbx + 0xc8]
sub rax, rdx
mov qword [rsp + 0x48], rax
cmp edi, eax
jg 0x14005107d
mov rdx, qword [rbx + 0xc0]
movsxd rdi, edi
lea rax, [rdx + rdi]
cmp qword [rbx + 0xc8], rax
jae 0x1400510cc
lea rax, str.outofdata
mov qword [0x1401ec9f0], rax
jmp 0x140050909
lea rax, str.first_not_IHDR
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.no_PLTE
mov qword [0x1401ec9f0], rax
jmp 0x140050909
mov r14d, 1
movzx eax, byte [rsp + 0x76]
test al, al
je 0x140050909
movzx eax, al
mov rsi, qword [rsp + 0x58]
mov dword [rsi + 8], eax
jmp 0x140050909
lea rax, str.IDAT_size_limit
mov qword [0x1401ec9f0], rax
jmp 0x140050909
test r12d, r12d
jne 0x140051048
mov r12d, 0x1000
cmp edi, r12d
cmovae r12d, edi
cmp r12d, r13d
jae 0x140051050
add r12d, r12d
cmp r12d, r13d
jb 0x140051048
mov edx, r12d
mov rcx, qword [r15 + 8]
call sym.realloc
test rax, rax
je 0x14005106a
mov qword [r15 + 8], rax
jmp 0x140050f74
lea rax, str.outofmem
mov qword [0x1401ec9f0], rax
jmp 0x140050909
movsxd rax, dword [rsp + 0x48]
mov qword [rsp + 0x68], rax
mov r8, rax
mov rcx, rbp
call sym.memcpy
mov edx, dword [rsp + 0x48]
sub edi, edx
mov rax, qword [rsp + 0x68]
lea rdx, [rbp + rax]
mov rcx, qword [rbx + 0x28]
mov r8d, edi
call qword [rbx + 0x10]
mov rdx, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rdx
cmp edi, eax
jne 0x140050fbc
mov dword [rsp + 0x48], r13d
jmp 0x140050a24
mov r8, rdi
mov rcx, rbp
call sym.memcpy
add qword [rbx + 0xc0], rdi
mov dword [rsp + 0x48], r13d
jmp 0x140050a24
mov ebp, dword [rsp + 0x48]
mov edi, dword [rsp + 0x5b0]
test r14d, r14d
jne 0x140051232
cmp dword [rsp + 0x5a8], 0
jne 0x140051a49
mov rcx, qword [r15 + 8]
test rcx, rcx
je 0x14005124b
mov rsi, qword [rsp + 0x58]
mov eax, dword [rsi + 4]
mov r8d, dword [rsi]
imul r8d, dword [r15 + 0x20]
add r8d, 7
shr r8d, 3
mov edx, eax
imul edx, dword [rsi + 8]
imul r8d, edx
add r8d, eax
mov dword [rsp + 0xbc], r8d
mov eax, dword [rsp + 0x70]
xor eax, 1
mov dword [rsp + 0x20], eax
lea r9, [rsp + 0xbc]
mov edx, ebp
call sym.stbi_zlib_decode_malloc_guesssize_headerflag
mov qword [r15 + 0x10], rax
test rax, rax
je 0x140051a54
mov rcx, qword [r15 + 8]
call sym.free
mov qword [r15 + 8], 0
mov eax, dword [rsi + 8]
mov dword [rsp + 0x98], eax
add eax, 1
cmp eax, edi
je 0x140051266
cmp byte [rsp + 0x77], 0
cmove eax, dword [rsp + 0x98]
mov dword [rsp + 0x98], eax
mov rax, qword [rsp + 0x58]
mov esi, dword [rsp + 0x98]
mov dword [rax + 0xc], esi
mov eax, dword [r15 + 0x20]
mov dword [rsp + 0xa0], eax
mov esi, dword [rsp + 0xbc]
mov dword [rsp + 0x9c], esi
mov rsi, qword [r15 + 0x10]
mov qword [rsp + 0x90], rsi
cmp eax, 0x10
sete al
movzx eax, al
add eax, 1
cmp dword [rsp + 0x50], 0
je 0x140051286
mov esi, dword [rsp + 0x98]
imul esi, eax
mov rax, qword [r15]
mov edx, dword [rax + 4]
mov ecx, dword [rax]
mov r9d, 0
mov r8d, esi
call sym.stbi__malloc_mad3
mov qword [rsp + 0x50], rax
test rax, rax
je 0x1400512d9
mov eax, 0
mov dword [rsp + 0x5b0], edi
mov rdi, rax
jmp 0x1400513b4
lea rax, str.first_not_IHDR
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
lea rax, str.no_IDAT
mov qword [0x1401ec9f0], rax
mov r14d, dword [rsp + 0x5a8]
jmp 0x140050909
cmp edi, 3
je 0x140051191
cmp byte [rsp + 0x76], 0
jne 0x140051191
mov dword [rsp + 0x98], edi
jmp 0x1400511a5
mov rax, qword [r15]
mov esi, dword [rsp + 0x64]
mov dword [rsp + 0x38], esi
mov esi, dword [rsp + 0xa0]
mov dword [rsp + 0x30], esi
mov edx, dword [rax + 4]
mov dword [rsp + 0x28], edx
mov eax, dword [rax]
mov dword [rsp + 0x20], eax
mov r9d, dword [rsp + 0x98]
mov r8d, dword [rsp + 0x9c]
mov rdx, qword [rsp + 0x90]
mov rcx, r15
call sym.stbi__create_png_image_raw
mov r14d, eax
test eax, eax
je 0x140050909
jmp 0x14005160f
lea rax, str.outofmem
mov qword [0x1401ec9f0], rax
jmp 0x1400512f3
mov rcx, qword [rsp + 0x50]
call sym.free
mov r14d, dword [rsp + 0x5a8]
jmp 0x140050909
mov dword [rsp + 0x7c], eax
mov dword [rsp + 0x88], edx
mov rax, qword [r15]
mov ecx, esi
imul ecx, dword [rax]
imul ecx, ebp
add rcx, rdi
mov rax, qword [rsp + 0x50]
add rcx, rax
mov rdx, r13
add rdx, qword [r15 + 0x18]
mov r8, r12
call sym.memcpy
add ebx, 1
add r13, r12
add rdi, r14
cmp dword [rsp + 0x48], ebx
jne 0x14005130b
mov eax, dword [rsp + 0x7c]
mov edx, dword [rsp + 0x88]
add edx, 1
mov edi, dword [rsp + 0x78]
add ebp, edi
mov edi, dword [rsp + 0x8c]
add eax, edi
cmp dword [rsp + 0x68], edx
je 0x14005137d
movsxd r13, eax
mov rdi, qword [rsp + 0x80]
mov ebx, dword [rsp + 0x5a8]
cmp dword [rsp + 0x48], 0
jg 0x140051300
jmp 0x14005134a
mov rdi, qword [rsp + 0xa8]
mov rcx, qword [r15 + 0x18]
call sym.free
mov ebx, dword [rsp + 0xa4]
mov eax, ebx
add qword [rsp + 0x90], rax
sub dword [rsp + 0x9c], ebx
add rdi, 4
cmp rdi, 0x1c
je 0x1400515ff
mov dword [rsp + 0xc0], 0
mov dword [rsp + 0xc4], 4
mov dword [rsp + 0xc8], 0
mov dword [rsp + 0xcc], 2
mov dword [rsp + 0xd0], 0
mov dword [rsp + 0xd4], 1
mov dword [rsp + 0xd8], 0
mov dword [rsp + 0xe0], 0
mov dword [rsp + 0xe4], 0
mov dword [rsp + 0xe8], 4
mov dword [rsp + 0xec], 0
mov dword [rsp + 0xf0], 2
mov dword [rsp + 0xf4], 0
mov dword [rsp + 0xf8], 1
mov dword [rsp + 0x100], 8
mov dword [rsp + 0x104], 8
mov dword [rsp + 0x108], 4
mov dword [rsp + 0x10c], 4
mov dword [rsp + 0x110], 2
mov dword [rsp + 0x114], 2
mov dword [rsp + 0x118], 1
mov dword [rsp + 0x120], 8
mov dword [rsp + 0x124], 8
mov dword [rsp + 0x128], 8
mov dword [rsp + 0x12c], 4
mov dword [rsp + 0x130], 4
mov dword [rsp + 0x134], 2
mov dword [rsp + 0x138], 2
mov rcx, qword [r15]
mov ebx, dword [rsp + rdi + 0xc0]
mov r13d, dword [rsp + rdi + 0x100]
mov eax, dword [rcx]
lea eax, [r13 + rax - 1]
sub eax, ebx
mov edx, 0
div r13d
mov ebp, eax
mov r14d, dword [rsp + rdi + 0xe0]
mov edx, dword [rsp + rdi + 0x120]
mov dword [rsp + 0x78], edx
mov eax, dword [rcx + 4]
lea eax, [rdx + rax - 1]
sub eax, r14d
mov r11d, edx
mov edx, 0
div r11d
mov dword [rsp + 0x68], eax
test ebp, ebp
je 0x1400513a6
test eax, eax
je 0x1400513a6
mov eax, ebp
imul eax, dword [rcx + 8]
mov ecx, dword [rsp + 0xa0]
imul eax, ecx
add eax, 7
sar eax, 3
add eax, 1
mov r12d, dword [rsp + 0x68]
imul eax, r12d
mov dword [rsp + 0xa4], eax
mov eax, dword [rsp + 0x64]
mov dword [rsp + 0x38], eax
mov dword [rsp + 0x30], ecx
mov dword [rsp + 0x28], r12d
mov dword [rsp + 0x20], ebp
mov r9d, dword [rsp + 0x98]
mov r8d, dword [rsp + 0x9c]
mov rdx, qword [rsp + 0x90]
mov rcx, r15
call sym.stbi__create_png_image_raw
test eax, eax
je 0x1400512e9
test r12d, r12d
jle 0x140051385
mov eax, esi
imul eax, ebp
mov dword [rsp + 0x8c], eax
imul r13d, esi
movsxd rcx, r13d
imul ebx, esi
movsxd rax, ebx
mov qword [rsp + 0x80], rax
mov edx, dword [rsp + 0x5a8]
mov eax, 0
movsxd r12, esi
mov qword [rsp + 0xa8], rdi
mov dword [rsp + 0x48], ebp
mov ebp, r14d
mov r14, rcx
jmp 0x140051362
mov edi, dword [rsp + 0x5b0]
mov rax, qword [rsp + 0x50]
mov qword [r15 + 0x18], rax
cmp byte [rsp + 0x77], 0
je 0x14005177f
cmp dword [r15 + 0x20], 0x10
je 0x14005167d
mov rax, qword [rsp + 0x58]
mov ecx, dword [rax + 0xc]
mov rax, qword [r15]
mov edx, dword [rax]
imul edx, dword [rax + 4]
mov rax, qword [r15 + 0x18]
lea r8d, [rcx - 2]
test r8d, 0xfffffffd
jne 0x14005173e
cmp ecx, 2
je 0x140051758
test edx, edx
je 0x14005177f
movzx ecx, byte [rsp + 0x14d]
movzx r8d, byte [rsp + 0x14e]
movzx r9d, byte [rsp + 0x14f]
mov edx, edx
lea rdx, [rax + rdx*4]
jmp 0x140051895
mov rax, qword [rsp + 0x58]
mov ecx, dword [rax + 0xc]
mov rax, qword [r15]
mov edx, dword [rax]
imul edx, dword [rax + 4]
mov rax, qword [r15 + 0x18]
lea r8d, [rcx - 2]
test r8d, 0xfffffffd
jne 0x1400516ce
cmp ecx, 2
je 0x1400516e8
test edx, edx
je 0x14005177f
movzx ecx, word [rsp + 0x146]
movzx r8d, word [rsp + 0x148]
movzx r9d, word [rsp + 0x14a]
mov edx, edx
lea rdx, [rax + rdx*8]
jmp 0x140051723
mov r8d, 0x134c
lea rdx, str.external_stb_image.h
lea rcx, str.out_n__2__out_n__4
call qword [sym.imp.msvcrt.dll__assert]
test edx, edx
je 0x14005177f
movzx r8d, word [rsp + 0x146]
mov edx, edx
lea rcx, [rax + rdx*4]
cmp word [rax], r8w
setne dl
movzx edx, dl
neg edx
mov word [rax + 2], dx
add rax, 4
cmp rcx, rax
jne 0x1400516ff
jmp 0x14005177f
add rax, 8
cmp rdx, rax
je 0x14005177f
cmp word [rax], cx
jne 0x14005171a
cmp word [rax + 2], r8w
jne 0x14005171a
cmp word [rax + 4], r9w
jne 0x14005171a
mov word [rax + 6], 0
jmp 0x14005171a
mov r8d, 0x1333
lea rdx, str.external_stb_image.h
lea rcx, str.out_n__2__out_n__4
call qword [sym.imp.msvcrt.dll__assert]
test edx, edx
je 0x14005177f
movzx r8d, byte [rsp + 0x14d]
mov edx, edx
lea rcx, [rax + rdx*2]
cmp byte [rax], r8b
setne dl
neg edx
mov byte [rax + 1], dl
add rax, 2
cmp rcx, rax
jne 0x14005176b
cmp dword [rsp + 0x70], 0
je 0x14005179e
cmp dword [0x1401ec9e4], 0
je 0x14005179e
mov rax, qword [rsp + 0x58]
cmp dword [rax + 0xc], 2
jg 0x1400518ab
movzx eax, byte [rsp + 0x76]
test al, al
je 0x140051a30
movzx ebp, al
mov rsi, qword [rsp + 0x58]
mov dword [rsi + 8], ebp
cmp edi, 3
cmovl edi, ebp
mov dword [rsi + 0xc], edi
mov rax, qword [r15]
mov r12d, dword [rax]
imul r12d, dword [rax + 4]
mov rsi, qword [r15 + 0x18]
mov edx, edi
mov ecx, r12d
call sym.stbi__mul2sizes_valid
test eax, eax
je 0x1400519c2
mov ecx, edi
imul ecx, r12d
movsxd rcx, ecx
call sym.malloc
mov rbx, rax
test rax, rax
je 0x1400519c2
cmp edi, 3
je 0x1400519dd
test r12d, r12d
je 0x140051856
mov r8, rsi
mov r12d, r12d
lea r9, [rax + r12*4]
mov rdx, rax
movzx eax, byte [r8]
shl eax, 2
cdqe
movzx ecx, byte [rsp + rax + 0x150]
mov byte [rdx], cl
movzx ecx, byte [rsp + rax + 0x151]
mov byte [rdx + 1], cl
movzx ecx, byte [rsp + rax + 0x152]
mov byte [rdx + 2], cl
movzx eax, byte [rsp + rax + 0x153]
mov byte [rdx + 3], al
add rdx, 4
add r8, 1
cmp r9, rdx
jne 0x140051815
mov rcx, rsi
call sym.free
mov qword [r15 + 0x18], rbx
mov rcx, qword [r15 + 0x10]
call sym.free
mov qword [r15 + 0x10], 0
mov rcx, qword [rsp + 0x58]
call sym.stbi__get32be
mov r14d, 1
jmp 0x140050909
add rax, 4
cmp rdx, rax
je 0x14005177f
cmp byte [rax], cl
jne 0x140051888
cmp byte [rax + 1], r8b
jne 0x140051888
cmp byte [rax + 2], r9b
jne 0x140051888
mov byte [rax + 3], 0
jmp 0x140051888
mov rdx, qword [r15]
mov eax, dword [rdx]
imul eax, dword [rdx + 4]
mov rcx, qword [r15 + 0x18]
mov edx, dword [rdx + 0xc]
cmp edx, 3
je 0x1400518f6
cmp edx, 4
jne 0x140051923
cmp dword [0x1401ec9e8], 0
jne 0x14005193d
test eax, eax
je 0x14005179e
mov eax, eax
lea r8, [rcx + rax*4]
movzx eax, byte [rcx]
movzx edx, byte [rcx + 2]
mov byte [rcx], dl
mov byte [rcx + 2], al
add rcx, 4
cmp rcx, r8
jne 0x1400518dc
jmp 0x14005179e
test eax, eax
je 0x14005179e
mov eax, eax
imul rax, rax, 3
add rax, rcx
movzx edx, byte [rcx]
movzx r8d, byte [rcx + 2]
mov byte [rcx], r8b
mov byte [rcx + 2], dl
add rcx, 3
cmp rcx, rax
jne 0x140051907
jmp 0x14005179e
mov r8d, 0x13b8
lea rdx, str.external_stb_image.h
lea rcx, str.s__img_out_n__4
call qword [sym.imp.msvcrt.dll__assert]
test eax, eax
je 0x14005179e
mov eax, eax
lea r11, [rcx + rax*4]
jmp 0x140051964
movzx eax, byte [rcx + 2]
mov byte [rcx], al
mov byte [rcx + 2], r9b
add rcx, 4
cmp r11, rcx
je 0x14005179e
movzx r8d, byte [rcx + 3]
movzx r9d, byte [rcx]
test r8b, r8b
je 0x14005194d
mov r10d, r8d
shr r10b, 1
movzx r10d, r10b
movzx r8d, r8b
movzx edx, byte [rcx + 2]
mov eax, edx
shl eax, 8
sub eax, edx
add eax, r10d
cdq
idiv r8d
mov byte [rcx], al
movzx edx, byte [rcx + 1]
mov eax, edx
shl eax, 8
sub eax, edx
add eax, r10d
cdq
idiv r8d
mov byte [rcx + 1], al
movzx r9d, r9b
mov eax, r9d
shl eax, 8
sub eax, r9d
add eax, r10d
cdq
idiv r8d
mov r9d, eax
jmp 0x140051953
lea rax, str.outofmem
mov qword [0x1401ec9f0], rax
mov r14d, dword [rsp + 0x5a8]
jmp 0x140050909
test r12d, r12d
je 0x140051856
mov rcx, rsi
mov r9d, r12d
add r9, rsi
mov rdx, rax
movzx eax, byte [rcx]
shl eax, 2
cdqe
movzx r8d, byte [rsp + rax + 0x150]
mov byte [rdx], r8b
movzx r8d, byte [rsp + rax + 0x151]
mov byte [rdx + 1], r8b
movzx eax, byte [rsp + rax + 0x152]
mov byte [rdx + 2], al
add rdx, 3
add rcx, 1
cmp r9, rcx
jne 0x1400519f2
jmp 0x140051856
cmp byte [rsp + 0x77], 0
je 0x140051862
mov rax, qword [rsp + 0x58]
add dword [rax + 8], 1
jmp 0x140051862
mov r14d, 1
jmp 0x140050909
mov r14d, dword [rsp + 0x5a8]
jmp 0x140050909
lea rax, str.first_not_IHDR
mov qword [0x1401ec9f0], rax
mov r14d, 0
jmp 0x140050909
mov ecx, eax
shr ecx, 0x18
mov byte [str.XXXX_PNG_chunk_not_known], cl
mov ecx, eax
shr ecx, 0x10
mov byte [0x14018c681], cl
mov byte [0x14018c682], ah
mov byte [0x14018c683], al
lea rax, str.XXXX_PNG_chunk_not_known
mov qword [0x1401ec9f0], rax
jmp 0x140050909