// File: /workspace/github_c_makefile_star2_O1/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 0x4459
leaq 0x1cb7(%rip), %rdi      # 0x6105
movl %edx, %esi
xorl %eax, %eax
callq 0x2120
jmp 0x446f
movq 0x4b70(%rip), %rax      # 0x8fd0
movq (%rax), %rsi
leaq 0x1c90(%rip), %rdi      # 0x60fa
callq 0x2150
cmpl $0x1, %ebp
je 0x453a
testl %ebp, %ebp
jne 0x46a4
movq 0x4b49(%rip), %r13      # 0x8fd0
movq (%r13), %rsi
leaq 0x1c7f(%rip), %rdi      # 0x6111
callq 0x2150
movq 0x28(%r14), %rdi
movq %rbx, %rsi
callq 0x4102
movq (%r13), %rsi
leaq 0x1c6a(%rip), %r12      # 0x6118
movq %r12, %rdi
callq 0x2150
movsd 0x28(%r14), %xmm1
unpcklps 0x1b6d(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b75(%rip), %xmm1     # 0x6040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x41c1
movq (%r13), %rsi
leaq 0x1c31(%rip), %rdi      # 0x6120
callq 0x2150
movq 0x10(%r15), %rdi
movq %rbx, %rsi
callq 0x4102
movq (%r13), %rsi
movq %r12, %rdi
callq 0x2150
movsd 0x10(%r15), %xmm1
unpcklps 0x1b17(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b1f(%rip), %xmm1     # 0x6040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
jmp 0x4687
movabsq $0xd00000000, %rax      # imm = 0xD00000000
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq 0x4a7d(%rip), %rbp      # 0x8fd0
movq (%rbp), %rsi
leaq 0x1bb3(%rip), %rdi      # 0x6111
callq 0x2150
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x4102
movq (%rbp), %rsi
leaq 0x1b9e(%rip), %r12      # 0x6118
movq %r12, %rdi
callq 0x2150
movsd 0x18(%r14), %xmm1
unpcklps 0x1aa1(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1aa9(%rip), %xmm1     # 0x6040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x41c1
movq (%rbp), %rsi
leaq 0x1b71(%rip), %r13      # 0x612c
movq %r13, %rdi
callq 0x2150
movsd 0x28(%r14), %xmm1
unpcklps 0x1a60(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1a68(%rip), %xmm1     # 0x6040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %r15, %rdi
callq 0x41c1
movabsq $0xd00000000, %rax      # imm = 0xD00000000
movq %rax, (%r15)
movq (%rbp), %rsi
leaq 0x1b17(%rip), %rdi      # 0x6120
callq 0x2150
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x4102
movq (%rbp), %rsi
movq %r12, %rdi
callq 0x2150
movsd (%r14), %xmm1
unpcklps 0x19ff(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1a07(%rip), %xmm1     # 0x6040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x41c1
movq (%rbp), %rsi
movq %r13, %rdi
callq 0x2150
movsd 0x10(%r14), %xmm1
unpcklps 0x19c5(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x19cd(%rip), %xmm1     # 0x6040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %r15, %rdi
callq 0x41c1
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