// File: /workspace/github_c_makefile_star2_O0/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb1_pfvf
static void
vrb1_pfvf(void *dev, unsigned int vf_index, unsigned int payload)
{
	hw_device *accel_dev = (hw_device *)dev;
	uint8_t *bar0addr = accel_dev->bar0Addr;
	unsigned int window_index;

	LOG(DEBUG, "Doorbell vf2pf %d", payload);

	if (payload == REQ_DEV_STATUS) {
		vrb1_reg_fast_write(bar0addr, HWPfHiPfToVfDbellVf +
					BB_ACC_PF_TO_VF_DBELL_REG_OFFSET * vf_index,
					accel_dev->dev_status[vf_index]);
		if (accel_dev->prev_status[vf_index] != accel_dev->dev_status[vf_index]) {
			LOG(INFO, "Report Device Status VF: %u Status %lu %s",
				vf_index, accel_dev->dev_status[vf_index],
				bb_acc_device_status_str(accel_dev->dev_status[vf_index]));
			accel_dev->prev_status[vf_index] = accel_dev->dev_status[vf_index];
		}
		/* Clear back when read once */
		if (accel_dev->dev_status[vf_index] == RTE_BBDEV_DEV_RESTART_REQ ||
				accel_dev->dev_status[vf_index] == RTE_BBDEV_DEV_RECONFIG_REQ)
			accel_dev->dev_status[vf_index] = RTE_BBDEV_DEV_CONFIGURED;
	}
	/* Reports a version number based on the used FFT LUT binary file. */
	if (payload == REQ_DEV_LUT_VER) {
		vrb1_reg_fast_write(bar0addr, HWPfHiPfToVfDbellVf +
				vf_index * BB_ACC_PF_TO_VF_DBELL_REG_OFFSET,
				(uint32_t)accel_dev->fft_version_md5sum);
	}
	/* Reports Window sizes based on the used FFT LUT binary file. */
	if ((payload & REQ_DEV_MASK) == REQ_DEV_FFT_WIN_SIZE) {
		window_index = payload >> 16;
		vrb1_reg_fast_write(bar0addr, HWPfHiPfToVfDbellVf
				+ vf_index * BB_ACC_PF_TO_VF_DBELL_REG_OFFSET,
				(uint32_t)accel_dev->fft_win_size[window_index]);
	}
	if ((payload & REQ_DEV_MASK) == REQ_DEV_FFT_WIN_START) {
		window_index = payload >> 16;
		vrb1_reg_fast_write(bar0addr, HWPfHiPfToVfDbellVf
				+ vf_index * BB_ACC_PF_TO_VF_DBELL_REG_OFFSET,
				(uint32_t)accel_dev->fft_win_start[window_index]);
	}
	if (payload == REQ_DEV_NEW && accel_dev->dev_status[vf_index] == RTE_BBDEV_DEV_CONFIGURED) {
		accel_dev->dev_status[vf_index] = RTE_BBDEV_DEV_ACTIVE;
		LOG(INFO, "VF Device %u becomes active", vf_index);
	}

	LOG(DEBUG, "Done");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x20(%rbp)
callq 0x16250
movq %rax, %rcx
leaq 0x28328(%rip), %rax     # 0x3b8d0
movq 0x18(%rax), %r8
movl -0x10(%rbp), %eax
movl $0x3, %edi
xorl %esi, %esi
leaq 0x10e8f(%rip), %rdx     # 0x2444c
leaq 0x10ea7(%rip), %r9      # 0x2446b
movl %eax, (%rsp)
movb $0x0, %al
callq 0x216e0
cmpl $0x1, -0x10(%rbp)
jne 0x136ee
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
shll $0x8, %esi
addl $0xc80008, %esi         # imm = 0xC80008
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0xf0(%rax,%rcx,8), %rax
movl %eax, %edx
callq 0x14210
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0x2f0(%rax,%rcx,8), %rax
movq -0x18(%rbp), %rcx
movl -0xc(%rbp), %edx
cmpq 0xf0(%rcx,%rdx,8), %rax
je 0x136b5
callq 0x16250
movq %rax, -0x48(%rbp)
leaq 0x2829e(%rip), %rax     # 0x3b8d0
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0xf0(%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0xf0(%rax,%rcx,8), %rax
movl %eax, %edi
callq 0x21ac0
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %r8
movl -0x34(%rbp), %r9d
movq -0x30(%rbp), %r10
movl $0x2, %edi
xorl %esi, %esi
leaq 0x10dee(%rip), %rdx     # 0x24475
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x216e0
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0xf0(%rax,%rcx,8), %rdx
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq %rdx, 0x2f0(%rax,%rcx,8)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq $0x6, 0xf0(%rax,%rcx,8)
je 0x136d9
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq $0x7, 0xf0(%rax,%rcx,8)
jne 0x136ec
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq $0x3, 0xf0(%rax,%rcx,8)
jmp 0x136ee
cmpl $0x3, -0x10(%rbp)
jne 0x13714
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
shll $0x8, %esi
addl $0xc80008, %esi         # imm = 0xC80008
movq -0x18(%rbp), %rax
movzwl 0x4fc(%rax), %edx
callq 0x14210
movl -0x10(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
cmpl $0x4, %eax
jne 0x1374d
movl -0x10(%rbp), %eax
shrl $0x10, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
shll $0x8, %esi
addl $0xc80008, %esi         # imm = 0xC80008
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl 0x540(%rax,%rcx,4), %edx
callq 0x14210
movl -0x10(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
cmpl $0x5, %eax
jne 0x13786
movl -0x10(%rbp), %eax
shrl $0x10, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
shll $0x8, %esi
addl $0xc80008, %esi         # imm = 0xC80008
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl 0x500(%rax,%rcx,4), %edx
callq 0x14210
cmpl $0x2, -0x10(%rbp)
jne 0x137dd
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq $0x3, 0xf0(%rax,%rcx,8)
jne 0x137dd
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq $0x4, 0xf0(%rax,%rcx,8)
callq 0x16250
movq %rax, %rcx
leaq 0x28110(%rip), %rax     # 0x3b8d0
movq 0x10(%rax), %r8
movl -0xc(%rbp), %r9d
movl $0x2, %edi
xorl %esi, %esi
leaq 0x10cd0(%rip), %rdx     # 0x244a6
movb $0x0, %al
callq 0x216e0
callq 0x16250
movq %rax, %rcx
leaq 0x280e4(%rip), %rax     # 0x3b8d0
movq 0x18(%rax), %r8
movl $0x3, %edi
xorl %esi, %esi
leaq 0xfec4(%rip), %rdx      # 0x236c2
leaq 0x10c66(%rip), %r9      # 0x2446b
movb $0x0, %al
callq 0x216e0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)