// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
leaq 0x98ca(%rip), %rdi      # 0xed16
movb $0x0, %al
callq 0x20f0
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x5754
movl $0x0, -0x3c(%rbp)
cmpl $0x2, -0x3c(%rbp)
jge 0x573e
cmpl $0x0, -0x3c(%rbp)
jne 0x5490
movl $0x0, -0x2c(%rbp)
jmp 0x54ed
movl -0x10(%rbp), %eax
movl %eax, -0x5c(%rbp)
subl $0x2, %eax
jb 0x54a7
jmp 0x549d
movl -0x5c(%rbp), %eax
subl $0x2, %eax
je 0x54b0
jmp 0x54b9
movl $0x1, -0x2c(%rbp)
jmp 0x54eb
movl $0x2, -0x2c(%rbp)
jmp 0x54eb
leaq 0x95c2(%rip), %rdi      # 0xea82
movl $0xb4, %esi
movl $0x2, %edx
leaq 0x9667(%rip), %rcx      # 0xeb38
movb $0x0, %al
callq 0x5dc0
movl $0x1, %edi
leaq 0x9654(%rip), %rsi      # 0xeb38
movb $0x0, %al
callq 0x20d0
jmp 0x54ed
movl -0x2c(%rbp), %edi
callq 0xaf50
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq 0xc8(%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq 0xd8(%rax), %rax
movq %rax, -0x58(%rbp)
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x80(%rax), %rdx
leaq 0x94e0(%rip), %rdi      # 0xea20
movb $0x0, %al
callq 0x20f0
cmpq $0x0, -0x50(%rbp)
jne 0x5567
cmpl $0x0, -0x3c(%rbp)
jne 0x5567
leaq 0x9607(%rip), %rdi      # 0xeb62
movb $0x0, %al
callq 0x20f0
jmp 0x573e
cmpl $0x0, -0x3c(%rbp)
je 0x558e
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0xe0(%rax), %eax
subq %rax, %rdi
addq $0x1, %rdi
movq -0x50(%rbp), %rsi
callq 0xcfb0
movl %eax, -0x44(%rbp)
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0xcfb0
movl %eax, -0x40(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x55af
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0x55ce
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsd 0x70(%rax,%rcx,8), %xmm0
movsd 0x9453(%rip), %xmm1     # 0xea18
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x95aa(%rip), %rdi      # 0xeb83
movb $0x0, %al
callq 0x20f0
leaq 0x95a6(%rip), %rdi      # 0xeb8d
movb $0x0, %al
callq 0x20f0
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq 0x95a2(%rip), %rdi      # 0xeb9f
movb $0x0, %al
callq 0x20f0
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpq $0x0, 0xb8(%rax,%rcx,8)
jbe 0x5635
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq 0xb8(%rax,%rcx,8), %rsi
leaq 0x9579(%rip), %rdi      # 0xeba7
movb $0x0, %al
callq 0x20f0
movl -0x40(%rbp), %esi
leaq 0x956d(%rip), %rdi      # 0xebac
movb $0x0, %al
callq 0x20f0
cmpl $0x0, -0x3c(%rbp)
je 0x5674
movq -0x28(%rbp), %rax
cmpl $0x1, 0xe0(%rax)
jbe 0x5674
movq -0x28(%rbp), %rax
movl 0xe0(%rax), %esi
movl -0x44(%rbp), %edx
leaq 0x9545(%rip), %rdi      # 0xebb2
movb $0x0, %al
callq 0x20f0
leaq 0x9547(%rip), %rdi      # 0xebc2
movb $0x0, %al
callq 0x20f0
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsd 0xa0(%rax,%rcx,8), %xmm0
movsd 0x937d(%rip), %xmm1     # 0xea18
divsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsd 0x90(%rax,%rcx,8), %xmm0
movsd 0x9351(%rip), %xmm1     # 0xea18
divsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsd 0x80(%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq 0xc8(%rax,%rcx,8), %rdi
callq 0xcd70
movsd -0x78(%rbp), %xmm1
movsd -0x70(%rbp), %xmm2
movaps %xmm0, %xmm3
movsd -0x68(%rbp), %xmm0
movsd 0x9308(%rip), %xmm4     # 0xea18
divsd %xmm4, %xmm3
leaq 0x94c0(%rip), %rdi      # 0xebdb
movb $0x4, %al
callq 0x20f0
leaq 0x95ed(%rip), %rdi      # 0xed16
movb $0x0, %al
callq 0x20f0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x5477
jmp 0x5740
movq -0x20(%rbp), %rax
movq 0x138(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x5465
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)