Function at 0x180051180
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], r8
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x50
lea esi, [rdx - 0xd]
mov rdi, r9
mov dword [rbp - 0x18], esi
mov rbx, rcx
cmp edx, esi
jbe case.0x1800511f5.7
movzx r14d, word [rbp + 0x48]
lea r13d, [rdx - 0xb3]
xor r15d, r15d
lea rdx, [0x180000000]
lea r9, [0x180044830]
lea r10, [0x180096ae8]
lea r12, [r15 - 1]
nop dword [rax + rax]
cmp r13d, 0x1b
ja case.0x1800511f5.1
mov ecx, dword [rdx + r13*4 + 0x515ec]
add rcx, rdx
jmp rcx
cmp dword [r8], r15d
jne 0x180051218
movzx eax, word [rbx]
lea rcx, [rbp + 0x48]
mov r9d, VarR8FromI2
mov word [rbp + 0x48], ax
xor r8d, r8d
mov rdx, rdi
call fcn.180019bc0
movzx eax, word [rbx + 2]
jmp 0x18005156b
mov qword [rbx + 0x90], r9
jmp case.0x1800511f5.1
mov dword [rbp - 0x10], r15d
jmp case.0x1800511f5.1
mov eax, dword [rbx + 0x10]
lea r9, [rbp + 0x48]
mov qword [rsp + 0x28], r15
xor r8d, r8d
xor edx, edx
mov dword [rbp + 0x48], eax
mov ecx, 0xa8
mov qword [rsp + 0x20], rdi
call fcn.180028660
mov eax, dword [rbx + 0x14]
lea r9, [rbp + 0x48]
xor r8d, r8d
mov qword [rsp + 0x28], r15
xor edx, edx
mov dword [rbp + 0x48], eax
mov ecx, 0xa8
mov qword [rsp + 0x20], rdi
call fcn.180028660
mov eax, dword [rbx + 0x18]
lea r9, [rbp + 0x48]
xor r8d, r8d
mov qword [rsp + 0x28], r15
xor edx, edx
mov dword [rbp + 0x48], eax
mov ecx, 0xa8
mov qword [rsp + 0x20], rdi
call fcn.180028660
mov r9d, VarR8FromI2
mov word [rbp + 0x48], r14w
xor r8d, r8d
lea rcx, [rbp + 0x48]
mov rdx, rdi
call fcn.180019bc0
movzx eax, word [rbx + 0x78]
jmp 0x18005156b
cmp dword [r8], r15d
jne 0x1800513a3
mov esi, 0xc5
mov eax, esi
sub eax, 0xc2
je 0x18005134c
sub eax, 1
je 0x18005132d
sub eax, 1
je 0x18005130e
cmp eax, 1
jne 0x180051392
movzx eax, word [rbx + 0x68]
lea rcx, [rbp + 0x48]
mov r9d, VarR8FromI2
mov word [rbp + 0x48], ax
xor r8d, r8d
mov rdx, rdi
call fcn.180019bc0
jmp 0x180051392
movzx eax, word [rbx + 0x1c]
lea rcx, [rbp + 0x48]
mov r9d, VarR8FromI2
mov word [rbp + 0x48], ax
xor r8d, r8d
mov rdx, rdi
call fcn.180019bc0
jmp 0x180051392
movzx eax, word [rbx + 0x1e]
lea rcx, [rbp + 0x48]
mov r9d, VarR8FromI2
mov word [rbp + 0x48], ax
xor r8d, r8d
mov rdx, rdi
call fcn.180019bc0
jmp 0x180051392
mov eax, dword [rbx + 0x20]
lea r9, [rbp + 0x48]
mov qword [rsp + 0x28], r15
xor r8d, r8d
xor edx, edx
mov dword [rbp + 0x48], eax
mov ecx, 0xa8
mov qword [rsp + 0x20], rdi
call fcn.180028660
mov eax, dword [rbx + 0x24]
lea r9, [rbp + 0x48]
xor r8d, r8d
mov qword [rsp + 0x28], r15
xor edx, edx
mov dword [rbp + 0x48], eax
mov ecx, 0xa8
mov qword [rsp + 0x20], rdi
call fcn.180028660
dec esi
cmp esi, 0xc1
ja 0x1800512d0
mov esi, dword [rbp - 0x18]
test r14w, r14w
je 0x1800513be
mov rcx, qword [rbx + 0x58]
mov r9, rdi
movzx r8d, r14w
mov edx, 1
call fcn.18006bd00
movzx eax, word [rbx + 0x78]
test ax, ax
je 0x180051584
mov rcx, qword [rbx + 0x70]
mov r8d, eax
mov r9, rdi
mov edx, 1
call fcn.18006bd00
jmp 0x180051584
mov eax, dword [r8]
lea r9, [rbp + 0x48]
xor r8d, r8d
mov qword [rsp + 0x28], rbx
xor edx, edx
mov dword [rbp + 0x48], eax
mov rcx, rdi
mov dword [rsp + 0x20], 0xc1
call fcn.180021450
jmp 0x180051584
mov rax, qword [rbx + 0x58]
mov r14, r12
inc r14
cmp byte [rax + r14], r15b
jne 0x180051414
cmp dword [r8], r15d
lea rcx, [0x180096af0]
mov edx, 1
mov r9, rdi
cmovne rcx, r10
lea r8d, [rdx + 3]
call fcn.18006bd00
jmp 0x180051584
cmp dword [r8], r15d
jne 0x180051463
movzx eax, word [rbx + 0x68]
test ax, ax
je 0x180051463
mov rcx, qword [rbx + 0x60]
mov r8d, eax
mov r9, rdi
mov edx, 1
call fcn.18006bd00
mov rcx, rdi
call fcn.180066040
test eax, eax
je 0x180051584
call fcn.18006be3c
mov rcx, qword [rbp + 0x60]
lea r8, [rbp + 0x48]
mov r9d, 0x112
mov edx, dword [rax]
mov dword [rbp - 0x18], edx
lea rdx, [rbp - 0x18]
mov dword [rbp + 0x48], 6
call fcn.18002d330
mov dword [rbp - 0x10], r12d
mov rax, qword [rbp - 0x10]
mov rbx, qword [rsp + 0x90]
add rsp, 0x50
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov rax, qword [rbp + 0x60]
lea rcx, [rbx + 0x98]
cmp rcx, rax
je case.0x1800511f5.1
cmp qword [rax + 0x18], 0x10
mov rdx, rax
jb 0x1800514dc
mov rdx, qword [rax]
mov r8, qword [rax + 0x10]
call fcn.180055dc0
jmp 0x180051584
movzx eax, word [rbx + 4]
lea rcx, [rbp + 0x48]
mov r9d, VarR8FromI2
mov word [rbp + 0x48], ax
xor r8d, r8d
mov rdx, rdi
call fcn.180019bc0
movzx eax, word [rbx + 0x54]
lea rcx, [rbp + 0x48]
mov r9d, VarR8FromI2
mov word [rbp + 0x48], ax
xor r8d, r8d
mov rdx, rdi
call fcn.180019bc0
mov rax, qword [rbx + 8]
lea r8, [rbp - 8]
mov qword [rbp - 8], rax
lea rdx, [rbp - 0x1c]
lea rax, [rbp - 0x20]
mov r9d, 0x44
xor ecx, ecx
mov qword [rsp + 0x20], rax
call fcn.18003fe30
movzx eax, word [rbp - 0x20]
lea rcx, [rbp + 0x48]
mov r9d, VarR8FromI2
mov word [rbp + 0x48], ax
xor r8d, r8d
mov rdx, rdi
call fcn.180019bc0
movzx eax, word [rbp - 0x1c]
mov r9d, VarR8FromI2
mov word [rbp + 0x48], ax
xor r8d, r8d
lea rcx, [rbp + 0x48]
mov rdx, rdi
call fcn.180019bc0
mov r8, qword [rbp + 0x50]
lea rdx, [0x180000000]
lea r9, [0x180044830]
lea r10, [0x180096ae8]
dec r13d
lea eax, [r13 + 0xb3]
cmp eax, esi
ja 0x1800511e0
jmp case.0x1800511f5.7
mov rcx, qword [rbx]
test rcx, rcx
je 0x1800515d9
nop dword [rax]
cmp byte [rcx + r12 + 1], r15b
lea r12, [r12 + 1]
jne 0x1800515c0
lea rdx, [r12 + 1]
call fcn.180066c40
mov r15, rax
mov rcx, rbx
call fcn.18006c3d8
mov rax, r15
jmp 0x1800514a3