// File: /workspace/github_c_makefile_star2_O2/jfriesse[P]omping/cliprint.c
// Function: cliprint_final_stats
void
cliprint_final_stats(const struct rh_list *remote_hosts, int host_name_len,
    enum sf_transport_method transport_method)
{
	const char *cast_str;
	struct rh_item *rh_item;
	struct rh_item_ci *ci;
	enum sf_cast_type cast_type;
	double avg_rtt;
	int i;
	int loss;
	int loss_adj;
	uint64_t received;
	uint64_t sent;

	printf("\n");

	loss_adj = 0;

	TAILQ_FOREACH(rh_item, remote_hosts, entries) {
		for (i = 0; i < 2; i++) {
			if (i == 0) {
				cast_type = SF_CT_UNI;
			} else {
				switch (transport_method) {
				case SF_TM_ASM:
				case SF_TM_SSM:
					cast_type = SF_CT_MULTI;
					break;
				case SF_TM_IPBC:
					cast_type = SF_CT_BROAD;
					break;
				default:
					DEBUG_PRINTF("Internal error - unknown transport method");
					errx(1, "Internal error - unknown transport method");
					/* NOTREACHED */
				}
			}

			cast_str = sf_cast_type_to_str(cast_type);
			ci = &rh_item->client_info;

			received = ci->no_received[i];
			sent = ci->no_sent;

			printf("%-*s : ", host_name_len, rh_item->addr->host_name);

			if (received == 0 && i == 0) {
				printf("response message never received\n");
				break;
			}

			if (i != 0) {
				loss_adj = util_packet_loss_percent(sent - ci->first_mcast_seq + 1,
				    received);
			}

			loss = util_packet_loss_percent(sent, received);

			if (received == 0) {
				avg_rtt = 0;
			} else {
				avg_rtt = ci->avg_rtt[i] / UTIL_NSINMS;
			}

			printf("%5scast, ", cast_str);

			printf("xmt/rcv/%%loss = ");
			printf("%"PRIu64"/%"PRIu64, sent, received);

			if (ci->no_dups[i] > 0) {
				printf("+%"PRIu64, ci->no_dups[i]);
			}

			printf("/%d%%", loss);
			if (i != 0 && ci->first_mcast_seq > 1) {
				printf(" (seq>=%"PRIu32" %d%%)", ci->first_mcast_seq, loss_adj);
			}

			printf(", min/avg/max/std-dev = ");
			printf("%.3f/%.3f/%.3f/%.3f", ci->rtt_min[i] / UTIL_NSINMS, avg_rtt,
			    ci->rtt_max[i] / UTIL_NSINMS,
			    util_ov_std_dev(ci->m2_rtt[i], ci->no_received[i]) / UTIL_NSINMS);
			printf("\n");
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebx
movl %esi, 0x14(%rsp)
movq %rdi, %r14
pushq $0xa
popq %rdi
callq 0x2050
movl %ebx, 0x10(%rsp)
movl %ebx, %eax
movq %rax, 0x20(%rsp)
movl $0x0, 0xc(%rsp)
movq (%r14), %r14
testq %r14, %r14
je 0x453e
xorl %r13d, %r13d
cmpq $0x2, %r13
je 0x4532
testq %r13, %r13
je 0x4385
cmpl $0x3, 0x10(%rsp)
jae 0x454d
movq 0x20(%rsp), %rax
leaq 0x5664(%rip), %rcx      # 0x99e4
movl (%rcx,%rax,4), %edi
jmp 0x4387
xorl %edi, %edi
callq 0x7ad9
movq %rax, %rbx
movq 0xd0(%r14,%r13,8), %r12
movq (%r14), %rax
movq 0xe0(%r14), %r15
movq 0x80(%rax), %rdx
leaq 0x5649(%rip), %rdi      # 0x99f8
movl 0x14(%rsp), %esi
xorl %eax, %eax
callq 0x2100
movq %r13, %rax
orq %r12, %rax
je 0x4526
testq %r13, %r13
je 0x43e7
movl 0xe8(%r14), %eax
movq %r15, %rdi
subq %rax, %rdi
incq %rdi
movq %r12, %rsi
callq 0x8cd7
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x8cd7
movl %eax, %ebp
testq %r12, %r12
je 0x440a
movsd 0x78(%r14,%r13,8), %xmm0
divsd 0x55e8(%rip), %xmm0     # 0x99f0
jmp 0x440e
xorpd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x5700(%rip), %rdi      # 0x9b1b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2100
leaq 0x56f9(%rip), %rdi      # 0x9b25
xorl %eax, %eax
callq 0x2100
leaq 0x56fd(%rip), %rdi      # 0x9b37
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2100
movq 0xc0(%r14,%r13,8), %rsi
testq %rsi, %rsi
je 0x4462
leaq 0x56e4(%rip), %rdi      # 0x9b3f
xorl %eax, %eax
callq 0x2100
leaq 0x56db(%rip), %rdi      # 0x9b44
movl %ebp, %esi
xorl %eax, %eax
callq 0x2100
testq %r13, %r13
je 0x4495
movl 0xe8(%r14), %esi
cmpl $0x2, %esi
jb 0x4495
leaq 0x56c0(%rip), %rdi      # 0x9b4a
movl 0xc(%rsp), %edx
xorl %eax, %eax
callq 0x2100
leaq 0x56be(%rip), %rdi      # 0x9b5a
xorl %eax, %eax
callq 0x2100
movsd 0xa8(%r14,%r13,8), %xmm1
movsd 0x553b(%rip), %xmm2     # 0x99f0
divsd %xmm2, %xmm1
movsd %xmm1, 0x30(%rsp)
movsd 0x88(%r14,%r13,8), %xmm0
movsd 0x98(%r14,%r13,8), %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, 0x28(%rsp)
movq 0xd0(%r14,%r13,8), %rdi
callq 0x8b81
movapd %xmm0, %xmm3
divsd 0x54fa(%rip), %xmm3     # 0x99f0
leaq 0x5676(%rip), %rdi      # 0x9b73
movsd 0x30(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
movb $0x4, %al
callq 0x2100
pushq $0xa
popq %rdi
callq 0x2050
incq %r13
jmp 0x435a
leaq 0x57b0(%rip), %rdi      # 0x9cdd
callq 0x2090
addq $0x138, %r14            # imm = 0x138
jmp 0x434b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5506(%rip), %rdi      # 0x9a5a
leaq 0x5596(%rip), %rbx      # 0x9af1
pushq $0x2
popq %rdx
movl $0xb4, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4998
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20f0