// File: /workspace/github_c_makefile_star2_O1/heltilda[P]cicada/bytecd.c
// Function: checkType
ccInt checkType(linkedlist *destLL, ccInt *sourceType, ccInt *eventualSourceType, ccInt *sourceArrayDepth,
            ccInt expectedEventualSourceType, ccInt expectedArrayDepth, view *theView, ccBool isMember, ccBool ifUpdate)
{
    ccInt counter, expectedSourceType = expectedEventualSourceType;
    
    if (expectedArrayDepth > 0)  {
        if (*sourceType == string_type)  expectedSourceType = string_type;
        else  expectedSourceType = array_type;      }
    
    if ((expectedEventualSourceType == no_type) && (!ifUpdate))  return passed;     // we're always allowed to unlink a variable
    
    
        // check: non-void type which explicitly doesn't match the expected type
    
    if ((*sourceType != no_type) && ((expectedSourceType != *sourceType)
                || (expectedEventualSourceType != *eventualSourceType) || (expectedArrayDepth != *sourceArrayDepth)))
        return type_mismatch_err;
    
    
        // make sure we're not copying primitive <-- composite
    
    if (*sourceType < composite_type)  {   // so it's a primitive type
        if (destLL->elementNum != 0)  return type_mismatch_err;
        else  return passed;            }
    
    
        // composite:  we need all the codes currently in our list to also be present in the expected type
    
    if (GL_Object.codeList == NULL)   {
        if (destLL->elementNum != 0)  return type_mismatch_err;
        else  return passed;            }
    
    if (destLL->elementNum > GL_Object.codeList->elementNum)  return type_mismatch_err;
    
    for (counter = 1; counter <= destLL->elementNum; counter++)  {
    if (((code_ref *) element(destLL, counter))->code_ptr != ((code_ref *) element(GL_Object.codeList, counter))->code_ptr)  {
        return type_mismatch_err;
    }}
    
    
        // Make sure that we're changing the whole member and/or variable, then update the type field.
    
    if ((isMember) && ((*sourceType != expectedSourceType) || (expectedSourceType == composite_type)))  {
        if (GL_Path.indices != GL_Path.stemMember->indices)  return incomplete_member_err;
        if (theView->width != theView->windowPtr->variable_ptr->instances)  return incomplete_variable_err;     }
    
    return passed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb 0x50(%rsp), %al
movl %r8d, %r12d
testl %r9d, %r9d
jle 0x11f17
xorl %esi, %esi
cmpl $0x4, (%rbx)
setne %sil
leal 0x4(,%rsi,2), %r12d
cmpl $0x7, %r8d
sete %sil
testb %al, %al
sete %al
xorl %ebp, %ebp
testb %al, %sil
jne 0x11fc3
movl (%rbx), %eax
cmpl $0x7, %eax
jne 0x11f40
cmpl $0x4, %eax
jg 0x11f56
movl (%r14), %eax
jmp 0x11fb9
movl $0x11, %ebp
cmpl %eax, %r12d
jne 0x11fc3
cmpl %r8d, (%rdx)
jne 0x11fc3
cmpl %r9d, (%rcx)
je 0x11f36
jmp 0x11fc3
movq 0x13903(%rip), %rcx     # 0x25860
movl (%r14), %eax
testq %rcx, %rcx
je 0x11fb9
movl $0x11, %ebp
cmpl (%rcx), %eax
jg 0x11fc3
cmpl $0x0, (%r14)
jle 0x11fa3
xorl %r15d, %r15d
incl %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x911c
movq 0x10(%rax), %r13
movq 0x138d0(%rip), %rdi     # 0x25860
movl %r15d, %esi
callq 0x911c
cmpq 0x10(%rax), %r13
jne 0x11fc3
cmpl (%r14), %r15d
jl 0x11f77
cmpb $0x0, 0x48(%rsp)
je 0x11fb5
cmpl $0x5, %r12d
je 0x11fd4
cmpl %r12d, (%rbx)
jne 0x11fd4
xorl %ebp, %ebp
jmp 0x11fc3
testl %eax, %eax
movl $0x11, %ebp
cmovel %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x1389e(%rip), %eax     # 0x25878
movq 0x13887(%rip), %rcx     # 0x25868
movl $0x1c, %ebp
cmpl 0xc(%rcx), %eax
jne 0x11fc3
movq 0x40(%rsp), %rax
movl 0xc(%rax), %ecx
movq (%rax), %rax
movq 0x10(%rax), %rax
movl $0x1d, %ebp
cmpl 0xf0(%rax), %ecx
je 0x11fb5
jmp 0x11fc3