// File: /workspace/github_c_makefile_star2_O3/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 0x11d89
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 0x11e34
movl (%rbx), %eax
cmpl $0x7, %eax
jne 0x11e09
movq 0x13ab1(%rip), %rcx     # 0x25860
movl (%r14), %eax
testq %rcx, %rcx
je 0x11e2a
movl $0x11, %ebp
cmpl (%rcx), %eax
jg 0x11e34
testl %eax, %eax
jle 0x11df3
xorl %r15d, %r15d
incl %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x91d8
movq 0x10(%rax), %r13
movq 0x13a80(%rip), %rdi     # 0x25860
movl %r15d, %esi
callq 0x91d8
cmpq 0x10(%rax), %r13
jne 0x11e34
cmpl (%r14), %r15d
jl 0x11dc7
cmpb $0x0, 0x48(%rsp)
je 0x11e05
cmpl $0x5, %r12d
je 0x11e45
cmpl %r12d, (%rbx)
jne 0x11e45
xorl %ebp, %ebp
jmp 0x11e34
movl $0x11, %ebp
cmpl %eax, %r12d
jne 0x11e34
cmpl %r8d, (%rdx)
jne 0x11e34
cmpl %r9d, (%rcx)
jne 0x11e34
cmpl $0x4, %r12d
jg 0x11da8
movl (%r14), %eax
testl %eax, %eax
jmp 0x11e31
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 0x13a2d(%rip), %eax     # 0x25878
movq 0x13a16(%rip), %rcx     # 0x25868
movl $0x1c, %ebp
cmpl 0xc(%rcx), %eax
jne 0x11e34
movq 0x40(%rsp), %rax
movl 0xc(%rax), %ecx
movq (%rax), %rax
movq 0x10(%rax), %rax
movl $0x1d, %ebp
cmpl 0xf0(%rax), %ecx
je 0x11e05
jmp 0x11e34