// File: /workspace/github_c_makefile_star2_O3/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_initial
static bool handle_initial(GumboParser* parser, GumboToken* token) {
  GumboDocument* document = &get_document_node(parser)->v.document;
  if (token->type == GUMBO_TOKEN_WHITESPACE) {
    ignore_token(parser);
    return true;
  } else if (token->type == GUMBO_TOKEN_COMMENT) {
    append_comment_node(parser, get_document_node(parser), token);
    return true;
  } else if (token->type == GUMBO_TOKEN_DOCTYPE) {
    document->has_doctype = true;
    document->name = token->v.doc_type.name;
    document->public_identifier = token->v.doc_type.public_identifier;
    document->system_identifier = token->v.doc_type.system_identifier;
    document->doc_type_quirks_mode = compute_quirks_mode(&token->v.doc_type);
    set_insertion_mode(parser, GUMBO_INSERTION_MODE_BEFORE_HTML);
    return maybe_add_doctype_error(parser, token);
  }
  parser_add_parse_error(parser, token);
  document->doc_type_quirks_mode = GUMBO_DOCTYPE_QUIRKS;
  set_insertion_mode(parser, GUMBO_INSERTION_MODE_BEFORE_HTML);
  parser->_parser_state->_reprocess_current_token = true;
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq (%rax), %r12
movl (%rsi), %eax
testl %eax, %eax
je 0x8978
cmpl $0x3, %eax
je 0x8965
cmpl $0x4, %eax
jne 0x8a44
movq 0x18(%rbx), %rax
movq 0x98(%rax), %rbx
movq %rbx, %rdi
callq 0xc990
movb $0x1, %bpl
cmpl $0x1, (%rbx)
jne 0x8a66
pxor %xmm0, %xmm0
movdqu %xmm0, 0x38(%rbx)
jmp 0x8a66
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0xac3d
jmp 0x8a63
movb $0x1, 0x28(%r12)
movq 0x30(%r14), %r13
movq %r13, 0x30(%r12)
movq 0x38(%r14), %rbp
movq %rbp, 0x38(%r12)
movq 0x40(%r14), %rax
movq %rax, (%rsp)
movq %rax, 0x40(%r12)
movl $0x1, %r15d
cmpb $0x0, 0x48(%r14)
jne 0x8a13
leaq 0x134c8(%rip), %rsi     # 0x1be79
movq %r13, %rdi
callq 0x4160
testl %eax, %eax
jne 0x8a13
leaq 0x4a45c(%rip), %rsi     # 0x52e20
movq %rbp, %rdi
xorl %edx, %edx
callq 0xac9f
testb %al, %al
jne 0x8a13
leaq 0x4a7c7(%rip), %rsi     # 0x531a0
movl $0x1, %r15d
movq %rbp, %rdi
movl $0x1, %edx
callq 0xac9f
testb %al, %al
jne 0x8a13
leaq 0x4a7e9(%rip), %rsi     # 0x531e0
movl $0x1, %r15d
movq (%rsp), %rdi
movl $0x1, %edx
callq 0xac9f
testb %al, %al
je 0x8b93
movl %r15d, 0x48(%r12)
movq 0x18(%rbx), %rax
movl $0x1, (%rax)
leaq 0x13450(%rip), %rsi     # 0x1be79
movq %r13, %rdi
callq 0x4160
testl %eax, %eax
je 0x8a77
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d9d
xorl %ebp, %ebp
jmp 0x8a66
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d9d
movl $0x1, %eax
movl %eax, 0x48(%r12)
movq 0x18(%rbx), %rcx
movl %eax, (%rcx)
movb $0x1, 0x50(%rcx)
movb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, 0x49(%r14)
je 0x8b3c
leaq 0x30(%r14), %r15
leaq 0x13d42(%rip), %rsi     # 0x1c7cf
leaq 0x13d54(%rip), %rcx     # 0x1c7e8
movl $0x18, %edx
movl $0x2a, %r8d
movq %r15, %rdi
movl $0x1, %r9d
callq 0xad65
movb $0x1, %bpl
testb %al, %al
jne 0x8a66
leaq 0x13d58(%rip), %rsi     # 0x1c813
leaq 0x13d6b(%rip), %rcx     # 0x1c82d
movl $0x19, %edx
movl $0x25, %r8d
movq %r15, %rdi
movl $0x1, %r9d
callq 0xad65
testb %al, %al
jne 0x8a66
leaq 0x13d6d(%rip), %rsi     # 0x1c853
leaq 0x13d87(%rip), %rcx     # 0x1c874
movl $0x20, %edx
movl $0x31, %r8d
movq %r15, %rdi
xorl %r9d, %r9d
callq 0xad65
testb %al, %al
jne 0x8a66
leaq 0x13d94(%rip), %rsi     # 0x1c8a6
leaq 0x13da7(%rip), %rcx     # 0x1c8c0
movl $0x19, %edx
movl $0x2c, %r8d
movq %r15, %rdi
xorl %r9d, %r9d
callq 0xad65
testb %al, %al
je 0x8a35
jmp 0x8a66
movb $0x1, %bpl
cmpb $0x1, 0x4a(%r14)
jne 0x8a66
movq (%rsp), %r15
movq %r15, %rdi
callq 0x40b0
cmpq $0x13, %rax
jne 0x8a66
movdqu (%r15), %xmm0
movdqu 0x3(%r15), %xmm1
pcmpeqb 0x1094d(%rip), %xmm1    # 0x194c0
pcmpeqb 0x10955(%rip), %xmm0    # 0x194d0
pand %xmm1, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x8a66
jmp 0x8a82
cmpb $0x0, 0x4a(%r14)
je 0x8bcc
leaq 0x4a68f(%rip), %rsi     # 0x53230
movq %rbp, %rdi
xorl %edx, %edx
callq 0xac9f
movl $0x2, %r15d
testb %al, %al
jne 0x8a13
leaq 0x4a640(%rip), %rsi     # 0x53200
movq %rbp, %rdi
xorl %edx, %edx
callq 0xac9f
jmp 0x8bfc
leaq 0x4a62d(%rip), %rsi     # 0x53200
movq %rbp, %rdi
xorl %edx, %edx
callq 0xac9f
testb %al, %al
jne 0x8a13
leaq 0x4a644(%rip), %rsi     # 0x53230
movq %rbp, %rdi
xorl %edx, %edx
callq 0xac9f
movl $0x2, %r15d
testb %al, %al
jne 0x8a13
xorl %r15d, %r15d
jmp 0x8a13