// File: /workspace/github_c_makefile_star2_O0/heltilda[P]cicada/cmpile.c
// Function: addTokenSpec
ccInt addTokenSpec(compiler_type *compiler, char **tokenCharPtr, char **newName, ccInt tokenID, ccBool isVariableName,
        ccBool expectLHarg, ccBool optionalLHarg, ccInt nthToken, ccInt varID)
{
    linkedlist *theList = compiler->tokens + ((ccInt) **tokenCharPtr);
    ccInt whichElement, ifFound, LLrtrn, numChars = 1;
    char *tokenStringCopy = NULL, *tokenStringCopy2, *tokenChar = *tokenCharPtr;
    tokenStringType *oneTokenString;
    
    
        // calculate the length of the token string, so we know how much memory to allocate
    
    while ( (*tokenChar != 0) && ((*tokenChar < *type0arg) || (*tokenChar > *commentarg)) )  {
        if ((isVariableName) && (lettertype(tokenChar) != a_letter) && (lettertype(tokenChar) != a_number))  break;
        if (lettertype(tokenChar) != unprintable)  numChars++;
        tokenChar++;    }
    
    
        // allocate memory for our copy of the string
    
    tokenStringCopy = (char *) malloc(numChars);
    if (tokenStringCopy == NULL)  {
        freeCompiler(compiler);
        return out_of_memory_err;        }
    
    
        // finally, copy the string into our own memory
    
    tokenChar = *tokenCharPtr;
    tokenStringCopy2 = tokenStringCopy;
    while ( (*tokenChar != 0) && ((*tokenChar < *type0arg) || (*tokenChar > *commentarg)) )  {
        if ((isVariableName) && (lettertype(tokenChar) != a_letter) && (lettertype(tokenChar) != a_number))  break;
        if (lettertype(tokenChar) != unprintable)  {
            *tokenStringCopy2 = *tokenChar;
            tokenStringCopy2++;     }
        tokenChar++;     }
    *tokenStringCopy2 = 0;     // append a null even if there's an argument command
    
    
        // now we need to add the pointer to the appropriate tokens list
        // findToken() returns the alphabetical location in the list where we need to insert this pointer
    
    tokenStringCopy2 = tokenStringCopy;
    ifFound = findToken(compiler, theList, &tokenStringCopy2, &whichElement, ccTrue, isVariableName);
    
    if (!ifFound)  {
        if (!isVariableName)  compiler->numLanguageOps[(ccInt) **tokenCharPtr]++;
        LLrtrn = insertElements(theList, whichElement, 1, ccTrue);
        if (LLrtrn != passed)  {
            freeCompiler(compiler);
            return LLrtrn;
    }   }
    
    oneTokenString = (tokenStringType *) element(theList, whichElement);
    
    if (!ifFound)  {
        oneTokenString->name = tokenStringCopy;
        if (isVariableName)  {
            varNameType *newVarNameEntry;
            LLrtrn = addElements(&(compiler->varNames), 1, ccFalse);
            if (LLrtrn != passed)  {  freeCompiler(compiler);  return LLrtrn;  }
            
            newVarNameEntry = (varNameType *) element(&(compiler->varNames), compiler->varNames.elementNum);
            newVarNameEntry->theName = tokenStringCopy;
            newVarNameEntry->nameLength = numChars-1;
    }   }
    else  free(tokenStringCopy);       // if we already have it, then never mind
    
    if (nthToken == 0)  {
        if ((!expectLHarg) || (optionalLHarg))  oneTokenString->tokenID_noLHarg = tokenID;
        if ((expectLHarg) || (optionalLHarg))  oneTokenString->tokenID_LHarg = tokenID;        }
    
    oneTokenString->varID = varID;
    
    *tokenCharPtr = tokenChar;
    
    if (newName != NULL)  *newName = oneTokenString->name;
    
    return passed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl %r8d, -0x80(%rbp)
movl %ecx, %eax
movl -0x80(%rbp), %ecx
movl %eax, -0x7c(%rbp)
movq %rdx, %rax
movl -0x7c(%rbp), %edx
movq %rax, -0x78(%rbp)
movq %rsi, %rax
movq -0x78(%rbp), %rsi
movq %rax, -0x70(%rbp)
movq %rdi, %r8
movq -0x70(%rbp), %rdi
movb %r9b, %al
movl 0x20(%rbp), %r9d
movl 0x18(%rbp), %r9d
movb 0x10(%rbp), %r9b
movq %r8, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
movb %cl, -0x25(%rbp)
movb %al, -0x26(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl $0x1, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x81(%rbp)
je 0xb7f0
movq -0x58(%rbp), %rax
movsbl (%rax), %ecx
movsbl 0x1689b(%rip), %edx     # 0x2205a
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x82(%rbp)
jl 0xb7e4
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
movsbl 0x16887(%rip), %ecx     # 0x22060
cmpl %ecx, %eax
setg %al
movb %al, -0x82(%rbp)
movb -0x82(%rbp), %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0xb7fc
jmp 0xb860
cmpb $0x0, -0x25(%rbp)
je 0xb830
movq -0x58(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d95e(%rip), %rax     # 0x29170
cmpl $0x3, (%rax,%rcx,4)
je 0xb830
movq -0x58(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d948(%rip), %rax     # 0x29170
cmpl $0x4, (%rax,%rcx,4)
je 0xb830
jmp 0xb860
movq -0x58(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d930(%rip), %rax     # 0x29170
cmpl $0x0, (%rax,%rcx,4)
je 0xb84f
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xb79d
movslq -0x40(%rbp), %rdi
callq 0x81d0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xb889
movq -0x10(%rbp), %rdi
callq 0xb5b0
movl $0x1, -0x4(%rbp)
jmp 0xbb01
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x83(%rbp)
je 0xb8ef
movq -0x58(%rbp), %rax
movsbl (%rax), %ecx
movsbl 0x1679c(%rip), %edx     # 0x2205a
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x84(%rbp)
jl 0xb8e3
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
movsbl 0x16788(%rip), %ecx     # 0x22060
cmpl %ecx, %eax
setg %al
movb %al, -0x84(%rbp)
movb -0x84(%rbp), %al
movb %al, -0x83(%rbp)
movb -0x83(%rbp), %al
testb $0x1, %al
jne 0xb8fb
jmp 0xb96e
cmpb $0x0, -0x25(%rbp)
je 0xb92f
movq -0x58(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d85f(%rip), %rax     # 0x29170
cmpl $0x3, (%rax,%rcx,4)
je 0xb92f
movq -0x58(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d849(%rip), %rax     # 0x29170
cmpl $0x4, (%rax,%rcx,4)
je 0xb92f
jmp 0xb96e
movq -0x58(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d831(%rip), %rax     # 0x29170
cmpl $0x0, (%rax,%rcx,4)
je 0xb95d
movq -0x58(%rbp), %rax
movb (%rax), %cl
movq -0x50(%rbp), %rax
movb %cl, (%rax)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xb89c
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x34(%rbp), %rcx
movl $0x1, %r8d
movsbl -0x25(%rbp), %r9d
callq 0xcfe0
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0xba00
cmpb $0x0, -0x25(%rbp)
jne 0xb9ce
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movl 0x1000(%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, 0x1000(%rax,%rcx,4)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x8590
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0xb9fe
movq -0x10(%rbp), %rdi
callq 0xb5b0
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xbb01
jmp 0xba00
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x9700
movq %rax, -0x60(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0xba93
movq -0x48(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rcx, (%rax)
cmpb $0x0, -0x25(%rbp)
je 0xba91
movq -0x10(%rbp), %rdi
addq $0x14a0, %rdi           # imm = 0x14A0
movl $0x1, %esi
xorl %edx, %edx
callq 0x8e70
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0xba5b
movq -0x10(%rbp), %rdi
callq 0xb5b0
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xbb01
movq -0x10(%rbp), %rdi
addq $0x14a0, %rdi           # imm = 0x14A0
movq -0x10(%rbp), %rax
movl 0x14a0(%rax), %esi
callq 0x9700
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rcx
movq -0x68(%rbp), %rax
movq %rcx, (%rax)
movl -0x40(%rbp), %ecx
subl $0x1, %ecx
movq -0x68(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0xba9c
movq -0x48(%rbp), %rdi
callq 0x81c0
cmpl $0x0, 0x18(%rbp)
jne 0xbad0
cmpb $0x0, -0x26(%rbp)
je 0xbaae
cmpb $0x0, 0x10(%rbp)
je 0xbab8
movl -0x24(%rbp), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0xc(%rax)
cmpb $0x0, -0x26(%rbp)
jne 0xbac4
cmpb $0x0, 0x10(%rbp)
je 0xbace
movl -0x24(%rbp), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0xbad0
movl 0x20(%rbp), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x58(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0xbafa
movq -0x60(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)