// File: /workspace/github_c_makefile_star2_O0/intel[P]pf-bb-config/agx100/agx100_cfg_app.c
// Function: print_static_reg_debug_info
static inline void
print_static_reg_debug_info(void *mmio_base)
{
	uint8_t i, q_id;
	uint32_t fid;
	uint32_t version_num_queues = agx100_reg_read_32(mmio_base, AGX100_VERSION_QUEUES_REG);
	uint8_t major_version_id = version_num_queues >> 16;
	uint8_t minor_version_id = version_num_queues >> 8;
	uint8_t patch_id = version_num_queues;
	uint8_t qmap_done = agx100_reg_read_8(mmio_base, AGX100_QUEUE_PF_VF_MAP_DONE);
	uint16_t lb_factor = agx100_reg_read_16(mmio_base, AGX100_LOAD_BALANCE_FACTOR);
	uint16_t ring_desc_len = agx100_reg_read_16(mmio_base, AGX100_RING_DESC_LEN);

	/* Maximum number of queues on device */
	uint8_t total_num_queues = version_num_queues >> 24;
	uint8_t num_ul_queues = total_num_queues >> 1;

	printf("AGX100 RTL v%u.%u.%u\n", major_version_id, minor_version_id, patch_id);
	printf("Max number of Queues = %u\n", total_num_queues);
	printf("UL.DL Load Balance = %u.%u\n",
			((uint8_t)lb_factor), ((uint8_t)(lb_factor >> 8)));
	printf("Queue-PF/VF Mapping Table = %s\n",
			(qmap_done > 0) ? "READY" : "NOT-READY");
	printf("Ring Descriptor Size = %u bytes\n",
			ring_desc_len*AGX100_RING_DESC_LEN_UNIT_BYTES);

	printf("\n--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n");
	printf("        |  PF | VF0 | VF1 | VF2 | VF3 | VF4 | VF5 | VF6 | VF7 |\n");
	printf("--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n");

	for (q_id = 0; q_id < total_num_queues; q_id++) {

		printf("%s-Q'%02u |",
			(q_id < num_ul_queues) ? "UL" : "DL", q_id);

		fid = agx100_reg_read_32(mmio_base,
				AGX100_QUEUE_MAP + (q_id << 2));

		for (i = 0; i < 9; ++i) {

			if (!((fid >> 16) & (0x80)) && i == 0) {
				printf("  X  |");
				continue;
			}

			if (((((fid >> 16) & (0x7f)) + 1) == i) &&
					((fid >> 16) & (0x80)))
				printf("  X  |");
			else
				printf("     |");
		}
		printf("\n");
	}
	printf("--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+\n\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x1e050
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
shrl $0x10, %eax
movb %al, -0x15(%rbp)
movl -0x14(%rbp), %eax
shrl $0x8, %eax
movb %al, -0x16(%rbp)
movl -0x14(%rbp), %eax
movb %al, -0x17(%rbp)
movq -0x8(%rbp), %rdi
movl $0x8, %esi
callq 0x1e320
movb %al, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x1e350
movw %ax, -0x1a(%rbp)
movq -0x8(%rbp), %rdi
movl $0xc, %esi
callq 0x1e350
movw %ax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
shrl $0x18, %eax
movb %al, -0x1d(%rbp)
movzbl -0x1d(%rbp), %eax
sarl %eax
movb %al, -0x1e(%rbp)
movzbl -0x15(%rbp), %esi
movzbl -0x16(%rbp), %edx
movzbl -0x17(%rbp), %ecx
leaq 0x7835(%rip), %rdi      # 0x259a1
movb $0x0, %al
callq 0xd140
movzbl -0x1d(%rbp), %esi
leaq 0x7839(%rip), %rdi      # 0x259b7
movb $0x0, %al
callq 0xd140
movw -0x1a(%rbp), %ax
movzbl %al, %esi
movzwl -0x1a(%rbp), %eax
sarl $0x8, %eax
movzbl %al, %edx
leaq 0x5d74(%rip), %rdi      # 0x23f11
movb $0x0, %al
callq 0xd140
movzbl -0x18(%rbp), %ecx
leaq 0x5d9e(%rip), %rsi      # 0x23f4d
leaq 0x5d9b(%rip), %rax      # 0x23f51
cmpl $0x0, %ecx
cmovgq %rax, %rsi
leaq 0x5d69(%rip), %rdi      # 0x23f2d
movb $0x0, %al
callq 0xd140
movzwl -0x1c(%rbp), %esi
shll $0x6, %esi
leaq 0x5d7e(%rip), %rdi      # 0x23f57
movb $0x0, %al
callq 0xd140
leaq 0x5da8(%rip), %rdi      # 0x23f8f
movb $0x0, %al
callq 0xd140
leaq 0x5ddc(%rip), %rdi      # 0x23fd1
movb $0x0, %al
callq 0xd140
leaq 0x5d8d(%rip), %rdi      # 0x23f90
movb $0x0, %al
callq 0xd140
movb $0x0, -0xa(%rbp)
movzbl -0xa(%rbp), %eax
movzbl -0x1d(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1e304
movzbl -0xa(%rbp), %ecx
movzbl -0x1e(%rbp), %edx
leaq 0x5df4(%rip), %rsi      # 0x24021
leaq 0x5dea(%rip), %rax      # 0x2401e
cmpl %edx, %ecx
cmovlq %rax, %rsi
movzbl -0xa(%rbp), %edx
leaq 0x5dcd(%rip), %rdi      # 0x24012
movb $0x0, %al
callq 0xd140
movq -0x8(%rbp), %rdi
movzbl -0xa(%rbp), %esi
shll $0x2, %esi
addl $0x100, %esi            # imm = 0x100
callq 0x1e050
movl %eax, -0x10(%rbp)
movb $0x0, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x9, %eax
jge 0x1e2e9
movl -0x10(%rbp), %eax
shrl $0x10, %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x1e29b
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
jne 0x1e29b
leaq 0x5d92(%rip), %rdi      # 0x24024
movb $0x0, %al
callq 0xd140
jmp 0x1e2df
movl -0x10(%rbp), %eax
shrl $0x10, %eax
andl $0x7f, %eax
addl $0x1, %eax
movzbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
jne 0x1e2cf
movl -0x10(%rbp), %eax
shrl $0x10, %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x1e2cf
leaq 0x5d5e(%rip), %rdi      # 0x24024
movb $0x0, %al
callq 0xd140
jmp 0x1e2dd
leaq 0x5d55(%rip), %rdi      # 0x2402b
movb $0x0, %al
callq 0xd140
jmp 0x1e2df
movb -0x9(%rbp), %al
addb $0x1, %al
movb %al, -0x9(%rbp)
jmp 0x1e269
leaq 0x5d82(%rip), %rdi      # 0x24072
movb $0x0, %al
callq 0xd140
movb -0xa(%rbp), %al
addb $0x1, %al
movb %al, -0xa(%rbp)
jmp 0x1e20e
leaq 0x5d27(%rip), %rdi      # 0x24032
movb $0x0, %al
callq 0xd140
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)