// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/net/protocols/http.cpp
// Function: smooth::Net::Protocols::httpProgress(void*, double, double, double, double)
int S::Net::Protocols::httpProgress(void *data, double dlTotal, double dlNow, double ulTotal, double ulNow)
{
	HTTP	*http = (HTTP *) data;

	if (ulNow > 0 && http->ulStart == 0) http->ulStart = System::System::Clock() - 1;
	if (dlNow > 0 && http->dlStart == 0) http->dlStart = System::System::Clock() - 1;

	if (http->dlStart == 0)
	{
		if (ulTotal > 0) http->uploadProgress.Emit(Math::Round(1000.0 * ulNow / ulTotal));
		if (ulNow   > 0) http->uploadSpeed.Emit(String::FromInt(Math::Round((ulNow / 1024) / (Float(System::System::Clock() - http->ulStart) / 1000))).Append(" kB/s"));
	}
	else
	{
		if (dlTotal > 0) http->downloadProgress.Emit(Math::Round(1000.0 * dlNow / dlTotal));
		if (dlNow   > 0) http->downloadSpeed.Emit(String::FromInt(Math::Round((dlNow / 1024) / (Float(System::System::Clock() - http->dlStart) / 1000))).Append(" kB/s"));
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movsd %xmm2, -0x20(%rbp)
movsd %xmm3, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movsd -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1044be
movq -0x30(%rbp), %rax
cmpq $0x0, 0x260(%rax)
jne 0x1044be
callq 0x5b700
movq %rax, %rcx
subq $0x1, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x260(%rax)
movsd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1044f1
movq -0x30(%rbp), %rax
cmpq $0x0, 0x268(%rax)
jne 0x1044f1
callq 0x5b700
movq %rax, %rcx
subq $0x1, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x268(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x268(%rax)
jne 0x104669
movsd -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x104545
movq -0x30(%rbp), %rax
addq $0x20, %rax
movq %rax, -0xa8(%rbp)
movsd 0xa15d8(%rip), %xmm0    # 0x1a5b00
mulsd -0x28(%rbp), %xmm0
divsd -0x20(%rbp), %xmm0
callq 0x5a970
movq -0xa8(%rbp), %rdi
movl %eax, %esi
callq 0x907d0
movsd -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x104664
movq -0x30(%rbp), %rax
addq $0x40, %rax
movq %rax, -0xb8(%rbp)
movsd -0x28(%rbp), %xmm0
movsd 0xa1605(%rip), %xmm1    # 0x1a5b78
mulsd %xmm1, %xmm0
movsd %xmm0, -0xb0(%rbp)
callq 0x5b700
movsd -0xb0(%rbp), %xmm0
movq -0x30(%rbp), %rcx
movq 0x260(%rcx), %rcx
subq %rcx, %rax
movq %rax, %xmm1
movaps 0xa156a(%rip), %xmm2    # 0x1a5b10
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xa156e(%rip), %xmm2    # 0x1a5b20
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
movsd 0xa1537(%rip), %xmm2    # 0x1a5b00
divsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x5a970
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x5b290
leaq 0xa1567(%rip), %rsi     # 0x1a5b50
leaq -0x60(%rbp), %rdi
callq 0x5c1f0
jmp 0x1045f4
leaq -0x48(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x5a710
movq %rax, -0xc0(%rbp)
jmp 0x10460a
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdi
callq 0x97960
jmp 0x10461f
leaq -0x60(%rbp), %rdi
callq 0x5df00
leaq -0x48(%rbp), %rdi
callq 0x5df00
jmp 0x104664
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x104656
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5df00
leaq -0x48(%rbp), %rdi
callq 0x5df00
jmp 0x1047ec
jmp 0x1047e1
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1046ab
movq -0x30(%rbp), %rax
addq $0x60, %rax
movq %rax, -0xc8(%rbp)
movsd 0xa1472(%rip), %xmm0    # 0x1a5b00
mulsd -0x18(%rbp), %xmm0
divsd -0x10(%rbp), %xmm0
callq 0x5a970
movq -0xc8(%rbp), %rdi
movl %eax, %esi
callq 0x907d0
movsd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1047df
movq -0x30(%rbp), %rax
subq $-0x80, %rax
movq %rax, -0xd8(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0xa149f(%rip), %xmm1    # 0x1a5b78
mulsd %xmm1, %xmm0
movsd %xmm0, -0xd0(%rbp)
callq 0x5b700
movsd -0xd0(%rbp), %xmm0
movq -0x30(%rbp), %rcx
movq 0x268(%rcx), %rcx
subq %rcx, %rax
movq %rax, %xmm1
movaps 0xa1404(%rip), %xmm2    # 0x1a5b10
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xa1408(%rip), %xmm2    # 0x1a5b20
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
movsd 0xa13d1(%rip), %xmm2    # 0x1a5b00
divsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x5a970
movq %rax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x5b290
leaq 0xa13fe(%rip), %rsi     # 0x1a5b50
leaq -0xa0(%rbp), %rdi
callq 0x5c1f0
jmp 0x104760
leaq -0x88(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5a710
movq %rax, -0xe0(%rbp)
jmp 0x10477c
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdi
callq 0x97960
jmp 0x104791
leaq -0xa0(%rbp), %rdi
callq 0x5df00
leaq -0x88(%rbp), %rdi
callq 0x5df00
jmp 0x1047df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x1047d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x5df00
leaq -0x88(%rbp), %rdi
callq 0x5df00
jmp 0x1047ec
jmp 0x1047e1
xorl %eax, %eax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)
nop