// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movq %rdi, %rcx
movl 0x18(%rdi), %ebp
leaq 0xefd7(%rip), %rax      # 0x1cf58
movq (%rax), %rdi
movq %rcx, 0x8(%rsp)
movq 0x10(%rcx), %rsi
xorl %edx, %edx
callq 0x9160
movl %ebp, %edi
callq 0xf398
movl %eax, %ebp
xorl %edi, %edi
callq 0xcca8
cmpl $0x1, %eax
jne 0xdfae
callq 0xd63e
leaq 0xf0db(%rip), %rbx      # 0x1d090
movq (%rbx), %r15
leaq 0xefa9(%rip), %r14      # 0x1cf68
testq %r15, %r15
je 0xdff7
cmpl $0x3, (%r14)
jne 0xdff7
cmpl $0x2, 0x38(%r15)
jne 0xdfe9
leaq 0x5622(%rip), %rdi      # 0x135fa
callq 0xca9b
leaq 0x5ca0(%rip), %rdi      # 0x13c84
callq 0xc9d9
movq (%rbx), %rax
cmpl $0x1, 0x38(%rax)
jne 0xdff7
callq 0xca3f
movb $0x0, 0xf522(%rip)      # 0x1d520
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
movq %r15, 0x18(%rsp)
jne 0xe019
cmpl $0x1, (%r14)
jne 0xe1be
movl $0x0, 0x4(%rsp)
movb $0x0, 0xf298(%rip)      # 0x1d2c0
movw $0x3c, 0xf38f(%rip)     # 0x1d3c0
testl %ebp, %ebp
je 0xe0d9
leaq 0x30(%rsp), %r14
leaq 0xf27b(%rip), %r12      # 0x1d2c0
movw $0x2c, %bx
leaq 0xf370(%rip), %r13      # 0x1d3c0
movl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %r15
movl 0x1c(%r15), %ecx
movl $0x1, %esi
movl $0x1, %edi
leaq 0x4(%rsp), %rdx
leaq 0x14(%rsp), %r8
leaq 0x20(%rsp), %r9
callq 0xd137
movl %eax, 0xc(%r15)
movq 0x20(%rsp), %r15
movl %eax, %edi
callq 0xf608
movq %r14, %rdi
leaq 0x5cbd(%rip), %rsi      # 0x13d56
movq %r15, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x91b0
leaq 0xf474(%rip), %rdi      # 0x1d520
movq %r14, %rsi
callq 0x91a0
subl 0x14(%rsp), %ebp
je 0xe0d9
movq %r12, %rdi
callq 0x90b0
movw %bx, (%rax,%r12)
movq %r13, %rdi
callq 0x90b0
movw %bx, (%rax,%r13)
jmp 0xe050
cmpl $0x0, 0x4(%rsp)
je 0xe12e
movq 0x18(%rsp), %r14
testq %r14, %r14
leaq 0xee79(%rip), %rbx      # 0x1cf68
je 0xe102
movq 0x8(%rsp), %rax
movl 0xc(%rax), %edi
callq 0xf608
movl %eax, 0x38(%r14)
cmpl $0x3, (%rbx)
jne 0xe1af
movq 0x8(%rsp), %rax
movl 0xc(%rax), %edi
leaq 0x2c(%rsp), %rsi
callq 0xf662
movq %rax, %rdi
callq 0xca9b
leaq 0xf194(%rip), %r14      # 0x1d2c0
jmp 0xe1a2
leaq 0xf28b(%rip), %r14      # 0x1d3c0
movq %r14, %rdi
callq 0x90b0
movw $0x3e, (%rax,%r14)
leaq 0xee1d(%rip), %rbx      # 0x1cf68
cmpl $0x1, (%rbx)
movq 0x18(%rsp), %r15
jne 0xe16a
leaq 0xf3c4(%rip), %rdi      # 0x1d520
callq 0xf6e3
movq 0x8(%rsp), %rcx
movq %rax, 0x20(%rcx)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
testq %r15, %r15
je 0xe17c
movq %rax, 0x48(%r15)
cmpl $0x3, (%rbx)
jne 0xe1af
movl 0x8(%rax), %edx
leaq 0x5bd5(%rip), %rsi      # 0x13d60
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x91b0
movq %rbx, %rdi
callq 0xca9b
movq %r14, %rdi
callq 0xc9d9
callq 0xca3f
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, 0x4(%rsp)
jmp 0xe021