// File: /workspace/github_c_makefile_star2_O2/GangZhuo[P]dohclient/http-parser/http_parser.c
// Function: parse_url_char
static enum state
parse_url_char(enum state s, const char ch)
{
  if (ch == ' ' || ch == '\r' || ch == '\n') {
    return s_dead;
  }

#if HTTP_PARSER_STRICT
  if (ch == '\t' || ch == '\f') {
    return s_dead;
  }
#endif

  switch (s) {
    case s_req_spaces_before_url:
      /* Proxied requests are followed by scheme of an absolute URI (alpha).
       * All methods except CONNECT are followed by '/' or '*'.
       */

      if (ch == '/' || ch == '*') {
        return s_req_path;
      }

      if (IS_ALPHA(ch)) {
        return s_req_schema;
      }

      break;

    case s_req_schema:
      if (IS_ALPHA(ch)) {
        return s;
      }

      if (ch == ':') {
        return s_req_schema_slash;
      }

      break;

    case s_req_schema_slash:
      if (ch == '/') {
        return s_req_schema_slash_slash;
      }

      break;

    case s_req_schema_slash_slash:
      if (ch == '/') {
        return s_req_server_start;
      }

      break;

    case s_req_server_with_at:
      if (ch == '@') {
        return s_dead;
      }

    /* fall through */
    case s_req_server_start:
    case s_req_server:
      if (ch == '/') {
        return s_req_path;
      }

      if (ch == '?') {
        return s_req_query_string_start;
      }

      if (ch == '@') {
        return s_req_server_with_at;
      }

      if (IS_USERINFO_CHAR(ch) || ch == '[' || ch == ']') {
        return s_req_server;
      }

      break;

    case s_req_path:
      if (IS_URL_CHAR(ch)) {
        return s;
      }

      switch (ch) {
        case '?':
          return s_req_query_string_start;

        case '#':
          return s_req_fragment_start;
      }

      break;

    case s_req_query_string_start:
    case s_req_query_string:
      if (IS_URL_CHAR(ch)) {
        return s_req_query_string;
      }

      switch (ch) {
        case '?':
          /* allow extra '?' in query string */
          return s_req_query_string;

        case '#':
          return s_req_fragment_start;
      }

      break;

    case s_req_fragment_start:
      if (IS_URL_CHAR(ch)) {
        return s_req_fragment;
      }

      switch (ch) {
        case '?':
          return s_req_fragment;

        case '#':
          return s;
      }

      break;

    case s_req_fragment:
      if (IS_URL_CHAR(ch)) {
        return s;
      }

      switch (ch) {
        case '?':
        case '#':
          return s;
      }

      break;

    default:
      break;
  }

  /* We should never fall out of the switch above unless there's an error */
  return s_dead;
}

// Assembly:
pushq $0x1
popq %rcx
cmpl $0x20, %esi
ja 0x70e9
movl %esi, %eax
movabsq $0x100003600, %rdx      # imm = 0x100003600
btq %rax, %rdx
jae 0x70e9
movl %ecx, %eax
retq
addl $-0x14, %edi
cmpl $0xb, %edi
ja 0x70e6
leaq 0x1815c(%rip), %rax     # 0x1f254
movslq (%rax,%rdi,4), %rdi
addq %rax, %rdi
movsbl %sil, %edx
jmpq *%rdi
cmpl $0x40, %edx
je 0x7284
cmpl $0x3f, %edx
je 0x726b
cmpl $0x2f, %edx
jne 0x715f
jmp 0x7247
movzbl %sil, %eax
movl %eax, %ecx
shrl $0x3, %ecx
leaq 0x193af(%rip), %rdx     # 0x204e0
movzbl (%rcx,%rdx), %ecx
andl $0x7, %eax
btl %eax, %ecx
jae 0x726f
pushq $0x1d
jmp 0x72c9
cmpl $0x2f, %edx
je 0x7247
cmpl $0x3f, %edx
je 0x726b
cmpl $0x40, %edx
je 0x70e6
leal -0x30(%rsi), %edi
pushq $0x19
popq %rax
cmpb $0xa, %dil
jb 0x720b
orb $0x20, %sil
addb $-0x61, %sil
cmpb $0x1a, %sil
jb 0x720b
leal -0x21(%rdx), %esi
cmpl $0x3e, %esi
ja 0x7199
movabsq $0x5400000016003ff9, %rdi # imm = 0x5400000016003FF9
btq %rsi, %rdi
jb 0x720b
cmpl $0x7e, %edx
je 0x720b
jmp 0x70e6
movzbl %sil, %eax
movl %eax, %ecx
shrl $0x3, %ecx
leaq 0x1932d(%rip), %rdx     # 0x204e0
movzbl (%rcx,%rdx), %ecx
andl $0x7, %eax
btl %eax, %ecx
jb 0x7267
cmpb $0x23, %sil
pushq $0x1f
popq %rcx
pushq $0x1
popq %rax
cmovel %ecx, %eax
cmpb $0x3f, %sil
cmovel %ecx, %eax
retq
cmpb $0x2f, %sil
jne 0x70e6
pushq $0x17
jmp 0x72c9
cmpb $0x2f, %sil
jne 0x70e6
pushq $0x18
jmp 0x72c9
pushq $0x1b
popq %rax
cmpl $0x2a, %edx
je 0x720b
cmpl $0x2f, %edx
jne 0x72b5
retq
movl %esi, %eax
orb $0x20, %al
addb $-0x61, %al
cmpb $0x1a, %al
jb 0x72c7
cmpb $0x3a, %sil
jne 0x70e6
pushq $0x16
jmp 0x72c9
movzbl %sil, %eax
movl %eax, %ecx
shrl $0x3, %ecx
leaq 0x192a5(%rip), %rdx     # 0x204e0
movzbl (%rcx,%rdx), %ecx
andl $0x7, %eax
btl %eax, %ecx
jae 0x7288
pushq $0x1b
jmp 0x72c9
movzbl %sil, %eax
movl %eax, %ecx
shrl $0x3, %ecx
leaq 0x19285(%rip), %rdx     # 0x204e0
movzbl (%rcx,%rdx), %ecx
andl $0x7, %eax
btl %eax, %ecx
jae 0x729d
pushq $0x1f
jmp 0x72c9
pushq $0x1c
jmp 0x72c9
cmpb $0x23, %sil
pushq $0x1e
popq %rax
pushq $0x1
popq %rcx
cmovel %eax, %ecx
cmpb $0x3f, %sil
pushq $0x1d
jmp 0x72b0
pushq $0x1a
jmp 0x72c9
cmpb $0x23, %sil
pushq $0x1e
popq %rax
pushq $0x1
popq %rcx
cmovel %eax, %ecx
cmpb $0x3f, %sil
pushq $0x1c
jmp 0x72b0
cmpb $0x23, %sil
pushq $0x1e
popq %rax
pushq $0x1
popq %rcx
cmovel %eax, %ecx
cmpb $0x3f, %sil
pushq $0x1f
popq %rax
cmovnel %ecx, %eax
retq
orb $0x20, %sil
addb $-0x61, %sil
cmpb $0x1a, %sil
jae 0x70e6
pushq $0x15
popq %rax
retq