// File: /workspace/github_c_makefile_star2_O2/Nico01[P]obj2asm/oreport.c
// Function: list_struc
void list_struc()
{
    NODE_T          *struc_node;
    STRUC_T         *struc_rec;
    char            temp[50];
    int             index;
    char            *cp;
    char            ch;
    dword   dup_cnt;
    int             type;
    int             mem_cnt;
    int             times;

    index = 0;
    out_newline();
    struc_node = start( struc_tree, RIGHT );
    while ( struc_node != struc_tree ) {
        struc_rec = (STRUC_T *)struc_node->data;

        struc_rec->index = index;
        cp = struc_rec->form;

        sprintf( temp, "struct_%d", index );
        out_line( temp, "struc", "", "" );

        mem_cnt = 0;
        while ( (ch=*cp) != '\0' ) {
            switch( ch ) {
                case '(':
                    dup_cnt = atol( cp+1 );
                    break;
                case ',':
                    type = atoi( cp+1 );
                    break;
                case ')':
                    sprintf( temp, "s%dm_%d", index, mem_cnt );
                    out_label( temp );
                    out_directive( size_to_opcode(type_to_size(type), &times) );
                    if ( dup_cnt == 1L ) {
                        strcpy( temp, "?" );
                    } else {
                        sprintf( temp, "%ld dup (?)", dup_cnt );
                    }
                    out_operand( temp );
                    out_endline();
                    mem_cnt++;
                default:
                    break;
            }
            cp++;
        }

        sprintf( temp, "struct_%d", index );
        out_line( temp, "ends", "", "" );

        out_newline();

        index++;
        struc_node = traverse( struc_node, RIGHT );
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
callq 0xc54f
leaq 0xd806(%rip), %rax      # 0x1bfc8
movq (%rax), %rdi
pushq $0x1
popq %rsi
callq 0x11e9b
movq %rax, %rcx
leaq 0x10(%rsp), %r15
xorl %ebp, %ebp
leaq 0xd7ea(%rip), %rax      # 0x1bfc8
cmpq (%rax), %rcx
je 0xe919
movq %rcx, (%rsp)
movq 0x20(%rcx), %rax
movl %ebp, 0x8(%rax)
movq (%rax), %rbx
xorl %r13d, %r13d
movq %r15, %rdi
leaq 0x455e(%rip), %rsi      # 0x12d60
movl %ebp, %edx
xorl %eax, %eax
callq 0x91b0
movq %r15, %rdi
leaq 0x4793(%rip), %rsi      # 0x12fa8
leaq 0x48f0(%rip), %rcx      # 0x1310c
movq %rcx, %rdx
callq 0xc585
incq %rbx
movzbl -0x1(%rbx), %eax
cmpl $0x28, %eax
je 0xe88c
cmpl $0x29, %eax
je 0xe843
cmpl $0x2c, %eax
je 0xe899
testl %eax, %eax
jne 0xe824
jmp 0xe8d2
movq %r15, %rdi
leaq 0x4bbf(%rip), %rsi      # 0x1340c
movl %ebp, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x91b0
movq %r15, %rdi
callq 0xc471
movl %r14d, %edi
callq 0xeeda
movl %eax, %edi
leaq 0xc(%rsp), %rsi
callq 0xef12
movq %rax, %rdi
callq 0xc554
cmpq $0x1, %r12
jne 0xe8a9
movw $0x3f, 0x10(%rsp)
jmp 0xe8bd
movq %rbx, %rdi
callq 0x9170
movq %rax, %r12
jmp 0xe824
movq %rbx, %rdi
callq 0x9190
movl %eax, %r14d
jmp 0xe824
movq %r15, %rdi
leaq 0x46fb(%rip), %rsi      # 0x12fae
movq %r12, %rdx
xorl %eax, %eax
callq 0x91b0
movq %r15, %rdi
callq 0xc4c6
callq 0xc522
incl %r13d
jmp 0xe824
movq %r15, %rdi
leaq 0x4484(%rip), %rsi      # 0x12d60
movl %ebp, %edx
xorl %eax, %eax
callq 0x91b0
movq %r15, %rdi
leaq 0x46cb(%rip), %rsi      # 0x12fba
leaq 0x4816(%rip), %rcx      # 0x1310c
movq %rcx, %rdx
callq 0xc585
callq 0xc54f
incl %ebp
movq (%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x11ebc
movq %rax, %rcx
jmp 0xe7d7
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq