// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/stats.c
// Function: xfer_stats_print_thread
void xfer_stats_print_thread(const struct xfer_stats *client,
			     const struct xfer_stats *server, unsigned int id,
			     unsigned int test_mode, double elapsed,
			     const struct print_options *opts)
{
	struct print_options byte_opts = *opts;

	if (id == XFER_STATS_TOTAL)
		fputs("total     ", stdout);
	else
		printf("thread %-3d", id);

	switch (test_mode) {
	case MODE_TCP_STREAM:
		fputs(" sent ", stdout);
		print_count(client->tx.bytes, opts);
		fputs(", rate ", stdout);
		print_rate(client->tx.bytes / elapsed, opts);
		fputs(", received ", stdout);
		print_count(server->rx.bytes, opts);
		fputs(", rate ", stdout);
		print_rate(server->rx.bytes / elapsed, opts);
		putchar('\n');
		break;
	case MODE_TCP_RR:
		print_opts_setup(&byte_opts, MODE_TCP_STREAM);
		fputs(" sent ", stdout);
		print_count(client->tx.msgs, opts);
		fputs(", rate ", stdout);
		print_rate(client->tx.msgs / elapsed, opts);
		fputs(", ", stdout);
		print_rate(client->tx.bytes / elapsed, &byte_opts);

		print_opts_setup(&byte_opts, MODE_TCP_STREAM);
		fputs(", received ", stdout);
		print_count(client->rx.msgs, opts);
		fputs(", rate ", stdout);
		print_rate(client->rx.msgs / elapsed, opts);
		fputs(", ", stdout);
		print_rate(client->rx.bytes / elapsed, &byte_opts);
		putchar('\n');
		break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movsd %xmm0, (%rsp)
movl %ecx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movl 0x8(%r8), %eax
movl %eax, 0x10(%rsp)
movq (%r8), %rax
movq %rax, 0x8(%rsp)
cmpl $-0x1, %edx
je 0x45db
leaq 0x1ba5(%rip), %rdi      # 0x6175
movl %edx, %esi
xorl %eax, %eax
callq 0x2120
jmp 0x45f1
movq 0x49ee(%rip), %rax      # 0x8fd0
movq (%rax), %rsi
leaq 0x1b7e(%rip), %rdi      # 0x616a
callq 0x2150
cmpl $0x1, %ebp
je 0x46bc
testl %ebp, %ebp
jne 0x4826
movq 0x49c7(%rip), %r13      # 0x8fd0
movq (%r13), %rsi
leaq 0x1b6d(%rip), %rdi      # 0x6181
callq 0x2150
movq 0x28(%r14), %rdi
movq %rbx, %rsi
callq 0x427a
movq (%r13), %rsi
leaq 0x1b58(%rip), %r12      # 0x6188
movq %r12, %rdi
callq 0x2150
movsd 0x28(%r14), %xmm1
unpcklps 0x1a5b(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1a63(%rip), %xmm1     # 0x60b0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x4339
movq (%r13), %rsi
leaq 0x1b1f(%rip), %rdi      # 0x6190
callq 0x2150
movq 0x10(%r15), %rdi
movq %rbx, %rsi
callq 0x427a
movq (%r13), %rsi
movq %r12, %rdi
callq 0x2150
movsd 0x10(%r15), %xmm1
unpcklps 0x1a05(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1a0d(%rip), %xmm1     # 0x60b0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
jmp 0x4809
movabsq $0xd00000000, %rax      # imm = 0xD00000000
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq 0x48fb(%rip), %rbp      # 0x8fd0
movq (%rbp), %rsi
leaq 0x1aa1(%rip), %rdi      # 0x6181
callq 0x2150
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x427a
movq (%rbp), %rsi
leaq 0x1a8c(%rip), %r12      # 0x6188
movq %r12, %rdi
callq 0x2150
movsd 0x18(%r14), %xmm1
unpcklps 0x198f(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1997(%rip), %xmm1     # 0x60b0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x4339
movq (%rbp), %rsi
leaq 0x1a5f(%rip), %r13      # 0x619c
movq %r13, %rdi
callq 0x2150
movsd 0x28(%r14), %xmm1
unpcklps 0x194e(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1956(%rip), %xmm1     # 0x60b0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %r15, %rdi
callq 0x4339
movabsq $0xd00000000, %rax      # imm = 0xD00000000
movq %rax, (%r15)
movq (%rbp), %rsi
leaq 0x1a05(%rip), %rdi      # 0x6190
callq 0x2150
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x427a
movq (%rbp), %rsi
movq %r12, %rdi
callq 0x2150
movsd (%r14), %xmm1
unpcklps 0x18ed(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x18f5(%rip), %xmm1     # 0x60b0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x4339
movq (%rbp), %rsi
movq %r13, %rdi
callq 0x2150
movsd 0x10(%r14), %xmm1
unpcklps 0x18b3(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x18bb(%rip), %xmm1     # 0x60b0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %r15, %rdi
callq 0x4339
movl $0xa, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq