Function at 0x140013870
Capabilities:
Print debug messages

Disassembly:
push r15
push r14
lea r14, str._DEBUG::_s::_d__Allocated_memory_for_DownloadChunk._Buffer:__p__Size:__d__n
push r13
push r12
lea r12, str.DownloadPush
push rbp
lea rbp, str._DEBUG::_s::_d__Download:__p_n
push rdi
push rsi
push rbx
sub rsp, 0x48
mov rsi, qword [0x14002d650]
mov rax, qword [rsi]
mov rbx, qword [rax + 0x912]
mov rdi, qword [rax + 0x8d6]
test rbx, rbx
jne 0x1400138e7
test rdi, rdi
je 0x140013b99
mov ecx, dword [rax + 0x8de]
xor eax, eax
rep stosb byte [rdi], al
mov rax, qword [rsi]
mov rcx, qword [rax + 0x8d6]
call sym.MmHeapFree
mov rax, qword [rsi]
mov qword [rax + 0x8d6], 0
jmp 0x140013b99
mov rdi, qword [rsi]
cmp qword [rdi + 0x8d6], 0
jne 0x140013931
mov ecx, dword [rdi + 0xf8]
call sym.MmHeapAlloc
mov r8d, 0x81
mov rcx, r14
mov qword [rdi + 0x8d6], rax
mov rax, qword [rsi]
mov edx, dword [rax + 0xf8]
mov r9, qword [rax + 0x8d6]
mov dword [rax + 0x8de], edx
mov dword [rsp + 0x20], edx
mov rdx, r12
call sym.DbgPrint
mov r9, rbx
mov r8d, 0x84
mov rdx, r12
mov rcx, rbp
call sym.DbgPrint
cmp dword [rbx + 0x28], 1
jne 0x140013aff
mov r9d, dword [rbx]
mov r8d, 0x89
mov rdx, r12
lea rcx, str._DEBUG::_s::_d__Download___x__is_in_state_DOWNLOAD_STATE_RUNNING_n
mov dword [rsp + 0x3c], 0
call sym.DbgPrint
mov rax, qword [rsi]
mov rdi, qword [rax + 0x8d6]
mov ecx, dword [rax + 0x8de]
xor eax, eax
rep stosb byte [rdi], al
mov rax, qword [rsi]
mov rcx, qword [rbx + 8]
lea r9, [rsp + 0x3c]
mov r8d, dword [rax + 0x8de]
mov rdx, qword [rax + 0x8d6]
mov qword [rsp + 0x20], 0
call qword [rax + 0x398]
test eax, eax
jne 0x1400139d3
mov rax, qword [rsi]
mov r8d, 0x8f
mov rdx, r12
lea rcx, str._DEBUG::_s::_d__ReadFile_Failed:_Error__d__n
mov rax, qword [rax + 0x8c2]
mov r9d, dword [rax + 0x68]
call sym.DbgPrint
mov edx, dword [rsp + 0x3c]
sub qword [rbx + 0x18], rdx
add qword [rbx + 0x20], rdx
test edx, edx
je 0x140013ac5
lea r15, [0x140029150]
lea r9, str.Send_download_chunk
mov r8d, 0x97
mov rdx, r12
mov rcx, r15
call sym.printf.constprop.0_10
mov edx, dword [rbx + 0x10]
mov ecx, 0xf
call sym.PackageCreateWithRequestID
mov edx, 2
mov r13, rax
mov rcx, rax
call sym.PackageAddInt32
mov edx, 1
mov rcx, r13
call sym.PackageAddInt32
mov edx, dword [rbx]
mov rcx, r13
call sym.PackageAddInt32
mov rax, qword [rsi]
mov r8d, dword [rsp + 0x3c]
mov rcx, r13
mov rdx, qword [rax + 0x8d6]
call sym.PackageAddBytes
lea r9, str.transmit_download_chunk
mov rdx, r12
mov rcx, r15
mov r8d, 0xa4
call sym.printf.constprop.0_10
mov rcx, r13
call sym.PackageTransmit
cmp dword [rsp + 0x3c], 0
je 0x140013ac5
cmp qword [rbx + 0x18], 0
jne 0x140013ac5
mov edx, dword [rbx + 0x10]
mov ecx, 0xf
call sym.PackageCreateWithRequestID
mov edx, 2
mov r13, rax
mov rcx, rax
call sym.PackageAddInt32
mov edx, 2
mov rcx, r13
call sym.PackageAddInt32
mov edx, dword [rbx]
mov rcx, r13
call sym.PackageAddInt32
mov rcx, r13
xor edx, edx
call sym.PackageAddInt32
mov rcx, r13
call sym.PackageTransmit
mov r9d, dword [rsp + 0x3c]
mov rax, qword [rbx + 0x18]
test r9d, r9d
je 0x140013ad8
test rax, rax
jne 0x140013aff
mov edx, dword [rbx]
mov qword [rsp + 0x20], rax
mov r8d, 0xbc
lea rcx, str._DEBUG::_s::_d__Read:__d__Download__Size:__d_._Set_Download___x__State_to_DOWNLOAD_STATE_REMOVE_n
mov dword [rsp + 0x28], edx
mov rdx, r12
call sym.DbgPrint
mov dword [rbx + 0x28], 3
mov rax, qword [rbx + 0x30]
mov r9, rbx
mov r8d, 0xc4
mov rdx, r12
lea rcx, str._DEBUG::_s::_d__Download__p___Download__Next__p__n
mov qword [rsp + 0x20], rax
call sym.DbgPrint
mov rbx, qword [rbx + 0x30]
test rbx, rbx
jne 0x1400138e7
mov rax, qword [rsi]
xor edx, edx
mov r12, qword [rax + 0x912]
test r12, r12
je 0x140013b80
cmp dword [r12 + 0x28], 3
mov rax, qword [r12 + 0x30]
je 0x140013b53
mov rdx, r12
mov r12, rax
jmp 0x140013b39
test rdx, rdx
jne 0x140013b6c
mov rdx, qword [rsi]
mov rcx, r12
mov qword [rdx + 0x912], rax
call sym.DownloadFree
jmp 0x140013b80
mov qword [rdx + 0x30], rax
mov rcx, r12
call sym.DownloadFree
mov rax, r12
xor r12d, r12d
jmp 0x140013b4b
mov rax, qword [rsi]
mov rdi, qword [rax + 0x8d6]
test rdi, rdi
je 0x140013b99
mov ecx, dword [rax + 0x8de]
xor eax, eax
rep stosb byte [rdi], al
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret