// File: /workspace/github_c_makefile_star2_O3/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb1_device_data
void vrb1_device_data(void *dev)
{
	uint32_t vf_idx, num, min, max;
	uint64_t avg;
	hw_device *accel_dev = (hw_device *)dev;
	uint8_t *bar0addr = accel_dev->bar0Addr;

	LOG_RESP(INFO, "Device Status:: %d VFs\n", accel_dev->numvfs);
	for (vf_idx = 0; vf_idx < accel_dev->numvfs; vf_idx++)
		LOG_RESP(INFO, "-  VF %d %s\n", vf_idx,
			 bb_acc_device_status_str(accel_dev->dev_status[vf_idx]));
	LOG_RESP(INFO, "5GUL counters: Code Blocks");
	print_all_stat32(accel_dev, HWPfPermonACountVf, accel_dev->numvfs, VRB1_PMON_OFF_1);
	LOG_RESP(INFO, "5GUL counters: Data (Bytes)");
	print_all_stat32(accel_dev, HWPfPermonAKCntLoVf, accel_dev->numvfs, VRB1_PMON_OFF_1);
	LOG_RESP(INFO, "5GUL counters: Per Engine");
	print_all_stat32(accel_dev, HWPfPermonACbCountFec, VRB1_5GUL_ENGS, VRB1_PMON_OFF_2);
	LOG_RESP(INFO, "5GDL counters: Code Blocks");
	print_all_stat32(accel_dev, HWPfPermonBCountVf, accel_dev->numvfs, VRB1_PMON_OFF_1);
	LOG_RESP(INFO, "5GDL counters: Data (Bytes)");
	print_all_stat32(accel_dev, HWPfPermonBKCntLoVf, accel_dev->numvfs, VRB1_PMON_OFF_1);
	LOG_RESP(INFO, "5GDL counters: Per Engine");
	print_all_stat32(accel_dev, HWPfPermonBCbCountFec, VRB1_5GDL_ENGS, VRB1_PMON_OFF_2);
	LOG_RESP(INFO, "FFT counters: Code Blocks");
	print_all_stat32(accel_dev, HWPfPermonCCountVf, accel_dev->numvfs, VRB1_PMON_OFF_1);
	LOG_RESP(INFO, "FFT counters: Data (Bytes)");
	print_all_stat32(accel_dev, HWPfPermonCKCntLoVf, accel_dev->numvfs, VRB1_PMON_OFF_1);
	LOG_RESP(INFO, "FFT counters: Per Engine");
	print_all_stat32(accel_dev, HWPfPermonCCbCountFec, VRB1_FFT_ENGS, VRB1_PMON_OFF_2);
	/* Bus Monitor */
	vrb1_reg_fast_write(bar0addr, HWPfPermonAControlBusMon, VRB1_BUSMON_STOP);
	min = vrb1_reg_read(bar0addr, HWPfPermonAMinLatBusMon);
	max = vrb1_reg_read(bar0addr, HWPfPermonAMaxLatBusMon);
	num = vrb1_reg_read(bar0addr, HWPfPermonATotalReqCntBusMon);
	if (num > 0) {
		avg = (vrb1_reg_read(bar0addr, HWPfPermonATotalLatLowBusMon) +
				vrb1_reg_read(bar0addr, HWPfPermonATotalLatUpperBusMon)
				* ((uint64_t)1 << 32)) / num;
		LOG_RESP(INFO, "Bus Monitor A (ns) Avg %u - Num %u - Min %d - Max %d",
				(uint32_t) avg, num, min, max);
	}
	vrb1_reg_fast_write(bar0addr, HWPfPermonAControlBusMon, VRB1_BUSMON_RESET);
	vrb1_reg_fast_write(bar0addr, HWPfPermonAControlBusMon, VRB1_BUSMON_START);
	vrb1_reg_fast_write(bar0addr, HWPfPermonCControlBusMon, VRB1_BUSMON_STOP);
	min = vrb1_reg_read(bar0addr, HWPfPermonCMinLatBusMon);
	max = vrb1_reg_read(bar0addr, HWPfPermonCMaxLatBusMon);
	num = vrb1_reg_read(bar0addr, HWPfPermonCTotalReqCntBusMon);
	if (num > 0) {
		avg = (vrb1_reg_read(bar0addr, HWPfPermonCTotalLatLowBusMon) +
				vrb1_reg_read(bar0addr, HWPfPermonCTotalLatUpperBusMon)
				* ((uint64_t)1 << 32)) / num;
		LOG_RESP(INFO, "Bus Monitor C (ns) Avg %u - Num %u - Min %d - Max %d",
				(uint32_t) avg, num, min, max);
	}
	vrb1_reg_fast_write(bar0addr, HWPfPermonCControlBusMon, VRB1_BUSMON_RESET);
	vrb1_reg_fast_write(bar0addr, HWPfPermonCControlBusMon, VRB1_BUSMON_START);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xb0(%rdi), %rax
movq %rax, (%rsp)
callq 0x12bf7
leaq 0x216a9(%rip), %rbp     # 0x33ed0
movq 0x10(%rbp), %r8
movl 0x4f8(%rbx), %r9d
leaq 0x9ae6(%rip), %rdx      # 0x1c31f
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
cmpl $0x0, 0x4f8(%rbx)
je 0x128b1
leaq 0x9ae1(%rip), %r14      # 0x1c33e
xorl %r15d, %r15d
callq 0x12bf7
movq %rax, %r12
movq 0x10(%rbp), %r13
movl 0xf0(%rbx,%r15,8), %edi
callq 0x19cac
movq %rax, %r10
subq $0x8, %rsp
movl $0x2, %edi
movl $0x1, %esi
movq %r14, %rdx
movq %r12, %rcx
movq %r13, %r8
movl %r15d, %r9d
xorl %eax, %eax
pushq %r10
callq 0x199b4
addq $0x10, %rsp
incq %r15
movl 0x4f8(%rbx), %eax
cmpq %rax, %r15
jb 0x12860
callq 0x12bf7
movq 0x10(%rbp), %r8
leaq 0x8e8a(%rip), %rdx      # 0x1b74b
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl 0x4f8(%rbx), %edx
movq %rbx, %rdi
movl $0xb98008, %esi         # imm = 0xB98008
movl $0x100, %ecx            # imm = 0x100
callq 0x1a724
callq 0x12bf7
movq 0x10(%rbp), %r8
leaq 0x8e70(%rip), %rdx      # 0x1b76d
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl 0x4f8(%rbx), %edx
movq %rbx, %rdi
movl $0xb98010, %esi         # imm = 0xB98010
movl $0x100, %ecx            # imm = 0x100
callq 0x1a724
callq 0x12bf7
movq 0x10(%rbp), %r8
leaq 0x8e57(%rip), %rdx      # 0x1b790
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movq %rbx, %rdi
movl $0xb9c100, %esi         # imm = 0xB9C100
movl $0x5, %edx
movl $0x10, %ecx
callq 0x1a724
callq 0x12bf7
movq 0x10(%rbp), %r8
leaq 0x8e3d(%rip), %rdx      # 0x1b7b1
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl 0x4f8(%rbx), %edx
movq %rbx, %rdi
movl $0xba8008, %esi         # imm = 0xBA8008
movl $0x100, %ecx            # imm = 0x100
callq 0x1a724
callq 0x12bf7
movq 0x10(%rbp), %r8
leaq 0x8e23(%rip), %rdx      # 0x1b7d3
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl 0x4f8(%rbx), %edx
movq %rbx, %rdi
movl $0xba8010, %esi         # imm = 0xBA8010
movl $0x100, %ecx            # imm = 0x100
callq 0x1a724
callq 0x12bf7
movq 0x10(%rbp), %r8
leaq 0x8e0a(%rip), %rdx      # 0x1b7f6
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movq %rbx, %rdi
movl $0xbac100, %esi         # imm = 0xBAC100
movl $0x2, %edx
movl $0x10, %ecx
callq 0x1a724
callq 0x12bf7
movq 0x10(%rbp), %r8
leaq 0x992b(%rip), %rdx      # 0x1c352
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl 0x4f8(%rbx), %edx
movq %rbx, %rdi
movl $0xbb8008, %esi         # imm = 0xBB8008
movl $0x100, %ecx            # imm = 0x100
callq 0x1a724
callq 0x12bf7
movq 0x10(%rbp), %r8
leaq 0x9910(%rip), %rdx      # 0x1c373
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl 0x4f8(%rbx), %edx
movq %rbx, %rdi
movl $0xbb8010, %esi         # imm = 0xBB8010
movl $0x100, %ecx            # imm = 0x100
callq 0x1a724
callq 0x12bf7
movq 0x10(%rbp), %r8
leaq 0x98f6(%rip), %rdx      # 0x1c395
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movq %rbx, %rdi
movl $0xbbc100, %esi         # imm = 0xBBC100
movl $0x1, %edx
movl $0x10, %ecx
callq 0x1a724
movq (%rsp), %r13
movl $0x0, 0xb9c400(%r13)
movl 0xb9c40c(%r13), %r15d
movl 0xb9c500(%r13), %r12d
movl 0xb9c50c(%r13), %r14d
testq %r14, %r14
je 0x12b45
movl 0xb9c504(%r13), %ecx
movl 0xb9c508(%r13), %eax
shlq $0x20, %rax
orq %rcx, %rax
xorl %edx, %edx
divq %r14
movq %rax, %rbx
callq 0x12bf7
movq 0x10(%rbp), %r8
subq $0x8, %rsp
leaq 0x9891(%rip), %rdx      # 0x1c3b5
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
movl %ebx, %r9d
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r14
callq 0x199b4
addq $0x20, %rsp
movl $0x1, 0xb9c400(%r13)
movl $0x2, 0xb9c400(%r13)
movl $0x0, 0xbbc400(%r13)
movl 0xbbc40c(%r13), %r15d
movl 0xbbc500(%r13), %r12d
movl 0xbbc50c(%r13), %r14d
testq %r14, %r14
je 0x12bd2
movl 0xbbc504(%r13), %ecx
movl 0xbbc508(%r13), %eax
shlq $0x20, %rax
orq %rcx, %rax
xorl %edx, %edx
divq %r14
movq %rax, %rbx
callq 0x12bf7
movq 0x10(%rbp), %r8
subq $0x8, %rsp
leaq 0x9840(%rip), %rdx      # 0x1c3f1
movl $0x2, %edi
movl $0x1, %esi
movq %rax, %rcx
movl %ebx, %r9d
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r14
callq 0x199b4
addq $0x20, %rsp
movl $0x1, 0xbbc400(%r13)
movl $0x2, 0xbbc400(%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq