Function at 0x403650
Capabilities:
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov rdi, qword [0x00506000]
test byte [rdi], 2
mov rsi, rcx
jne 0x403725
mov eax, dword [rsi + 0xdc]
lea edx, [rax + 1]
cmp edx, 1
jbe 0x403692
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
test eax, eax
mov edx, dword [0x00513064]
jne 0x4037b0
mov eax, dword [0x00513068]
add edx, 1
mov dword [0x00513064], edx
mov rcx, qword [0x00513070]
cmp edx, eax
jge 0x403780
movsxd rax, edx
shl rax, 4
add rax, rcx
mov qword [rax], rsi
mov dword [rax + 8], edx
mov eax, dword [rdi]
mov dword [rsi + 0xdc], 0xffffffff
test al, 2
jne 0x403750
mov rbx, qword [rsi + 0x120]
test rbx, rbx
je 0x40370c
nop word [rax + rax]
mov rcx, qword [rbx + 8]
call fcn.00403650
mov rbx, qword [rbx + 0x30]
test rbx, rbx
jne 0x4036f0
mov eax, dword [rdi]
test al, 2
jne 0x4039d2
cmp rsi, qword [rsi + 0x108]
je 0x403a22
sub dword [0x00513064], 1
jmp 0x403681
lea rcx, str._dfn__dfn_
call sub.msvcrt.dll_printf
mov rcx, rsi
call fcn.0040ad30
lea rcx, [0x004c950c]
call sub.msvcrt.dll_puts
jmp 0x403673
lea rcx, str._pre_visit__t_t_d:
call sub.msvcrt.dll_printf
mov rcx, rsi
call fcn.0040ad30
mov ecx, 0xa
call fcn.004c16a8
mov rbx, qword [rsi + 0x120]
test rbx, rbx
jne 0x4036f0
jmp 0x403702
sub eax, 0xffffff80
movsxd rdx, eax
mov dword [0x00513068], eax
shl rdx, 4
call fcn.004be670
mov edx, dword [0x00513064]
mov rcx, rax
mov qword [0x00513070], rax
jmp 0x4036be
test edx, edx
jle 0x4039a3
mov r9, qword [0x00513070]
movsxd rax, edx
shl rax, 4
mov rbp, qword [r9 + rax]
cmp rsi, rbp
je 0x403a83
mov rcx, qword [rsi + 0x108]
cmp rsi, rcx
setne r8b
cmp rcx, rbp
jne 0x4037ef
test r8b, r8b
jne 0x403a83
lea rax, [r9 + rax - 0x10]
mov ebx, edx
nop word cs:[rax + rax]
sub ebx, 1
je 0x4039a3
mov rbp, qword [rax]
cmp rsi, rbp
je 0x40381f
sub rax, 0x10
cmp rbp, rcx
jne 0x403800
test r8b, r8b
je 0x403800
test byte [rdi], 2
jne 0x403a90
cmp ebx, edx
je 0x403681
cmp qword [rbp + 0x110], 0
mov rsi, rbp
lea r12, str._find_cycle__tail
jne 0x403861
jmp 0x403882
mov rsi, qword [rsi + 0x110]
cmp qword [rsi + 0x110], 0
je 0x403882
test byte [rdi], 2
je 0x403850
mov rcx, r12
call sub.msvcrt.dll_printf
mov rcx, rsi
call fcn.0040ad30
mov ecx, 0xa
call fcn.004c16a8
jmp 0x403850
mov r14, qword [rbp + 0x108]
cmp r14, rbp
je 0x403897
test byte [rdi], 2
jne 0x403b10
add ebx, 1
cmp ebx, dword [0x00513064]
jg 0x403681
lea r13, str._find_cycle__and_its_tail
movsxd r15, ebx
lea r12, str._onto
shl r15, 4
jmp 0x4038dc
cmp r14, rbp
jne 0x403b33
add ebx, 1
add r15, 0x10
cmp ebx, dword [0x00513064]
jg 0x403681
mov rax, qword [0x00513070]
mov rax, qword [rax + r15]
mov rbp, qword [rax + 0x108]
cmp rax, rbp
jne 0x4038c0
test byte [rdi], 2
mov qword [rsi + 0x110], rbp
mov qword [rbp + 0x108], r14
jne 0x403970
mov rax, qword [rbp + 0x110]
mov rsi, rbp
test rax, rax
jne 0x403933
jmp 0x4038c9
mov rsi, qword [rsi + 0x110]
mov rax, qword [rsi + 0x110]
test rax, rax
je 0x4038c9
test byte [rdi], 2
mov qword [rax + 0x108], r14
je 0x403920
mov rcx, r13
call sub.msvcrt.dll_printf
mov rcx, qword [rsi + 0x110]
call fcn.0040ad30
mov rcx, r12
call sub.msvcrt.dll_printf
mov rcx, r14
call fcn.0040ad30
mov ecx, 0xa
call fcn.004c16a8
jmp 0x403920
lea rcx, str._find_cycle__glomming
call sub.msvcrt.dll_printf
mov rcx, rbp
call fcn.0040ad30
mov rcx, r12
call sub.msvcrt.dll_printf
mov rcx, r14
call fcn.0040ad30
mov ecx, 0xa
call fcn.004c16a8
jmp 0x403906
mov ecx, 2
call qword [fcn.004c1900]
mov r8d, 0x29
mov edx, 1
lea rcx, str._find_cycle__couldnt_find_head_of_cycle_n
mov r9, rax
call sub.msvcrt.dll_fwrite
mov ecx, 1
call fcn.00408200
mov edx, dword [0x00513064]
lea rcx, str._post_visit__t_d:
call sub.msvcrt.dll_printf
mov rcx, rsi
call fcn.0040ad30
mov ecx, 0xa
call fcn.004c16a8
cmp rsi, qword [rsi + 0x108]
je 0x403a20
test byte [rdi], 2
je 0x403719
lea rcx, str._post_visit__t_tis_part_of_a_cycle
call sub.msvcrt.dll_puts
jmp 0x403719
mov eax, dword [rdi]
mov edx, dword [0x00513060]
lea rbp, str._post_visit__t_tmember
lea rbx, str.___cg.top_order___d_n
add edx, 1
mov dword [0x00513060], edx
jmp 0x403a59
mov rsi, qword [rsi + 0x110]
test rsi, rsi
je 0x403719
mov edx, dword [0x00513060]
mov eax, dword [rdi]
test al, 2
mov dword [rsi + 0xdc], edx
je 0x403a41
mov rcx, rbp
call sub.msvcrt.dll_printf
mov rcx, rsi
call fcn.0040ad30
mov edx, dword [0x00513060]
mov rcx, rbx
call sub.msvcrt.dll_printf
jmp 0x403a41
test byte [rdi], 2
je 0x403681
mov ebx, edx
nop
lea rcx, str._find_cycle__dfn_depth__d_cycle_top__d
mov r8d, ebx
call sub.msvcrt.dll_printf
test rbp, rbp
je 0x403b00
mov rcx, rbp
call fcn.0040ad30
mov ecx, 0xa
call fcn.004c16a8
cmp dword [0x00513064], ebx
jne 0x403830
test byte [rdi], 2
je 0x403681
lea rcx, str._find_cycle_
call sub.msvcrt.dll_printf
mov rcx, rsi
call fcn.0040ad30
mov ecx, 0xa
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp fcn.004c16a8
lea rcx, [0x004c9548]
call sub.msvcrt.dll_printf
jmp 0x403aac
lea rcx, str._find_cycle__new_cyclehead
call sub.msvcrt.dll_printf
mov rcx, r14
call fcn.0040ad30
mov ecx, 0xa
call fcn.004c16a8
jmp 0x403897
mov ecx, 2
call qword [fcn.004c1900]
mov r8d, 0x26
mov edx, 1
lea rcx, str._find_cycle__glommed__but_not_to_head_n
mov r9, rax
call sub.msvcrt.dll_fwrite
mov ecx, 1
call fcn.00408200
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov rcx, qword [rcx]
mov rax, qword [rdx]
mov eax, dword [rax + 0x10]
cmp dword [rcx + 0x10], eax
ja 0x403b85
setb al
movzx eax, al
ret
mov eax, 0xffffffff
ret