// File: /workspace/github_c_makefile_star2_O1/heltilda[P]cicada/intrpt.c
// Function: doReadWrite
void doReadWrite(view *theView, void *globalPtr, void *secondaryPtr, ccBool doInIndexOrder, ccBool skipBusyMembers, ccBool bundleStrings,
        void(*srwComposite)(view *, void *, void *),
        void(*srwData)(view *, void *, void *),
        void(*srwString)(view *, ccInt, void *, void *))
{
    view nextView;
    member *loopMember;
    variable *theVar = theView->windowPtr->variable_ptr;
    ccInt memberCounter, indexCounter;
    
    if (theVar->type >= composite_type)   {
        
        for (memberCounter = 1; memberCounter <= theVar->mem.members.elementNum; memberCounter++)  {
            loopMember = LL_member(theVar, memberCounter);
            
            if (isBusy(loopMember, busy_SRW_flag))  {
                if (!skipBusyMembers)  {
                    setError(self_reference_err, pcCodePtr-1);
                    return;
            }   }
            
            else  {
                setBusy(loopMember, busy_SRW_flag);
                
                if ((loopMember->memberWindow != NULL) && (!loopMember->ifHidden))      {
                    if (doInIndexOrder)  {
                    for (indexCounter = 0; indexCounter < theView->width*loopMember->indices; indexCounter++)  {
                        nextView.windowPtr = theView->windowPtr;
                        nextView.offset = theView->offset;
                        nextView.width = 1;
                        stepView(&nextView, loopMember, indexCounter, 1);
                        if (errCode == passed)  srwComposite(&nextView, globalPtr, secondaryPtr);
                        else  errCode = passed;
                    }}
                    
                    else  {
                        nextView = *theView;
                        stepView(&nextView, loopMember, 0, loopMember->indices);
                        if (errCode == passed)  srwComposite(&nextView, globalPtr, secondaryPtr);
                        else  errCode = passed;
                }   }
                
                clearBusy(loopMember, busy_SRW_flag);
                if (errCode != passed)  return;
    }   }   }
    
    else  {        // it's a primitive variable
        if (theVar->type == string_type)  {
            ccInt viewTop = theView->width;
            if (bundleStrings)  viewTop = 1;  
            
            for (indexCounter = 1; indexCounter <= viewTop; indexCounter++)  {
                srwString(theView, theView->offset+indexCounter, globalPtr, secondaryPtr);
                if (errCode != passed)  break;
        }   }
        else  srwData(theView, globalPtr, secondaryPtr);            }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, (%rsp)
movq %rdi, %r15
movq (%rdi), %rax
movq 0x10(%rax), %r14
movl 0xc0(%r14), %eax
cmpl $0x5, %eax
jl 0xd825
cmpl $0x0, 0x10(%r14)
jle 0xd8cd
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
addq $0x10, %r14
movl $0x1, %ebp
leaq 0x20(%rsp), %r12
movq %r14, 0x40(%rsp)
movq %r14, %rdi
movl %ebp, %esi
callq 0x911c
movq %rax, %rbx
movl 0x44(%rax), %eax
testb $0x40, %al
jne 0xd739
orl $0x40, %eax
movl %eax, 0x44(%rbx)
cmpq $0x0, (%rbx)
je 0xd71e
cmpb $0x0, 0x40(%rbx)
je 0xd753
andb $-0x41, 0x44(%rbx)
leaq 0x18037(%rip), %rax     # 0x25760
cmpl $0x0, 0x18(%rax)
movq 0x40(%rsp), %r14
je 0xd744
jmp 0xd8cd
cmpb $0x0, 0x14(%rsp)
je 0xd8a5
leal 0x1(%rbp), %eax
cmpl (%r14), %ebp
movl %eax, %ebp
jl 0xd6f8
jmp 0xd8cd
cmpb $0x0, 0x10(%rsp)
je 0xd7d2
movl 0xc(%rbx), %eax
imull 0xc(%r15), %eax
testl %eax, %eax
jle 0xd71e
xorl %r14d, %r14d
movq (%r15), %rax
movq %rax, 0x20(%rsp)
movl 0x8(%r15), %eax
movl %eax, 0x28(%rsp)
movl $0x1, 0x2c(%rsp)
movq %r12, %r13
movq %r12, %rdi
movq %rbx, %rsi
movl %r14d, %edx
movl $0x1, %ecx
callq 0xd531
leaq 0x17fc2(%rip), %rax     # 0x25760
cmpl $0x0, 0x18(%rax)
je 0xd7ad
movl $0x0, 0x18(%rax)
jmp 0xd7bd
movq %r13, %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq *0x18(%rsp)
incl %r14d
movl 0xc(%rbx), %eax
imull 0xc(%r15), %eax
cmpl %eax, %r14d
jl 0xd769
jmp 0xd71e
movq 0x10(%r15), %rax
movq %rax, 0x30(%rsp)
movups (%r15), %xmm0
movaps %xmm0, 0x20(%rsp)
movl 0xc(%rbx), %ecx
movq %r12, %r14
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xd531
leaq 0x17f62(%rip), %rax     # 0x25760
cmpl $0x0, 0x18(%rax)
je 0xd810
movl $0x0, 0x18(%rax)
jmp 0xd71e
movq %r14, %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq *0x18(%rsp)
jmp 0xd71e
cmpl $0x4, %eax
jne 0xd881
movl $0x1, %ebx
testb %r9b, %r9b
jne 0xd838
movl 0xc(%r15), %ebx
testl %ebx, %ebx
jle 0xd8cd
movq 0x90(%rsp), %r14
movl $0x1, %r13d
leaq 0x17f0b(%rip), %r12     # 0x25760
movl 0x8(%r15), %esi
addl %r13d, %esi
movq %r15, %rdi
movq (%rsp), %rdx
movq 0x8(%rsp), %rcx
callq *%r14
cmpl $0x0, 0x18(%r12)
jne 0xd8cd
leal 0x1(%r13), %eax
cmpl %r13d, %ebx
movl %eax, %r13d
jne 0xd855
jmp 0xd8cd
movq 0x88(%rsp), %rax
movq %r15, %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
leaq 0x17eb4(%rip), %r8      # 0x25760
movq 0xb8(%r8), %rdi
addq $-0x4, %rdi
leaq 0x18(%r8), %rdx
leaq 0x1c(%r8), %rcx
addq $0x28, %r8
movl $0x2f, %esi
callq 0xf1d9
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq