// File: /workspace/github_c_makefile_star2_O3/jondurbin[P]dre2/src/dre2_match.c
// Function: dre2_char_matches
int dre2_char_matches( struct dre2 *graph, struct dre2_node *node, unsigned char c )
{
  if ( node->c >= 0 )
  {
    if ( c == node->c )
      return true;
    if ( graph->options & DRE2_NO_CASE )
    {
      if ( node->c >= 'a' && node->c <= 'z' && c == node->c - ( 'a' - 'A' ) )
        return true;
      else if ( node->c >= 'A' && node->c <= 'Z' && c == node->c + ( 'a' - 'A' ) )
        return true;
    }
    return false;
  }

  if ( node->c == DRE2_CHAR_CLASS )
    return node->possible[c];

  switch( node->c )
  {
    case DRE2_DOT:
      if ( c != '\0' && c != '\n' && c != '\r' )
        return true;
      return false;
    case DRE2_ALPHA:
      if ( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) )
        return true;
      return false;
    case DRE2_WORD:
      if ( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' ) || ( c == '-' ) )
        return true;
      return false;
    case DRE2_DOMAIN:
      if ( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' ) || ( c == '-' ) || ( c == '.' ) )
        return true;
      return false;
    case DRE2_URL:
      if ( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' ) || ( c == '-' ) || ( c == '.' ) || ( c == '/' ) || ( c = ':' ) || ( c == '_' ) || ( c == '@' ) )
        return true;
      return false;
    case DRE2_DIGIT:
      if ( c >= '0' && c <= '9' )
        return true;
      return false;
    case DRE2_BORDER:
      if ( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' ) || ( c == '-' ) )
        return false;
      return true;
    case DRE2_WHITE_SPACE:
      if ( c == ' ' || c == '\t' || c == '\r' || c == '\f' || c == '\n' )
        return true;
      return false;
    case DRE2_SIM_DIGIT:
      if ( c >= '0' && c <= '9' )
        return true;
      if ( c == 215 || c == 225 || c == 226 || c == 231 || c == 238 || c == 239 || c == 247 || c == 250 || c == 254 )
        return true;
      return false;
    case DRE2_OBF_DIGIT:
      if ( c == 215 || c == 225 || c == 226 || c == 231 || c == 238 || c == 239 || c == 247 || c == 250 || c == 254 )
        return true;
      return false;
    case DRE2_HEX:
      if ( ( c >= '0' && c <= '9' ) || ( c >= 'a' && c <= 'f' ) || ( c >= 'A' && c <= 'F' ) )
        return true;
      return false;
  }
  return false;
}

// Assembly:
movl (%rsi), %ecx
testl %ecx, %ecx
js 0x5e81
movzbl %dl, %edx
movl $0x1, %eax
cmpl %edx, %ecx
jne 0x5eb4
retq
xorl %eax, %eax
addl $0x10, %ecx
cmpl $0xd, %ecx
ja 0x5e80
leaq 0x2232(%rip), %rdi      # 0x80c4
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
movl $0x1, %eax
cmpb $0xd, %dl
ja 0x5e80
movzbl %dl, %ecx
movl $0x2401, %edx           # imm = 0x2401
btl %ecx, %edx
jb 0x5ebd
jmp 0x5e80
testb $0x4, 0x43c(%rdi)
jne 0x5ec0
xorl %eax, %eax
retq
leal -0x61(%rcx), %esi
cmpl $0x1a, %esi
setb %sil
leal -0x20(%rcx), %edi
cmpl %edx, %edi
sete %dil
testb %dil, %sil
jne 0x5e80
leal -0x41(%rcx), %esi
cmpl $0x1a, %esi
setb %sil
addl $0x20, %ecx
cmpl %edx, %ecx
sete %cl
testb %cl, %sil
je 0x5ebd
jmp 0x5e80
andb $-0x21, %dl
addb $-0x41, %dl
xorl %eax, %eax
cmpb $0x1a, %dl
jmp 0x6036
movl %edx, %ecx
andb $-0x21, %cl
addb $-0x41, %cl
movl $0x1, %eax
cmpb $0x1a, %cl
jb 0x5e80
leal -0x30(%rdx), %eax
cmpb $0xa, %al
setb %al
cmpb $0x2d, %dl
sete %cl
jmp 0x5ffa
leal -0x30(%rdx), %ecx
movl $0x1, %eax
cmpb $0xa, %cl
jb 0x5e80
movzbl %dl, %ecx
addl $-0x41, %ecx
cmpl $0x25, %ecx
ja 0x5ebd
movabsq $0x3f0000003f, %rdx     # imm = 0x3F0000003F
jmp 0x5fc4
movq 0x28(%rsi), %rax
movzbl %dl, %ecx
movl (%rax,%rcx,4), %eax
retq
cmpb $0x20, %dl
ja 0x5ebd
movl $0x1, %eax
movzbl %dl, %ecx
movabsq $0x100003600, %rdx      # imm = 0x100003600
jmp 0x5fc4
movzbl %dl, %ecx
addl $0xffffff29, %ecx       # imm = 0xFFFFFF29
cmpl $0x27, %ecx
ja 0x5ebd
movl $0x1, %eax
jmp 0x5fba
leal -0x30(%rdx), %ecx
movl $0x1, %eax
cmpb $0xa, %cl
jb 0x5e80
movzbl %dl, %ecx
addl $0xffffff29, %ecx       # imm = 0xFFFFFF29
cmpl $0x27, %ecx
ja 0x5ebd
movabsq $0x8901810c01, %rdx     # imm = 0x8901810C01
btq %rcx, %rdx
jb 0x5e80
jmp 0x5ebd
movl %edx, %ecx
andb $-0x21, %cl
addb $-0x41, %cl
movl $0x1, %eax
cmpb $0x1a, %cl
jb 0x5e80
leal -0x30(%rdx), %eax
cmpb $0xa, %al
setb %al
addb $-0x2d, %dl
cmpb $0x2, %dl
setb %cl
orb %al, %cl
jmp 0x602a
movl $0x1, %eax
retq
movl %edx, %ecx
andb $-0x21, %cl
addb $-0x41, %cl
movl $0x0, %eax
cmpb $0x1a, %cl
jb 0x5e80
leal -0x3a(%rdx), %eax
cmpb $-0xa, %al
setb %al
cmpb $0x2d, %dl
setne %cl
andb %al, %cl
movzbl %cl, %eax
retq
addb $-0x30, %dl
xorl %eax, %eax
cmpb $0xa, %dl
setb %al
retq