// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rdi, %r15
movb 0x50(%rsp), %al
movl %r8d, %r12d
testl %r9d, %r9d
jle 0x10f15
xorl %esi, %esi
cmpl $0x4, (%r14)
setne %sil
leal 0x4(,%rsi,2), %r12d
cmpl $0x7, %r8d
sete %sil
testb %al, %al
sete %al
xorl %ebx, %ebx
testb %al, %sil
jne 0x10f9c
movl (%r14), %eax
pushq $0x11
popq %rsi
cmpl $0x7, %eax
jne 0x10f78
movq 0x13925(%rip), %rcx     # 0x24860
movl (%r15), %eax
testq %rcx, %rcx
je 0x10f90
cmpl (%rcx), %eax
jg 0x10f9a
pushq $0x1
popq %rbp
cmpl (%r15), %ebp
jg 0x10fad
movq %r15, %rdi
movl %ebp, %esi
callq 0x9088
movq 0x10(%rax), %r13
movq 0x138fc(%rip), %rdi     # 0x24860
movl %ebp, %esi
callq 0x9088
incl %ebp
cmpq 0x10(%rax), %r13
je 0x10f4a
pushq $0x11
popq %rbx
jmp 0x10f9c
cmpl %eax, %r12d
jne 0x10f9a
cmpl %r8d, (%rdx)
jne 0x10f9a
cmpl %r9d, (%rcx)
jne 0x10f9a
cmpl $0x4, %r12d
jg 0x10f34
movl (%r15), %eax
testl %eax, %eax
pushq $0x11
popq %rbx
cmovel %eax, %ebx
jmp 0x10f9c
movl %esi, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, 0x48(%rsp)
je 0x10f9c
cmpl $0x5, %r12d
je 0x10fbf
cmpl %r12d, (%r14)
je 0x10f9c
movl 0x138b3(%rip), %eax     # 0x24878
movq 0x1389c(%rip), %rcx     # 0x24868
cmpl 0xc(%rcx), %eax
jne 0x10fec
movq 0x40(%rsp), %rcx
movl 0xc(%rcx), %eax
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
cmpl 0xf0(%rcx), %eax
je 0x10f9c
pushq $0x1d
jmp 0x10f75
pushq $0x1c
jmp 0x10f75