// File: /workspace/github_c_makefile_star2_O1/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 0x36e72(%rip), %r14     # 0x3bfc0
movq (%r14), %rsi
leaq 0x1d2e9(%rip), %rdi     # 0x22441
callq 0x40c0
leaq 0x1d307(%rip), %r13     # 0x2246b
leaq 0x1d39b(%rip), %r15     # 0x22506
leaq 0x1d2e0(%rip), %r12     # 0x22452
xorl %ebp, %ebp
movq 0x10(%rbx), %rdi
movl %ebp, %esi
callq 0x4d89
movq (%r14), %rdi
testl %eax, %eax
je 0x51a1
movq (%rbx), %rcx
movslq %eax, %rdx
movzwl (%rcx,%rdx), %r8d
movq %r12, %rsi
movl %ebp, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x4150
jmp 0x51ad
movq %r13, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x4150
movl $0x1, %edi
movl %ebp, %esi
callq 0x214ec
testq %rax, %rax
je 0x51ce
movq (%r14), %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4150
movq (%r14), %rsi
movl $0xa, %edi
callq 0x4140
incl %ebp
cmpl $0x50, %ebp
jne 0x5174
movq (%r14), %rcx
leaq 0x1d298(%rip), %rdi     # 0x22484
movl $0xe, %esi
movl $0x1, %edx
callq 0x41f0
leaq 0x8(%rsp), %rbp
leaq 0x10(%rsp), %r15
xorl %r12d, %r12d
movq $0x0, 0x10(%rsp)
movq 0x18(%rbx), %rdi
movl %r12d, %esi
callq 0x4d89
testl %eax, %eax
je 0x5271
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 (%r14), %rdi
movzwl (%rcx,%rdx), %r8d
movl %esi, (%rsp)
leaq 0x1d246(%rip), %rsi     # 0x22493
movl %r12d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x4150
movl %r12d, %edi
leaq 0xc(%rsp), %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0x21471
movq %rax, %r13
jmp 0x5288
movq (%r14), %rdi
leaq 0x1d240(%rip), %rsi     # 0x224bb
movl %r12d, %edx
xorl %eax, %eax
callq 0x4150
xorl %r13d, %r13d
movl $0x2, %edi
movl %r12d, %esi
callq 0x214ec
testq %rax, %rax
je 0x52ae
movq (%r14), %rdi
leaq 0x1d262(%rip), %rsi     # 0x22506
movq %rax, %rdx
xorl %eax, %eax
callq 0x4150
testq %r13, %r13
je 0x52d3
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq *%r13
testl %eax, %eax
je 0x52d3
movq (%r14), %rdi
leaq 0x1d215(%rip), %rsi     # 0x224df
movl %eax, %edx
xorl %eax, %eax
callq 0x4150
movq (%r14), %rsi
movl $0xa, %edi
callq 0x4140
incl %r12d
cmpl $0x22, %r12d
jne 0x5208
movq (%r14), %rsi
movl $0xa, %edi
callq 0x4140
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq