Function at 0x403170
Capabilities:
Write file on windows

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x20
xor esi, esi
mov edi, ecx
mov rbx, rdx
call dbg.__main
lea rcx, str.DZX0_v1.5:_Data_decompressor_by_Einar_Saukas
call sym.puts
mov ecx, 1
cmp edi, 1
jle 0x403212
lea edx, [rdi - 2]
mov eax, 1
xor esi, esi
add rdx, 2
nop word [rax + rax]
mov rbp, qword [rbx + rax*8]
mov ecx, eax
cmp byte [rbp], 0x2d
jne 0x403207
cmp byte [rbp + 1], 0x66
je 0x4031f0
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8, rbp
lea rdx, str.Error:_Invalid_parameter__s_n
mov rcx, rax
call sym.fprintf
mov ecx, 1
call sym.exit
nop dword [rax]
cmp byte [rbp + 2], 0
jne 0x4031c2
add rax, 1
add ecx, 1
mov esi, 1
cmp rax, rdx
jne 0x4031b0
lea eax, [rcx + 1]
cmp eax, edi
je 0x40330a
lea eax, [rcx + 2]
cmp eax, edi
jne 0x40341b
movsxd rcx, ecx
mov rax, qword [rbx + rcx*8]
mov qword [0x004089d0], rax
mov rax, qword [rbx + rcx*8 + 8]
mov qword [0x00408978], rax
mov rcx, qword [0x004089d0]
lea rdx, [0x00405194]
call sym.fopen
mov qword [0x00408970], rax
test rax, rax
je 0x4033ed
test esi, esi
je 0x4032c4
mov rcx, qword [0x00408978]
lea rdx, [0x004051e8]
call sym.fopen
mov qword [0x004089b8], rax
test rax, rax
je 0x4033bf
call sym.decompress
mov rcx, qword [0x00408970]
call sym.fclose
mov rcx, qword [0x004089b8]
call sym.fclose
mov r8d, dword [0x004089a0]
mov edx, dword [0x00408988]
lea rcx, str.File_decompressed_from__lu_to__lu_bytes__n
call sym.printf
xor eax, eax
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
mov rcx, qword [0x00408978]
lea rdx, [0x00405194]
call sym.fopen
test rax, rax
je 0x40325e
mov rbx, qword [0x00408978]
mov ecx, 2
call qword [dbg.__acrt_iob_func]
lea rdx, str.Error:_Already_existing_output_file__s_n
mov rcx, rax
mov r8, rbx
call sym.fprintf
mov ecx, 1
call sym.exit
movsxd rcx, ecx
or r12, 0xffffffffffffffff
mov rbp, qword [rbx + rcx*8]
xor ebx, ebx
mov rcx, r12
mov eax, ebx
mov qword [0x004089d0], rbp
mov rdi, rbp
repne scasb al, byte [rdi]
not rcx
lea rax, [rcx - 1]
mov qword [0x00408988], rax
cmp rax, 4
jbe 0x403390
lea rcx, [rbp + rcx - 5]
lea rdx, str..zx0
call sym.strcmp
test eax, eax
jne 0x403390
mov eax, ebx
mov rcx, r12
mov rdi, rbp
repne scasb al, byte [rdi]
mov rbx, rcx
not rbx
sub rbx, 1
mov rcx, rbx
mov qword [0x00408988], rbx
call sym.malloc
mov rdx, rbp
mov rcx, rax
mov qword [0x00408978], rax
call sym.strcpy
mov byte [rax + rbx - 4], 0
jmp 0x403237
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8d, 0x24
mov edx, 1
lea rcx, str.Error:_Cannot_infer_output_filename_n
mov r9, rax
call sym.fwrite
mov ecx, 1
call sym.exit
mov rbx, qword [0x00408978]
mov ecx, 2
call qword [dbg.__acrt_iob_func]
lea rdx, str.Error:_Cannot_create_output_file__s_n
mov rcx, rax
mov r8, rbx
call sym.fprintf
mov ecx, 1
call sym.exit
mov rbx, qword [0x004089d0]
mov ecx, 2
call qword [dbg.__acrt_iob_func]
lea rdx, str.Error:_Cannot_access_input_file__s_n
mov rcx, rax
mov r8, rbx
call sym.fprintf
mov ecx, 1
call sym.exit
mov rbx, qword [rbx]
mov ecx, 2
call qword [dbg.__acrt_iob_func]
lea rdx, str.Usage:__s___f__input.zx0__output__n___f______Force_overwrite_of_output_file_n
mov rcx, rax
mov r8, rbx
call sym.fprintf
mov ecx, 1
call sym.exit
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop