// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movb 0x20(%rbp), %al
movb 0x18(%rbp), %al
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x30(%rbp)
jle 0x168a1
movq -0x18(%rbp), %rax
cmpl $0x4, (%rax)
jne 0x16898
movl $0x4, -0x38(%rbp)
jmp 0x1689f
movl $0x6, -0x38(%rbp)
jmp 0x168a1
cmpl $0x7, -0x2c(%rbp)
jne 0x168b9
cmpb $0x0, 0x20(%rbp)
jne 0x168b9
movl $0x0, -0x4(%rbp)
jmp 0x16a17
movq -0x18(%rbp), %rax
cmpl $0x7, (%rax)
je 0x168ef
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x168e3
movl -0x2c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x168e3
movl -0x30(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
je 0x168ef
movl $0x11, -0x4(%rbp)
jmp 0x16a17
movq -0x18(%rbp), %rax
cmpl $0x5, (%rax)
jge 0x16919
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1690d
movl $0x11, -0x4(%rbp)
jmp 0x16a17
movl $0x0, -0x4(%rbp)
jmp 0x16a17
cmpq $0x0, 0x15f2f(%rip)     # 0x2c850
jne 0x16944
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x16938
movl $0x11, -0x4(%rbp)
jmp 0x16a17
movl $0x0, -0x4(%rbp)
jmp 0x16a17
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq 0x15eff(%rip), %rcx     # 0x2c850
cmpl (%rcx), %eax
jle 0x16961
movl $0x11, -0x4(%rbp)
jmp 0x16a17
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jg 0x169b9
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x9700
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq 0x15ec2(%rip), %rdi     # 0x2c850
movl -0x34(%rbp), %esi
callq 0x9700
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq 0x10(%rcx), %rax
je 0x169ac
movl $0x11, -0x4(%rbp)
jmp 0x16a17
jmp 0x169ae
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x16968
cmpb $0x0, 0x18(%rbp)
je 0x16a10
movq -0x18(%rbp), %rax
movl (%rax), %eax
cmpl -0x38(%rbp), %eax
jne 0x169d0
cmpl $0x5, -0x38(%rbp)
jne 0x16a10
movl 0x15e92(%rip), %eax     # 0x2c868
movq 0x15e7b(%rip), %rcx     # 0x2c858
cmpl 0xc(%rcx), %eax
je 0x169eb
movl $0x1c, -0x4(%rbp)
jmp 0x16a17
movq 0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq 0x10(%rbp), %rcx
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
cmpl 0xf0(%rcx), %eax
je 0x16a0e
movl $0x1d, -0x4(%rbp)
jmp 0x16a17
jmp 0x16a10
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq