// File: /workspace/github_c_makefile_star2_O2/Nico01[P]obj2asm/oprocess.c
// Function: iterated
void iterated(DAT_T *data_rec, DAT_T *next_rec)
{
    char            temp[20];
    word    length;
    word    length_used;
    PUB_T           *save_pub_rec;
    int             dup_only;
    int             dummy;
    dword   repeat;
    STRUC_T         *this_struc;

    length = data_rec->length;
    fseek( o_file, data_rec->file_pos, L_SET );
    length = buff_init( length );

    if ( data_check( 0 ) == LABEL ) {
        proc_label();
    }

    save_pub_rec = last_pub_rec;
    if ( last_pub_rec ) {
        if ( pass == 3 ) {
            if ( last_pub_rec->type == FAR ) {
                out_directive("=");
                out_operand("$");
            }
            if ( last_pub_rec->type == NEAR ) {
                out_endline();
            }
        }
    }

    /*
    ** Process iterated data with this record
    */
    strcpy( structure_form, "" );
    if ( data_rec->structure ) {
        /* Processing for structures */
        dup_only = FALSE;
    } else {
        if ( pass == 1 ) {
            dup_only = FALSE;       /* Give 1 chance (pass 1) at structuring */
        } else {
            dup_only = TRUE;
        }
    }

    dup_buff[0]   = '\0';
    strcpy( struc_buff, "<" );

    while ( length > 0 ) {
        length_used = 0;
        data_rec->size = proc_idb( 1, 1L, &dup_only, data_rec->extended,
                                           &length_used, &repeat );
        sprintf( temp, "(%ld,%1d)", repeat, size_to_type(data_rec->size) );
        strcat( structure_form, temp );
        length -= length_used;
        if ( length ) {
            strcat( dup_buff, "," );
            strcat( struc_buff, "," );
        }
    }

    if ( dup_only ) {
        if ( save_pub_rec ) {
            save_pub_rec->type = size_to_type( data_rec->size );
        }
        if ( pass == 3 ) {
            out_directive( size_to_opcode(data_rec->size, &dummy) );
            out_operand( dup_buff );
            out_endline();
        }
    } else {
        /*
        ** Its a structure!
        */
        strcat( struc_buff, ">" );

        if ( pass == 1 ) {
            data_rec->structure = struc_insert( structure_form );
        }

        this_struc = data_rec->structure;

        if ( save_pub_rec ) {
            save_pub_rec->structure = this_struc;
        }

        if ( pass == 3 ) {
            sprintf( temp, "struct_%d", this_struc->index );
            out_directive( temp );
            out_operand( struc_buff );
            out_endline();
        }
    }

    next_rec = next_rec;       /* Prevent unused variable warnings */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl 0x18(%rdi), %ebp
leaq 0xe652(%rip), %rax      # 0x1bf58
movq (%rax), %rdi
movq 0x10(%rbx), %rsi
xorl %edx, %edx
callq 0x9160
movl %ebp, %edi
callq 0xec3f
movl %eax, %ebp
xorl %edi, %edi
callq 0xc74e
cmpl $0x1, %eax
jne 0xd92e
callq 0xd050
leaq 0xe75b(%rip), %r14      # 0x1c090
movq (%r14), %r12
leaq 0xe629(%rip), %r15      # 0x1bf68
testq %r12, %r12
je 0xd97c
cmpl $0x3, (%r15)
jne 0xd97c
movl 0x38(%r12), %eax
cmpl $0x2, %eax
jne 0xd972
leaq 0x4c9f(%rip), %rdi      # 0x125fa
callq 0xc554
leaq 0x531d(%rip), %rdi      # 0x12c84
callq 0xc4c6
movq (%r14), %rax
movl 0x38(%rax), %eax
cmpl $0x1, %eax
jne 0xd97c
callq 0xc522
movb $0x0, 0xeb9d(%rip)      # 0x1c520
cmpq $0x0, 0x20(%rbx)
movq %r12, 0x8(%rsp)
jne 0xd999
cmpl $0x1, (%r15)
jne 0xdac6
andl $0x0, (%rsp)
movb $0x0, 0xe91c(%rip)      # 0x1c2c0
movw $0x3c, 0xea13(%rip)     # 0x1c3c0
leaq 0x20(%rsp), %r12
leaq 0xe907(%rip), %r15      # 0x1c2c0
movw $0x2c, %r13w
testl %ebp, %ebp
je 0xda46
andl $0x0, 0x4(%rsp)
movl 0x1c(%rbx), %ecx
pushq $0x1
popq %rdi
pushq $0x1
popq %rsi
movq %rsp, %rdx
leaq 0x4(%rsp), %r8
leaq 0x10(%rsp), %r9
callq 0xcb8f
movl %eax, 0xc(%rbx)
movq 0x10(%rsp), %r14
movl %eax, %edi
callq 0xeeb8
movq %r12, %rdi
leaq 0x5357(%rip), %rsi      # 0x12d56
movq %r14, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x91b0
leaq 0xeb0e(%rip), %rdi      # 0x1c520
movq %r12, %rsi
callq 0x91a0
subl 0x4(%rsp), %ebp
je 0xd9be
movq %r15, %rdi
callq 0x90b0
movw %r13w, (%rax,%r15)
leaq 0xe98c(%rip), %r14      # 0x1c3c0
movq %r14, %rdi
callq 0x90b0
movw %r13w, (%rax,%r14)
jmp 0xd9be
cmpl $0x0, (%rsp)
je 0xda8c
movq 0x8(%rsp), %r14
testq %r14, %r14
je 0xda62
movl 0xc(%rbx), %edi
callq 0xeeb8
movl %eax, 0x38(%r14)
leaq 0xe4ff(%rip), %rax      # 0x1bf68
cmpl $0x3, (%rax)
jne 0xdb1a
movl 0xc(%rbx), %edi
leaq 0x1c(%rsp), %rsi
callq 0xef12
movq %rax, %rdi
callq 0xc554
jmp 0xdb0d
leaq 0xe92d(%rip), %r14      # 0x1c3c0
movq %r14, %rdi
callq 0x90b0
movw $0x3e, (%rax,%r14)
leaq 0xe4bf(%rip), %r14      # 0x1bf68
cmpl $0x1, (%r14)
movq 0x8(%rsp), %r15
jne 0xdad2
leaq 0xea65(%rip), %rdi      # 0x1c520
callq 0xef8f
movq %rax, 0x20(%rbx)
jmp 0xdad6
movl $0x1, (%rsp)
jmp 0xd99d
movq 0x20(%rbx), %rax
testq %r15, %r15
je 0xdadf
movq %rax, 0x48(%r15)
cmpl $0x3, (%r14)
jne 0xdb1a
movl 0x8(%rax), %edx
leaq 0x5271(%rip), %rsi      # 0x12d60
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x91b0
movq %rbx, %rdi
callq 0xc554
leaq 0xe8b3(%rip), %r15      # 0x1c3c0
movq %r15, %rdi
callq 0xc4c6
callq 0xc522
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq