// File: /workspace/github_c_makefile_star2_O2/mikebdp2[P]AtomDis/main.c
// Function: do_list
void do_list (bios_tables_t *tabs)
{
    int i, len;
    const char *ind;

    fputs ("Command Tables:\n", stdout);
    for (i = 0; i < sizeof (ATOM_MASTER_LIST_OF_COMMAND_TABLES) / sizeof (uint16_t); i++) {
	int off = get_table_offset(tabs->MasterCommandTables, i);
	if (off)
	    fprintf (stdout, "  %04x:   %04x  Len %04x",
		     i, off, * (uint16_t *) (tabs->base+off));
	else
	    fprintf (stdout, "  %04x:   -             ", i);
	if ( (ind = get_index (INDEX_COMMAND_TABLE, i)) )
	    fprintf (stdout, "  (%s)", ind);
	putc ('\n', stdout);
    }
    fprintf (stdout, "\nData Tables:\n");
    for (i = 0; i < sizeof (ATOM_MASTER_LIST_OF_DATA_TABLES) / sizeof (uint16_t); i++) {
	data_dumper_t *dt   = NULL;
	const char *comment = NULL;
	int off = get_table_offset(tabs->MasterDataTables, i);
	if (off) {
	    uint8_t *data= tabs->base + off;
	    int     frev = data[2];
	    int     crev = data[3];
	    fprintf (stdout, "  %04x:   %04x  Len %04x  Rev %02x:%02x",
		     i, off, * (uint16_t *) data, frev, crev);
	    dt = get_data_dumper (i, &frev, &crev, &comment);
	} else
	    fprintf (stdout, "  %04x:   -                        ", i);
	if ( (ind = get_index (INDEX_DATA_TABLE, i)) )
	    fprintf (stdout, "  (%s)", ind);
	if (dt && (len = (*dt) (NULL, NULL, 0)) )
	    fprintf (stdout, "    (struct size %04x)", len);
	putc ('\n', stdout);
    }
    putc ('\n', stdout);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x37f94(%rip), %rbp     # 0x3cfc0
movq (%rbp), %rsi
leaq 0x1c40a(%rip), %rdi     # 0x21441
callq 0x40c0
pushq $0x1
popq %r12
pushq $0xa
popq %r15
leaq 0x1c407(%rip), %r13     # 0x21452
xorl %r14d, %r14d
cmpl $0x50, %r14d
je 0x50cb
movq 0x10(%rbx), %rdi
movl %r14d, %esi
callq 0x4c08
movq (%rbp), %rdi
testl %eax, %eax
je 0x5084
movq (%rbx), %rcx
movslq %eax, %rdx
movzwl (%rcx,%rdx), %r8d
movq %r13, %rsi
movl %r14d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x4150
jmp 0x5095
leaq 0x1c3e0(%rip), %rsi     # 0x2146b
movl %r14d, %edx
xorl %eax, %eax
callq 0x4150
movl %r12d, %edi
movl %r14d, %esi
callq 0x20888
testq %rax, %rax
je 0x50ba
movq (%rbp), %rdi
leaq 0x1c456(%rip), %rsi     # 0x21506
movq %rax, %rdx
xorl %eax, %eax
callq 0x4150
movq (%rbp), %rsi
movl %r15d, %edi
callq 0x4140
incl %r14d
jmp 0x504e
movq (%rbp), %rcx
leaq 0x1c3ae(%rip), %rdi     # 0x21484
pushq $0xe
popq %rsi
pushq $0x1
popq %rdx
callq 0x41f0
pushq $0x2
popq %r14
pushq $0xa
popq %r15
xorl %r12d, %r12d
cmpl $0x22, %r12d
je 0x51d8
andq $0x0, 0x10(%rsp)
movq 0x18(%rbx), %rdi
movl %r12d, %esi
callq 0x4c08
testl %eax, %eax
je 0x5161
movq (%rbx), %rcx
movslq %eax, %rdx
movzbl 0x2(%rcx,%rdx), %r9d
movl %r9d, 0xc(%rsp)
movzbl 0x3(%rcx,%rdx), %esi
movl %esi, 0x8(%rsp)
movq (%rbp), %rdi
movzwl (%rcx,%rdx), %r8d
movl %esi, (%rsp)
leaq 0x1c35a(%rip), %rsi     # 0x21493
movl %r12d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x4150
movl %r12d, %edi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x2082b
movq %rax, %r13
jmp 0x5179
movq (%rbp), %rdi
leaq 0x1c34f(%rip), %rsi     # 0x214bb
movl %r12d, %edx
xorl %eax, %eax
callq 0x4150
xorl %r13d, %r13d
movl %r14d, %edi
movl %r12d, %esi
callq 0x20888
testq %rax, %rax
je 0x519e
movq (%rbp), %rdi
leaq 0x1c372(%rip), %rsi     # 0x21506
movq %rax, %rdx
xorl %eax, %eax
callq 0x4150
testq %r13, %r13
je 0x51c4
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq *%r13
testl %eax, %eax
je 0x51c4
movq (%rbp), %rdi
leaq 0x1c324(%rip), %rsi     # 0x214df
movl %eax, %edx
xorl %eax, %eax
callq 0x4150
movq (%rbp), %rsi
movl %r15d, %edi
callq 0x4140
incl %r12d
jmp 0x50ec
movq (%rbp), %rsi
pushq $0xa
popq %rdi
callq 0x4140
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq