Function at 0x100413a69
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
movaps xmmword [rsp + 0x50], xmm6
mov rsi, rcx
mov r8d, 0x83
lea rdx, global___FUNCTION__.79
lea rcx, [0x1004524d0]
call dbg.updatecontext_f
mov ebx, 0x1e
mov r12d, 1
mov ebp, 0x111c
mov r14, qword [0x1004632d0]
mov r15, r14
mov r13, r14
cmp ebp, 0x111c
jne 0x100413d57
test r12d, r12d
jle 0x100413d57
mov ecx, dword [rsi + 8]
call dbg.is_fd_readable
test eax, eax
je 0x100413d57
mov dword [rsi + 0xd4], 0
mov r11d, dword [r14 + 0x78ec]
test r11d, r11d
je 0x100413be6
mov r10, qword [0x1004632d0]
mov r8, qword [r10 + 0xa9d0]
lea r9, [r8 - 1]
movabs rcx, 0x8888888888888889
mov rax, r9
imul rcx
add rdx, r9
sar rdx, 6
mov rax, r9
sar rax, 0x3f
sub rdx, rax
mov rax, rdx
shl rax, 7
lea rdi, [r9 + rdx*8]
sub rdi, rax
lea r9, [r8 - 2]
mov rax, r9
imul rcx
add rdx, r9
sar rdx, 6
mov rax, r9
sar rax, 0x3f
sub rdx, rax
mov rbp, rdx
shl rbp, 7
lea rax, [r9 + rdx*8]
sub rax, rbp
mov r9, qword [r10 + rax*8 + 0xadb8]
add r9d, dword [r10 + rdi*8 + 0xadb8]
mov rax, r8
imul rcx
add rdx, r8
sar rdx, 6
mov rax, r8
sar rax, 0x3f
sub rdx, rax
mov rdi, rdx
shl rdi, 7
lea rax, [r8 + rdx*8]
sub rax, rdi
add r9d, dword [r10 + rax*8 + 0xadb8]
sub r8, 3
mov rax, r8
imul rcx
add rdx, r8
sar rdx, 6
mov rax, r8
sar rax, 0x3f
sub rdx, rax
mov rcx, rdx
shl rcx, 7
lea rax, [r8 + rdx*8]
sub rax, rcx
add r9d, dword [r10 + rax*8 + 0xadb8]
shl r11d, 0xa
cmp r9d, r11d
jb 0x100413be6
mov dword [rsi + 0xd4], 1
jmp 0x100414088
mov ecx, 0
call sym.time
mov rdi, qword [r15 + 0xa9d0]
lea rdx, [rdi + 0x1e]
cmp rax, rdx
jg 0x100414088
mov ecx, dword [rsi + 8]
mov r9d, 0x20
mov r8d, 0x111c
mov rax, qword [0x1004632d0]
mov rdx, qword [rax + 0xb718]
call sym.recv
mov rdi, rax
mov ebp, eax
test eax, eax
jns 0x100413c59
call sym.__errno
cmp dword [rax], 0xb
je 0x100414088
call sym.__errno
mov r8d, dword [rax]
lea rdx, [0x100452676]
mov rcx, rsi
call dbg.l_closeconn
jmp 0x100414088
test eax, eax
jg 0x100413c77
mov r8d, 0
lea rdx, [0x100452676]
mov rcx, rsi
call dbg.l_closeconn
jmp 0x100414088
movsxd r12, eax
mov ecx, dword [rsi + 0xc0]
mov r8, r12
mov rax, qword [0x1004632d0]
mov rdx, qword [rax + 0xb718]
call sym.write
cmp edi, eax
je 0x100413cb6
call sym.__errno
mov r8d, dword [rax]
lea rdx, str.Impossibile_Scrivere_i_dati_nel_File
mov rcx, rsi
call dbg.l_closeconn
jmp 0x100414088
mov rax, qword [r13 + 0xa9d0]
mov qword [rsi + 0x20], rax
movsxd rax, edi
add qword [rsi + 0x78], rax
mov rcx, qword [r13 + 0xa9d0]
movabs rdx, 0x8888888888888889
mov rax, rcx
imul rdx
add rdx, rcx
sar rdx, 6
mov rax, rcx
sar rax, 0x3f
sub rdx, rax
mov rax, rdx
shl rax, 7
lea rdx, [rcx + rdx*8]
sub rdx, rax
add qword [r13 + rdx*8 + 0xadb8], r12
cmp dword [r13 + 0x79b0], 0
jne 0x100413d27
mov rax, qword [0x1004632d0]
add qword [rax + rdx*8 + 0xa9f8], r12
add qword [rax + rdx*8 + 0xb178], r12
mov r12d, edi
mov rax, qword [0x1004632d0]
cmp dword [rax + 0x78b8], 0x32
jbe 0x100413d57
mov dword [rsp + 0x20], edi
mov r9d, edi
lea r8, str.Read__d_File__d
mov edx, 0x22
mov ecx, 1
call dbg.ioutput
sub ebx, 1
jne 0x100413ab7
mov ecx, dword [rsi + 8]
call dbg.is_fd_writeable
test eax, eax
je 0x100413dcf
cmp dword [rsi + 0xd0], 0
je 0x10041407f
movsxd rax, dword [rsi + 0x7c]
bswap eax
mov eax, eax
mov qword [rsp + 0x48], rax
lea rdx, [rsp + 0x48]
mov ecx, dword [rsi + 8]
mov r9d, 0x20
mov r8d, 4
call sym.send
add qword [rsi + 0x70], 4
mov rax, qword [rsi + 0x78]
bswap eax
mov eax, eax
mov qword [rsp + 0x48], rax
lea rdx, [rsp + 0x48]
mov ecx, dword [rsi + 8]
mov r9d, 0x20
mov r8d, 4
call sym.send
add qword [rsi + 0x70], 4
mov rax, qword [rsi + 0x78]
mov rbp, qword [rsi + 0x80]
cmp rax, rbp
jl 0x100414088
mov dword [rsi + 0xbc], 5
mov rdx, qword [0x1004632d0]
mov rbx, qword [rdx + 0xa9d0]
sub rbx, qword [rsi + 0x28]
sub rbx, 1
test rbx, rbx
mov edx, 1
cmovle rbx, rdx
mov rdx, qword [rsi + 0x90]
sub rax, rdx
test rdx, rdx
cmovne rbp, rax
test rbp, rbp
mov eax, 1
cmovle rbp, rax
mov dword [rsp + 0x20], 0xe2
lea r9, [0x1004524d0]
lea r8, global___FUNCTION__.79
mov edx, 0
mov ecx, 0x200
call dbg.mymalloc2
mov r12, rax
mov byte [rax], 0
cmp rbx, 0xe10
jle 0x100413eb0
mov eax, 0
mov rcx, 0xffffffffffffffff
mov rdi, r12
repne scasb al, byte [rdi]
not rcx
sub rcx, 1
movabs rdx, 0x48d159e26af37c05
mov rax, rbx
imul rdx
sar rdx, 0xa
mov r9, rdx
mov rax, rbx
sar rax, 0x3f
mov edx, 0x200
sub rdx, rcx
add rcx, r12
sub r9, rax
lea r8, str.__li_hr
call sym.snprintf
movabs rdx, 0x48d159e26af37c05
mov rax, rbx
imul rdx
sar rdx, 0xa
mov rax, rbx
sar rax, 0x3f
sub rdx, rax
imul r8, rdx, 0xe10
mov rax, rbx
sub rax, r8
mov r8, rax
cmp rax, 0x3c
jle 0x100413f32
mov eax, 0
mov rcx, 0xffffffffffffffff
mov rdi, r12
repne scasb al, byte [rdi]
not rcx
sub rcx, 1
movabs rdx, 0x8888888888888889
mov rax, r8
imul rdx
lea r9, [rdx + r8]
sar r9, 5
sar r8, 0x3f
mov edx, 0x200
sub rdx, rcx
add rcx, r12
sub r9, r8
lea r8, str.__li_min
call sym.snprintf
mov eax, 0
mov rcx, 0xffffffffffffffff
mov rdi, r12
repne scasb al, byte [rdi]
not rcx
sub rcx, 1
movabs rdx, 0x8888888888888889
mov rax, rbx
imul rdx
lea rax, [rdx + rbx]
sar rax, 5
mov rdx, rbx
sar rdx, 0x3f
sub rax, rdx
mov r8, rax
shl r8, 6
lea r9, [rbx + rax*4]
mov edx, 0x200
sub rdx, rcx
add rcx, r12
sub r9, r8
lea r8, str.__li_sec
call sym.snprintf
pxor xmm6, xmm6
cvtsi2ss xmm6, rbp
cvtss2sd xmm6, xmm6
mulsd xmm6, qword [0x1004527f8]
pxor xmm0, xmm0
cvtsi2ss xmm0, rbx
cvtss2sd xmm0, xmm0
divsd xmm6, xmm0
lea rax, [rbp + 0x3ff]
test rbp, rbp
cmovs rbp, rax
sar rbp, 0xa
movsd qword [rsp + 0x28], xmm6
mov qword [rsp + 0x20], r12
mov r9, rbp
lea r8, str.DCC_Upload:_Trasferimento_Completato___ld_kB__s___0.1f_kB_sec_
mov edx, 0x23
mov ecx, 7
call dbg.ioutput
mov rcx, qword [rsi + 0x98]
movsd qword [rsp + 0x20], xmm6
mov r9, r12
mov r8, rbp
lea rdx, str._Upload_Completato___li_kB__s___0.1f_kB_sec_
call dbg.notice
mov rcx, r12
call dbg.mydelete2
mov r9, qword [rsi + 0x98]
mov rax, qword [rsi + 0xa8]
mov qword [rsp + 0x38], rax
mov rdx, qword [rsi + 0x70]
lea rax, [rdx + 0x3ff]
test rdx, rdx
cmovns rax, rdx
sar rax, 0xa
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], rbp
mov eax, dword [rsi + 0xc8]
imul rax, rax, 0xb60
add rax, qword [0x1004632d0]
mov rax, qword [rax + 0xa90]
mov qword [rsp + 0x20], rax
lea r8, str.Upload:_Nick__s__Network__s__Recv__ld_kB__Sent__ld_kB__File__s
mov edx, 0x21
mov ecx, 7
call dbg.ioutput
jmp 0x100414088
mov rax, qword [rsi + 0x78]
jmp 0x100413da8
movaps xmm6, xmmword [rsp + 0x50]
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret