// File: /workspace/github_c_makefile_star2_O0/intel[P]pf-bb-config/vrb2/vrb2_cfg_app.c
// Function: vrb2_pfvf
static void
vrb2_pfvf(void *dev, unsigned int vf_index, unsigned int payload)
{
	hw_device *accel_dev = (hw_device *)dev;
	unsigned int window_index;

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

	if (payload == REQ_DEV_STATUS) {
		vrb2_db_write(dev, 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_CORRECT_ERR)
			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) {
		vrb2_db_write(dev, vf_index, (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;
		vrb2_db_write(dev, vf_index, (uint32_t)accel_dev->fft_win_size[window_index]);
	}
	if ((payload & REQ_DEV_MASK) == REQ_DEV_FFT_WIN_START) {
		window_index = payload >> 16;
		vrb2_db_write(dev, vf_index, (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 $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x1bd70
movq %rax, %rcx
leaq 0x22a27(%rip), %rax     # 0x3b8d0
movq 0x18(%rax), %r8
movl -0x10(%rbp), %eax
movl $0x3, %edi
xorl %esi, %esi
leaq 0xb58e(%rip), %rdx      # 0x2444c
leaq 0xc6e0(%rip), %r9       # 0x255a5
movl %eax, (%rsp)
movb $0x0, %al
callq 0x216e0
cmpl $0x1, -0x10(%rbp)
jne 0x18ff8
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0xf0(%rax,%rcx,8), %rax
movl %eax, %edx
callq 0x1c090
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 0x18fad
callq 0x1bd70
movq %rax, -0x40(%rbp)
leaq 0x229a6(%rip), %rax     # 0x3b8d0
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0xf0(%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0xf0(%rax,%rcx,8), %rax
movl %eax, %edi
callq 0x21ac0
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
movl -0x2c(%rbp), %r9d
movq -0x28(%rbp), %r10
movl $0x2, %edi
xorl %esi, %esi
leaq 0xb4f6(%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 0x18fe3
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq $0x7, 0xf0(%rax,%rcx,8)
je 0x18fe3
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq $0x8, 0xf0(%rax,%rcx,8)
jne 0x18ff6
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq $0x3, 0xf0(%rax,%rcx,8)
jmp 0x18ff8
cmpl $0x3, -0x10(%rbp)
jne 0x19015
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movzwl 0x4fc(%rax), %edx
callq 0x1c090
movl -0x10(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
cmpl $0x4, %eax
jne 0x19045
movl -0x10(%rbp), %eax
shrl $0x10, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl 0x540(%rax,%rcx,4), %edx
callq 0x1c090
movl -0x10(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
cmpl $0x5, %eax
jne 0x19075
movl -0x10(%rbp), %eax
shrl $0x10, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl 0x500(%rax,%rcx,4), %edx
callq 0x1c090
cmpl $0x2, -0x10(%rbp)
jne 0x190cc
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq $0x3, 0xf0(%rax,%rcx,8)
jne 0x190cc
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movq $0x4, 0xf0(%rax,%rcx,8)
callq 0x1bd70
movq %rax, %rcx
leaq 0x22821(%rip), %rax     # 0x3b8d0
movq 0x10(%rax), %r8
movl -0xc(%rbp), %r9d
movl $0x2, %edi
xorl %esi, %esi
leaq 0xb3e1(%rip), %rdx      # 0x244a6
movb $0x0, %al
callq 0x216e0
callq 0x1bd70
movq %rax, %rcx
leaq 0x227f5(%rip), %rax     # 0x3b8d0
movq 0x18(%rax), %r8
movl $0x3, %edi
xorl %esi, %esi
leaq 0xa5d5(%rip), %rdx      # 0x236c2
leaq 0xc4b1(%rip), %r9       # 0x255a5
movb $0x0, %al
callq 0x216e0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)