Function at 0x140118430
Capabilities:
Read file on windows

Disassembly:
push rbx
push rbp
push rsi
push r12
push r13
push r14
push r15
sub rsp, 0x70
mov rax, qword [0x1402a83b0]
xor rax, rsp
mov qword [rsp + 0x60], rax
xor ebx, ebx
mov r12, rdx
mov rsi, rcx
lea rdx, [0x140264ea4]
mov rcx, r12
mov qword [rsp + 0x50], rbx
mov dword [rsp + 0x58], ebx
mov r14d, ebx
mov ebp, ebx
mov r15d, ebx
call fcn.1401be7e4
mov r13, rax
mov qword [rsp + 0x40], rax
test rax, rax
jne 0x140118491
mov rcx, r12
call fcn.1401c5e04
jmp 0x140118797
mov rcx, rax
mov qword [rsp + 0xc0], rdi
call fcn.1401c3f28
cmp eax, 0x50
jne 0x14011876f
mov rcx, r13
call fcn.1401c3f28
cmp eax, 0x35
jne 0x14011876f
mov rdi, rbx
nop
cmp rdi, 3
jge 0x14011853c
mov rcx, r13
call fcn.1401c3f28
mov ebx, eax
cmp eax, 0xffffffff
je 0x14011853c
cmp eax, 0x23
jne 0x1401184e0
lea r14d, [rax - 0x22]
jmp 0x1401184c0
cmp eax, 0xa
jne 0x1401184ea
xor r14d, r14d
jmp 0x1401184ef
test r14d, r14d
jne 0x1401184c0
mov ecx, eax
call fcn.1401c3560
test eax, eax
je 0x140118501
mov ebp, 1
jmp 0x140118505
test ebp, ebp
je 0x1401184c0
mov ecx, ebx
call fcn.1401c3560
test eax, eax
je 0x140118523
mov eax, dword [rsp + rdi*4 + 0x50]
lea eax, [rax + rax*4]
lea eax, [rax - 0x18]
lea eax, [rbx + rax*2]
mov dword [rsp + rdi*4 + 0x50], eax
jmp 0x1401184c0
mov ecx, ebx
call fcn.1401c36dc
test eax, eax
je 0x14011876f
xor ebp, ebp
inc r15d
inc rdi
jmp 0x1401184c0
cmp r15d, 3
jl 0x14011876f
movzx ecx, word [rsi + 0x44f6]
cmp dword [rsp + 0x50], ecx
jne 0x140118761
movzx eax, word [rsi + 0x44f4]
cmp dword [rsp + 0x54], eax
jne 0x140118761
cmp dword [rsp + 0x58], 0xffff
jne 0x140118761
mov edx, 2
call fcn.1401be1f8
lea r8, str.subtract__
mov rcx, rsi
mov rdx, rax
mov rbx, rax
mov qword [rsp + 0x50], rax
call fcn.140106a20
xor edi, edi
mov r12d, edi
mov dword [rsp + 0x20], edi
cmp di, word [rsi + 0x44f4]
jae 0x140118735
movzx r8d, word [rsi + 0x44f6]
mov r9, r13
mov edx, 2
mov rcx, rbx
call fcn.1401c1e14
mov ebp, edi
cmp di, word [rsi + 0x44f6]
jae 0x14011871d
mov eax, r12d
mov r14, rbx
and eax, 7
add eax, eax
mov dword [rsp + 0x28], eax
mov eax, r12d
and eax, 7
lea r8d, [rax + rax]
movsxd rax, r12d
mov r12d, dword [rsp + 0x28]
mov dword [rsp + 0x30], r8d
mov qword [rsp + 0x38], rax
movzx ecx, word [rsi + 0x44fc]
mov ebx, dword [rsi + 0x3d0]
mov r15, qword [rsi + 0x4510]
mov rdi, rax
movzx eax, word [rsi + 0x4500]
movsxd rdx, ebp
sar rdi, cl
mov r13d, ebp
mov qword [rsp + 0x48], rdx
and r13d, 1
imul rdi, rax
mov rax, rdx
sar rax, cl
movzx ecx, word [r14]
add rdi, rax
lea eax, [r8 + r13]
add eax, eax
shl rdi, 2
cdqe
mov qword [rsp + 0x28], rax
call fcn.140065f90
mov rcx, qword [rsp + 0x28]
movzx edx, ax
mov eax, ebx
shr rax, cl
and eax, 3
add rax, rdi
movzx eax, word [r15 + rax*2]
sub eax, edx
test eax, eax
jle 0x1401186d3
movzx ecx, word [rsi + 0x44fc]
movzx eax, word [rsi + 0x4500]
mov rdi, qword [rsp + 0x38]
mov ebx, dword [rsi + 0x3d0]
mov r15, qword [rsi + 0x4510]
sar rdi, cl
imul rdi, rax
mov rax, qword [rsp + 0x48]
sar rax, cl
movzx ecx, word [r14]
add rdi, rax
shl rdi, 2
call fcn.140065f90
mov rcx, qword [rsp + 0x28]
movzx edx, ax
mov eax, ebx
shr rax, cl
and eax, 3
add rax, rdi
movzx r8d, word [r15 + rax*2]
sub r8d, edx
jmp 0x1401186d8
xor eax, eax
mov r8d, eax
lea eax, [r12 + r13]
inc ebp
add r14, 2
lea ecx, [rax + rax]
shr rbx, cl
and ebx, 3
add rbx, rdi
mov word [r15 + rbx*2], r8w
movzx eax, word [rsi + 0x44f6]
mov r8d, dword [rsp + 0x30]
cmp ebp, eax
mov rax, qword [rsp + 0x38]
jl 0x140118602
mov r12d, dword [rsp + 0x20]
mov r13, qword [rsp + 0x40]
mov rbx, qword [rsp + 0x50]
xor edi, edi
movzx eax, word [rsi + 0x44f4]
inc r12d
mov dword [rsp + 0x20], r12d
cmp r12d, eax
jl 0x1401185b0
mov rcx, rbx
call fcn.1401be23c
mov rcx, r13
call fcn.1401be6a4
lea rcx, [rsi + 0x428]
xor edx, edx
mov r8d, 0x4018
call fcn.1401c0040
mov dword [rsi + 0x424], edi
jmp 0x14011878f
call fcn.1401be514
lea rdx, str._s_has_the_wrong_dimensions__n
jmp 0x14011877b
call fcn.1401be514
lea rdx, str._s_is_not_a_valid_PGM_file__n
lea rcx, [rax + 0x60]
mov r8, r12
call fcn.1401be844
mov rcx, r13
call fcn.1401be6a4
mov rdi, qword [rsp + 0xc0]
mov rcx, qword [rsp + 0x60]
xor rcx, rsp
call fcn.1401bd600
add rsp, 0x70
pop r15
pop r14
pop r13
pop r12
pop rsi
pop rbp
pop rbx
ret