// File: /workspace/github_c_makefile_star2_O3/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, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
movq (%rdi), %rax
movq 0x10(%rax), %r12
movl 0xc0(%r12), %eax
cmpl $0x5, %eax
jl 0xd635
cmpl $0x0, 0x10(%r12)
jle 0xd6df
movq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
addq $0x10, %r12
movl $0x1, %ebp
leaq 0x30(%rsp), %r14
movq %r12, 0x20(%rsp)
movq %r12, %rdi
movl %ebp, %esi
callq 0x91d8
movq %rax, %rbx
movl 0x44(%rax), %eax
testb $0x40, %al
jne 0xd53d
movq %r14, %r12
orl $0x40, %eax
movl %eax, 0x44(%rbx)
cmpq $0x0, (%rbx)
je 0xd51e
cmpb $0x0, 0x40(%rbx)
je 0xd558
leaq 0x1823b(%rip), %rax     # 0x25760
movl 0x18(%rax), %eax
andl $-0x41, 0x44(%rbx)
testl %eax, %eax
movq %r12, %r14
movq 0x20(%rsp), %r12
je 0xd548
jmp 0xd6df
cmpb $0x0, 0x1c(%rsp)
je 0xd6b7
leal 0x1(%rbp), %eax
cmpl (%r12), %ebp
movl %eax, %ebp
jl 0xd4f5
jmp 0xd6df
cmpb $0x0, 0x18(%rsp)
je 0xd5d8
movl 0xc(%rbx), %eax
imull 0xc(%r15), %eax
testl %eax, %eax
jle 0xd51e
xorl %r14d, %r14d
movq (%r15), %rax
movq %rax, 0x30(%rsp)
movl 0x8(%r15), %eax
movl %eax, 0x38(%rsp)
movl $0x1, 0x3c(%rsp)
movq %r12, %r13
movq %r12, %rdi
movq %rbx, %rsi
movl %r14d, %edx
movl $0x1, %ecx
callq 0xd32b
leaq 0x181bd(%rip), %rax     # 0x25760
cmpl $0x0, 0x18(%rax)
je 0xd5b2
movl $0x0, 0x18(%rax)
jmp 0xd5c3
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq *0x28(%rsp)
incl %r14d
movl 0xc(%rbx), %eax
imull 0xc(%r15), %eax
cmpl %eax, %r14d
jl 0xd56e
jmp 0xd51e
movq 0x10(%r15), %rax
movq %rax, 0x40(%rsp)
movups (%r15), %xmm0
movaps %xmm0, 0x30(%rsp)
movl 0xc(%rbx), %ecx
movq %r12, %r14
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xd32b
leaq 0x1815c(%rip), %rax     # 0x25760
cmpl $0x0, 0x18(%rax)
je 0xd61f
movl $0x0, 0x18(%rax)
andb $-0x41, 0x44(%rbx)
movq 0x20(%rsp), %r12
jmp 0xd548
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq *0x28(%rsp)
jmp 0xd51e
cmpl $0x4, %eax
jne 0xd692
movl $0x1, %ebx
testb %r9b, %r9b
jne 0xd648
movl 0xc(%r15), %ebx
testl %ebx, %ebx
jle 0xd6df
movq 0x90(%rsp), %r14
movl $0x1, %r13d
leaq 0x180fb(%rip), %r12     # 0x25760
movl 0x8(%r15), %esi
addl %r13d, %esi
movq %r15, %rdi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
callq *%r14
cmpl $0x0, 0x18(%r12)
jne 0xd6df
leal 0x1(%r13), %eax
cmpl %r13d, %ebx
movl %eax, %r13d
jne 0xd665
jmp 0xd6df
movq 0x88(%rsp), %rax
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
leaq 0x180a2(%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 0xef9a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq