Function at 0x4020a0
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
mov qword [0x007820a0], 0
mov eax, dword [rsp + 0xb8]
mov r14d, ecx
mov ecx, dword [rsp + 0xc0]
mov qword [rsp + 0xa0], r8
mov r13d, edx
mov qword [rsp + 0xa8], r9
test ecx, ecx
je 0x402210
mov edx, dword [rsp + 0xb0]
lea edi, [rax*4 + 1]
test edx, edx
jne 0x402223
mov rsi, qword [0x00782088]
test rsi, rsi
je 0x402370
movsxd rbx, edi
mov rdx, rsi
mov rax, qword [0x007820c0]
imul rdx, rbx
cmp rdx, rax
jae 0x40250d
imul edi, esi
xor r8d, r8d
mov ecx, r14d
mov edx, edi
call sym.lseek
imul rbx, qword [0x00782088]
movsxd rsi, eax
cmp rbx, rsi
jne 0x4024bf
mov eax, dword [rsp + 0xc0]
test eax, eax
jne 0x4023c0
mov edi, dword [rsp + 0xb8]
shl edi, 0x10
lea ecx, [rdi + 0x1b]
mov rdi, rcx
mov rax, qword [0x007820b8]
xor edx, edx
xor r14d, r14d
xor ebx, ebx
lea rbp, [rsp + 0x37]
div rcx
mov r15, rax
mov r12d, eax
test eax, eax
jne 0x4021cb
jmp 0x4023e0
mov r8d, 8
mov rdx, rbp
mov ecx, r13d
call sym.read
cmp eax, 8
jne 0x402468
mov rax, qword [rsp + 0x37]
cmp qword [0x00782088], rax
jb 0x4023d0
add ebx, 1
add r14d, edi
cmp r12d, ebx
je 0x4023e0
xor r8d, r8d
mov edx, r14d
mov ecx, r13d
call sym.lseek
cmp r14d, eax
je 0x402190
imul edi, r15d
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8d, edi
lea rdx, str.Could_not_set_LUT_stream_file_read_position_to_first_sample_read_postion__u._n
mov rcx, rax
call sym.fprintf__iobuf__char_const__::_
mov eax, 0xffffffff
jmp 0x402358
mov edx, dword [rsp + 0xb0]
lea edi, [rax + rax + 1]
test edx, edx
je 0x4020fd
xor r8d, r8d
xor edx, edx
mov ecx, r14d
call sym.lseek
test eax, eax
jne 0x402385
mov r12d, dword [rsp + 0xb8]
xor esi, esi
xor ebx, ebx
xor r15d, r15d
lea rbp, [rsp + 0x37]
movsxd rdi, edi
shl r12d, 0x10
add r12d, 0x14
movsxd r12, r12d
jmp 0x402294
cmp edx, 0xfd
je 0x4023b0
add rbx, 1
add rsi, rdi
cmp qword [0x00782088], rbx
je 0x4022e0
xor r8d, r8d
mov edx, esi
mov ecx, r14d
call sym.lseek
cdqe
cmp rax, rsi
jne 0x402498
mov r8d, 1
mov rdx, rbp
mov ecx, r14d
call sym.read
test eax, eax
jle 0x4022e0
movsx eax, byte [rsp + 0x37]
movzx edx, al
and eax, 0xfe
cmp eax, 0xfe
jne 0x402260
cmp edx, 0xff
jne 0x4023b0
mov r15, rsi
add rsi, 0x3000f
cmp qword [0x00782088], rbx
jne 0x40227c
nop dword [rax]
xor r8d, r8d
mov edx, r15d
mov ecx, r14d
call sym.lseek
cdqe
cmp rax, r15
jne 0x4024e6
mov eax, dword [rsp + 0xc0]
mov r9d, dword [rsp + 0xb0]
mov ecx, r14d
mov r8, qword [rsp + 0xa8]
mov rdx, qword [rsp + 0xa0]
mov dword [rsp + 0x28], eax
mov eax, dword [rsp + 0xb8]
mov dword [rsp + 0x20], eax
call sym.read_lut_int__int__unsigned_char__int__int__int_
test eax, eax
js 0x40253f
xor r8d, r8d
mov edx, esi
mov ecx, r14d
call sym.lseek
cdqe
cmp rax, rsi
jne 0x402566
mov qword [0x007820b0], rsi
xor eax, eax
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
xor r8d, r8d
xor edx, edx
mov ecx, r14d
call sym.lseek
test eax, eax
je 0x40214b
mov ecx, 2
call qword [dbg.__acrt_iob_func]
lea rdx, str.Could_not_set_read_position_to_start_of_file._n
mov rcx, rax
call sym.fprintf__iobuf__char_const__::_
mov eax, 0xffffffff
jmp 0x402358
mov r15, rsi
add rsi, r12
jmp 0x402273
mov ecx, 0x21
mov edi, 0x21
jmp 0x40216a
sub ebx, 1
cmp r15d, ebx
ja 0x4023e4
nop dword [rax + rax]
lea ebx, [r15 - 1]
imul edi, ebx
xor r8d, r8d
mov ecx, r13d
mov edx, edi
call sym.lseek
cmp edi, eax
jne 0x4021e2
mov eax, edi
mov r8, qword [rsp + 0xa8]
xor r9d, r9d
mov ecx, r13d
mov qword [0x007820a8], rax
mov eax, dword [rsp + 0xc0]
mov rdx, qword [rsp + 0xa0]
mov dword [rsp + 0x28], eax
mov eax, dword [rsp + 0xb8]
mov dword [rsp + 0x20], eax
call sym.read_lut_int__int__unsigned_char__int__int__int_
test eax, eax
jns 0x40234f
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8d, edi
lea rdx, str.Error_reading_first_LUT_at_position__u_n
mov rcx, rax
call sym.fprintf__iobuf__char_const__::_
mov eax, 0xffffffff
jmp 0x402358
imul edi, r15d
mov ecx, 2
call qword [dbg.__acrt_iob_func]
lea rdx, str.Could_not_read_8_bytes_from_lut_streamfile_at_position__u._n
mov rcx, rax
mov r8d, edi
call sym.fprintf__iobuf__char_const__::_
mov eax, 0xffffffff
jmp 0x402358
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8, rsi
lea rdx, str.Could_not_set_read_position_to__llu._n
mov rcx, rax
call sym.fprintf__iobuf__char_const__::_
mov eax, 0xffffffff
jmp 0x402358
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8, rbx
lea rdx, str.Could_not_set_read_position_to_first_sample_read_postion__llu._n
mov rcx, rax
call sym.fprintf__iobuf__char_const__::_
mov eax, 0xffffffff
jmp 0x402358
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8, r15
lea rdx, str.Could_not_set_last_LUT_read_position_to__llu._n
mov rcx, rax
call sym.fprintf__iobuf__char_const__::_
mov eax, 0xffffffff
jmp 0x402358
xor edx, edx
mov ecx, 2
div rbx
mov r12, rax
call qword [dbg.__acrt_iob_func]
mov r9, r12
mov r8, rsi
lea rdx, str.Sample_index_for_the_start_of_conversion_above_overall_sample_count_of_file:__llu____llu__aborting._n
mov rcx, rax
call sym.fprintf__iobuf__char_const__::_
mov eax, 0xffffffff
jmp 0x402358
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8, r15
lea rdx, str.Error_reading_first_LUT_at_position__llu_n
mov rcx, rax
call sym.fprintf__iobuf__char_const__::_
mov eax, 0xffffffff
jmp 0x402358
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8, rsi
lea rdx, str.Could_not_set_read_position_to_first_sample_read_position__llu._n
mov rcx, rax
call sym.fprintf__iobuf__char_const__::_
mov eax, 0xffffffff
jmp 0x402358