// File: /workspace/github_c_makefile_star2_O0/JimKent[P]linearSat/lib/kxTok.c
// Function: kxTokenizeFancy
struct kxTok *kxTokenizeFancy(char *text, boolean wildAst,
			      boolean wildPercent, boolean includeHyphen)
/* Convert text to stream of tokens. If 'wildAst' is
 * TRUE then '*' character will be treated as wildcard
 * rather than multiplication sign.  
 * If wildPercent is TRUE then the '%' character will be treated as a 
 * wildcard (as in SQL) rather than a modulo (kxtMod) or percent sign.
 * If includeHyphen is TRUE then a '-' character in the middle of a String 
 * token will be treated as a hyphen (part of the String token) instead of 
 * a new kxtSub token. */
{
struct kxTok *tokList = NULL, *tok;
char c, *s, *start = NULL, *end = NULL;
enum kxTokType type = 0;
boolean spaceBefore = FALSE;

s = text;
for (;;)
    {
    if ((c = *s) == 0)
        break;
    start = s++;
    if (isspace(c))
        {
	spaceBefore = TRUE;
        continue;
        }
    else if (isalnum(c) || c == '?' || (wildAst && c == '*') ||
	     (wildPercent && c == '%'))
        {
        if (c == '?')
            type = kxtWildString;
	else if (wildAst && c == '*')
            type = kxtWildString;
	else if (wildPercent && c == '%')
            type = kxtWildString;
        else
            type = kxtString;
        for (;;)
            {
            c = *s;
            if (isalnum(c) || c == ':' || c == '_' || c == '.' ||
		(includeHyphen && c == '-'))
                ++s;
            else if (c == '?' || (wildAst && c == '*') ||
		     (wildPercent && c == '%'))
                {
                type = kxtWildString;
                ++s;
                }
            else
                break;
            }
        end = s;
        }
    else if (c == '"')
        {
        type = kxtString;
        if (! includeQuotes)
	    start = s;
        for (;;)
            {
            c = *s++;
            if (c == '"')
                break;
            if (c == '*' || c == '?' || (wildPercent && c == '%'))
                type = kxtWildString;
            }
	if (! includeQuotes)
	    end = s-1;
	else
	    end = s;
        }
    else if (c == '\'')
        {
        type = kxtString;
        if (! includeQuotes)
	    start = s;
        for (;;)
            {
            c = *s++;
            if (c == '\'')
                break;
            if (c == '*' || c == '?' || (wildPercent && c == '%'))
                type = kxtWildString;
            }
	if (! includeQuotes)
	    end = s-1;
	else
	    end = s;
        } 
    else if (c == '=')
        {
        type = kxtEquals;
        end = s;
        }
    else if (c == '&')
        {
        type = kxtAnd;
        end = s;
        }
    else if (c == '|')
        {
        type = kxtOr;
        end = s;
        }
    else if (c == '^')
        {
        type = kxtXor;
        end = s;
        }
    else if (c == '+')
        {
	type = kxtAdd;
	end = s;
	}
    else if (c == '-')
        {
	type = kxtSub;
	end = s;
	}
    else if (c == '*')
        {
	type = kxtMul;
	end = s;
	}
    else if (c == '/')
        {
	type = kxtDiv;
	end = s;
	}
    else if (c == '(')
        {
        type = kxtOpenParen;
        end = s;
        }
    else if (c == ')')
        {
        type = kxtCloseParen;
        end = s;
        }
    else if (c == '!')
        {
        type = kxtNot;
        end = s;
        }
    else if (c == '>')
        {
        if (*s == '=')
            {
            ++s;
            type = kxtGE;
            }
        else
            type = kxtGT;
        end = s;
        }
    else if (c == '<')
        {
        if (*s == '=')
            {
            ++s;
            type = kxtLE;
            }
        else
            type = kxtLT;
        end = s;
        }
    else if (c == '.')
        {
        type = kxtDot;
        end = s;
	}
    else if (c == '%')
        {
        type = kxtMod;
        end = s;
	}
    else if (ispunct(c))
        {
        type = kxtPunct;
        end = s;
	}
    else
        {
        errAbort("Unrecognized character %c", c);
        }
    tok = kxTokNew(type, start, end-start, spaceBefore);
    slAddHead(&tokList, tok);
    spaceBefore = FALSE;
    }
tok = kxTokNew(kxtEnd, "end", 3, spaceBefore);
slAddHead(&tokList, tok);
slReverse(&tokList);
return tokList;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb (%rax), %al
movb %al, -0x29(%rbp)
movsbl %al, %eax
cmpl $0x0, %eax
jne 0x204e9
jmp 0x20a1a
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movq %rax, -0x40(%rbp)
callq 0x3760
movq (%rax), %rax
movsbl -0x29(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x20522
movl $0x1, -0x50(%rbp)
jmp 0x204d3
callq 0x3760
movq (%rax), %rax
movsbl -0x29(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x2056c
movsbl -0x29(%rbp), %eax
cmpl $0x3f, %eax
je 0x2056c
cmpl $0x0, -0xc(%rbp)
je 0x20555
movsbl -0x29(%rbp), %eax
cmpl $0x2a, %eax
je 0x2056c
cmpl $0x0, -0x10(%rbp)
je 0x20669
movsbl -0x29(%rbp), %eax
cmpl $0x25, %eax
jne 0x20669
movsbl -0x29(%rbp), %eax
cmpl $0x3f, %eax
jne 0x2057e
movl $0x2, -0x4c(%rbp)
jmp 0x205b9
cmpl $0x0, -0xc(%rbp)
je 0x20596
movsbl -0x29(%rbp), %eax
cmpl $0x2a, %eax
jne 0x20596
movl $0x2, -0x4c(%rbp)
jmp 0x205b7
cmpl $0x0, -0x10(%rbp)
je 0x205ae
movsbl -0x29(%rbp), %eax
cmpl $0x25, %eax
jne 0x205ae
movl $0x2, -0x4c(%rbp)
jmp 0x205b5
movl $0x1, -0x4c(%rbp)
jmp 0x205b7
jmp 0x205b9
jmp 0x205bb
movq -0x38(%rbp), %rax
movb (%rax), %al
movb %al, -0x29(%rbp)
callq 0x3760
movq (%rax), %rax
movsbl -0x29(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x20609
movsbl -0x29(%rbp), %eax
cmpl $0x3a, %eax
je 0x20609
movsbl -0x29(%rbp), %eax
cmpl $0x5f, %eax
je 0x20609
movsbl -0x29(%rbp), %eax
cmpl $0x2e, %eax
je 0x20609
cmpl $0x0, -0x14(%rbp)
je 0x20617
movsbl -0x29(%rbp), %eax
cmpl $0x2d, %eax
jne 0x20617
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x20657
movsbl -0x29(%rbp), %eax
cmpl $0x3f, %eax
je 0x2063e
cmpl $0x0, -0xc(%rbp)
je 0x2062f
movsbl -0x29(%rbp), %eax
cmpl $0x2a, %eax
je 0x2063e
cmpl $0x0, -0x10(%rbp)
je 0x20653
movsbl -0x29(%rbp), %eax
cmpl $0x25, %eax
jne 0x20653
movl $0x2, -0x4c(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x20655
jmp 0x2065c
jmp 0x20657
jmp 0x205bb
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209df
movsbl -0x29(%rbp), %eax
cmpl $0x22, %eax
jne 0x206fd
movl $0x1, -0x4c(%rbp)
cmpl $0x0, 0x22ea4(%rip)     # 0x43528
jne 0x2068e
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x20690
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb (%rax), %al
movb %al, -0x29(%rbp)
movsbl -0x29(%rbp), %eax
cmpl $0x22, %eax
jne 0x206af
jmp 0x206d9
movsbl -0x29(%rbp), %eax
cmpl $0x2a, %eax
je 0x206d0
movsbl -0x29(%rbp), %eax
cmpl $0x3f, %eax
je 0x206d0
cmpl $0x0, -0x10(%rbp)
je 0x206d7
movsbl -0x29(%rbp), %eax
cmpl $0x25, %eax
jne 0x206d7
movl $0x2, -0x4c(%rbp)
jmp 0x20690
cmpl $0x0, 0x22e48(%rip)     # 0x43528
jne 0x206f0
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x206f8
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209dd
movsbl -0x29(%rbp), %eax
cmpl $0x27, %eax
jne 0x20791
movl $0x1, -0x4c(%rbp)
cmpl $0x0, 0x22e10(%rip)     # 0x43528
jne 0x20722
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x20724
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb (%rax), %al
movb %al, -0x29(%rbp)
movsbl -0x29(%rbp), %eax
cmpl $0x27, %eax
jne 0x20743
jmp 0x2076d
movsbl -0x29(%rbp), %eax
cmpl $0x2a, %eax
je 0x20764
movsbl -0x29(%rbp), %eax
cmpl $0x3f, %eax
je 0x20764
cmpl $0x0, -0x10(%rbp)
je 0x2076b
movsbl -0x29(%rbp), %eax
cmpl $0x25, %eax
jne 0x2076b
movl $0x2, -0x4c(%rbp)
jmp 0x20724
cmpl $0x0, 0x22db4(%rip)     # 0x43528
jne 0x20784
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2078c
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209db
movsbl -0x29(%rbp), %eax
cmpl $0x3d, %eax
jne 0x207ae
movl $0x3, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209d9
movsbl -0x29(%rbp), %eax
cmpl $0x26, %eax
jne 0x207cb
movl $0x8, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209d7
movsbl -0x29(%rbp), %eax
cmpl $0x7c, %eax
jne 0x207e8
movl $0x9, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209d5
movsbl -0x29(%rbp), %eax
cmpl $0x5e, %eax
jne 0x20805
movl $0xa, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209d3
movsbl -0x29(%rbp), %eax
cmpl $0x2b, %eax
jne 0x20822
movl $0xe, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209d1
movsbl -0x29(%rbp), %eax
cmpl $0x2d, %eax
jne 0x2083f
movl $0xf, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209cf
movsbl -0x29(%rbp), %eax
cmpl $0x2a, %eax
jne 0x2085c
movl $0x11, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209cd
movsbl -0x29(%rbp), %eax
cmpl $0x2f, %eax
jne 0x20879
movl $0x10, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209cb
movsbl -0x29(%rbp), %eax
cmpl $0x28, %eax
jne 0x20896
movl $0xc, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209c9
movsbl -0x29(%rbp), %eax
cmpl $0x29, %eax
jne 0x208b3
movl $0xd, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209c7
movsbl -0x29(%rbp), %eax
cmpl $0x21, %eax
jne 0x208d0
movl $0xb, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209c5
movsbl -0x29(%rbp), %eax
cmpl $0x3e, %eax
jne 0x2090e
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0x208fa
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movl $0x5, -0x4c(%rbp)
jmp 0x20901
movl $0x4, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209c3
movsbl -0x29(%rbp), %eax
cmpl $0x3c, %eax
jne 0x20949
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0x20938
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movl $0x7, -0x4c(%rbp)
jmp 0x2093f
movl $0x6, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209c1
movsbl -0x29(%rbp), %eax
cmpl $0x2e, %eax
jne 0x20963
movl $0x12, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209bf
movsbl -0x29(%rbp), %eax
cmpl $0x25, %eax
jne 0x2097d
movl $0x13, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209bd
callq 0x3760
movq (%rax), %rax
movsbl -0x29(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x209a9
movl $0x14, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x209bb
movsbl -0x29(%rbp), %esi
leaq 0x6b07(%rip), %rdi      # 0x274bb
movb $0x0, %al
callq 0xfd50
jmp 0x209bd
jmp 0x209bf
jmp 0x209c1
jmp 0x209c3
jmp 0x209c5
jmp 0x209c7
jmp 0x209c9
jmp 0x209cb
jmp 0x209cd
jmp 0x209cf
jmp 0x209d1
jmp 0x209d3
jmp 0x209d5
jmp 0x209d7
jmp 0x209d9
jmp 0x209db
jmp 0x209dd
jmp 0x209df
jmp 0x209e1
movl -0x4c(%rbp), %edi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
movl -0x50(%rbp), %ecx
callq 0x20a60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x20ad0
movl $0x0, -0x50(%rbp)
jmp 0x204d3
movl -0x50(%rbp), %ecx
xorl %edi, %edi
leaq 0x3ae9(%rip), %rsi      # 0x2450f
movl $0x3, %edx
callq 0x20a60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x20ad0
leaq -0x20(%rbp), %rdi
callq 0x7bb0
movq -0x20(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)