Function at 0x14000d170
Capabilities:
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x38
mov rdi, rdx
mov rsi, rcx
cmp dword [rcx + 0x818], 0
je 0x14000d27b
mov rcx, rdi
call fcn.140021cf0
mov rcx, rdi
mov rdx, rax
call fcn.1400104c0
movzx eax, al
lea rbx, [rsi + rax*8]
add rbx, 0x10
mov rbx, qword [rbx]
test rbx, rbx
je 0x14000d1c9
lea rcx, [rbx + 0x14]
mov rdx, rdi
call fcn.140021870
test eax, eax
jne 0x14000d1b1
mov r14d, dword [rbx + 0xc]
test r14d, r14d
je 0x14000d49a
mov edi, dword [rbx + 8]
mov ecx, 0x10
call fcn.140021688
test rax, rax
je 0x14000d474
mov qword [rax], 0
mov dword [rax + 8], edi
mov dword [rax + 0xc], r14d
mov r8, qword [rsi + 0x810]
test r8, r8
je 0x14000d4ae
lea ecx, [r14 + rdi]
dec ecx
mov rdx, r8
mov r9d, dword [r8 + 8]
mov r8d, dword [r8 + 0xc]
add r8d, r9d
dec r8d
cmp r9d, edi
ja 0x14000d22f
cmp r8d, edi
jae 0x14000d46c
cmp r8d, edi
setb r10b
cmp ecx, r9d
setb r11b
cmp ecx, r8d
seta sil
cmp r9d, edi
setb r9b
and r9b, sil
or r9b, r11b
cmp r8d, ecx
seta r8b
cmp r9b, 1
jne 0x14000d46c
or r10b, r8b
je 0x14000d46c
mov r8, qword [rdx]
test r8, r8
jne 0x14000d210
mov qword [rdx], rax
jmp 0x14000d49a
mov rcx, qword [rsi + 8]
cmp rcx, 4
jb 0x14000d498
mov rax, qword [rsi]
xor ebx, ebx
cmp dword [rax], 0x3152414d
jne 0x14000d49a
and rcx, 0xfffffffffffffffc
cmp rcx, 4
je 0x14000d49a
mov ecx, dword [rax + 4]
call qword [sym.imp.WS2_32.dll_ntohl]
mov r14d, eax
mov rax, qword [rsi + 8]
xor ebx, ebx
cmp rax, r14
cmovb r14, rbx
jb 0x14000d49a
xor ebx, ebx
cmp rax, 4
jb 0x14000d49a
add rax, 0xfffffffffffffffc
cmp r14, rax
ja 0x14000d49a
mov rax, qword [rsi]
mov ecx, dword [rax + r14]
call qword [sym.imp.WS2_32.dll_ntohl]
mov r15d, eax
mov rcx, r15
call fcn.140021688
mov qword [rsp + 0x28], rax
test rax, rax
je 0x14000d498
mov rax, qword [rsi + 8]
sub rax, r15
jb 0x14000d4b7
add r14, 4
cmp r14, rax
ja 0x14000d4b7
add r14, qword [rsi]
mov rbx, qword [rsp + 0x28]
mov rcx, rbx
mov rdx, r14
mov r8, r15
call fcn.1400264b0
mov r14, rbx
add r14, r15
test r15, r15
je 0x14000d4c8
lea r15, [r14 - 1]
mov rbx, qword [rsp + 0x28]
mov qword [rsp + 0x20], r14
mov rax, r14
sub rax, rbx
cmp rax, 0xe
jl 0x14000d4c8
mov ecx, dword [rbx]
mov ebp, dword [rbx + 4]
mov r12d, dword [rbx + 8]
lea r14, [rbx + 0xc]
mov r13, qword [sym.imp.WS2_32.dll_ntohl]
call r13
mov dword [rsp + 0x34], eax
mov ecx, ebp
call r13
mov ebp, eax
mov ecx, r12d
call r13
cmp byte [rbx + 0xc], 0
mov rbx, r14
je 0x14000d3ad
mov rcx, r14
cmp rcx, r15
je 0x14000d4b7
lea rbx, [rcx + 1]
cmp byte [rcx + 1], 0
mov rcx, rbx
jne 0x14000d397
cmp rbx, qword [rsp + 0x20]
je 0x14000d4c3
mov dword [rsp + 0x30], ebp
mov rbp, rbx
sub rbp, r14
mov ecx, ebp
and ecx, 0x80000000
jne 0x14000d4c3
mov r13d, eax
inc rbx
mov ecx, ebp
add rcx, 0x18
call fcn.140021688
test rax, rax
je 0x14000d4c3
mov r12, rax
mov qword [rax], 0
mov eax, dword [rsp + 0x34]
mov dword [r12 + 8], eax
mov eax, dword [rsp + 0x30]
mov dword [r12 + 0xc], eax
mov dword [r12 + 0x10], r13d
mov rcx, r12
add rcx, 0x14
inc ebp
mov rdx, r14
mov r8, rbp
call fcn.1400264b0
mov rcx, r14
call fcn.140021cf0
mov rcx, r14
mov rdx, rax
call fcn.1400104c0
movzx ecx, al
mov rax, qword [rsi + rcx*8 + 0x10]
test rax, rax
je 0x14000d451
mov r14, qword [rsp + 0x20]
mov rcx, rax
mov rax, qword [rax]
test rax, rax
jne 0x14000d444
jmp 0x14000d45e
lea rcx, [rsi + rcx*8]
add rcx, 0x10
mov r14, qword [rsp + 0x20]
mov qword [rcx], r12
cmp rbx, r14
jb 0x14000d353
jmp 0x14000d4c8
mov rcx, rax
call fcn.140021114
mov ecx, 2
call fcn.140015d78
lea rcx, str.ERROR:_file_content_collision_in_mar_find_item___n
mov edx, 0x31
mov r8d, 1
mov r9, rax
call fcn.140021128
xor ebx, ebx
mov rax, rbx
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov qword [rsi + 0x810], rax
jmp 0x14000d49a
mov rcx, qword [rsp + 0x28]
call fcn.140021114
jmp 0x14000d498
mov r14, qword [rsp + 0x20]
mov rcx, qword [rsp + 0x28]
call fcn.140021114
cmp rbx, r14
jne 0x14000d498
mov dword [rsi + 0x818], 1
jmp 0x14000d193