// File: /workspace/github_c_makefile_star2_O2/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 0x41dd
leaq 0x1f53(%rip), %rdi      # 0x6125
movl %edx, %esi
xorl %eax, %eax
callq 0x2120
jmp 0x41f3
movq 0x4dec(%rip), %rax      # 0x8fd0
movq (%rax), %rsi
leaq 0x1f2c(%rip), %rdi      # 0x611a
callq 0x2150
cmpl $0x1, %ebp
je 0x42be
testl %ebp, %ebp
jne 0x4426
movq 0x4dc5(%rip), %r13      # 0x8fd0
movq (%r13), %rsi
leaq 0x1f1b(%rip), %rdi      # 0x6131
callq 0x2150
movq 0x28(%r14), %rdi
movq %rbx, %rsi
callq 0x3eb6
movq (%r13), %rsi
leaq 0x1f06(%rip), %r12      # 0x6138
movq %r12, %rdi
callq 0x2150
movsd 0x28(%r14), %xmm1
unpcklps 0x1e09(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1e11(%rip), %xmm1     # 0x6060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x3f61
movq (%r13), %rsi
leaq 0x1ecd(%rip), %rdi      # 0x6140
callq 0x2150
movq 0x10(%r15), %rdi
movq %rbx, %rsi
callq 0x3eb6
movq (%r13), %rsi
movq %r12, %rdi
callq 0x2150
movsd 0x10(%r15), %xmm1
unpcklps 0x1db3(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1dbb(%rip), %xmm1     # 0x6060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
jmp 0x440b
movabsq $0xd00000000, %rax      # imm = 0xD00000000
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq 0x4cf9(%rip), %rbp      # 0x8fd0
movq (%rbp), %rsi
leaq 0x1e4f(%rip), %rdi      # 0x6131
callq 0x2150
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x3eb6
movq (%rbp), %rsi
leaq 0x1e3a(%rip), %r12      # 0x6138
movq %r12, %rdi
callq 0x2150
movsd 0x18(%r14), %xmm1
unpcklps 0x1d3d(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d45(%rip), %xmm1     # 0x6060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x3f61
movq (%rbp), %rsi
leaq 0x1e0d(%rip), %r13      # 0x614c
movq %r13, %rdi
callq 0x2150
movsd 0x28(%r14), %xmm1
unpcklps 0x1cfc(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d04(%rip), %xmm1     # 0x6060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %r15, %rdi
callq 0x3f61
movabsq $0xd00000000, %rax      # imm = 0xD00000000
movq %rax, (%r15)
movq (%rbp), %rsi
leaq 0x1db3(%rip), %rdi      # 0x6140
callq 0x2150
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3eb6
movq (%rbp), %rsi
movq %r12, %rdi
callq 0x2150
movsd (%r14), %xmm1
unpcklps 0x1c9b(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1ca3(%rip), %xmm1     # 0x6060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x3f61
movq (%rbp), %rsi
movq %r13, %rdi
callq 0x2150
movsd 0x10(%r14), %xmm1
unpcklps 0x1c61(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1c69(%rip), %xmm1     # 0x6060
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %r15, %rdi
callq 0x3f61
pushq $0xa
popq %rdi
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