// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq (%rax), %r15
movl (%rsi), %eax
testl %eax, %eax
je 0x852c
cmpl $0x3, %eax
je 0x8519
cmpl $0x4, %eax
jne 0x8645
movq %rbx, %rdi
callq 0x83cf
jmp 0x8661
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xa2ca
jmp 0x8661
movb $0x1, 0x28(%r15)
movq 0x30(%r14), %r13
movq %r13, 0x30(%r15)
movq 0x38(%r14), %r12
movq %r12, 0x38(%r15)
movq 0x40(%r14), %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x40(%r15)
pushq $0x1
popq %rbp
cmpb $0x0, 0x48(%r14)
jne 0x8615
leaq 0x11886(%rip), %rsi     # 0x19de9
movq %r13, %rdi
callq 0x4160
testl %eax, %eax
jne 0x8615
leaq 0x49816(%rip), %rsi     # 0x51d90
movq %r12, %rdi
xorl %edx, %edx
callq 0xa31d
testb %al, %al
jne 0x8615
leaq 0x49b7d(%rip), %rsi     # 0x52110
pushq $0x1
popq %rbp
movq %r12, %rdi
movl %ebp, %edx
callq 0xa31d
testb %al, %al
jne 0x8615
leaq 0x49ba5(%rip), %rsi     # 0x52150
pushq $0x1
popq %rbp
movq 0x10(%rsp), %rdi
movl %ebp, %edx
callq 0xa31d
testb %al, %al
jne 0x8615
movb 0x4a(%r14), %al
movb %al, 0xf(%rsp)
testb %al, %al
jne 0x85df
leaq 0x49b9f(%rip), %rsi     # 0x52170
movq %r12, %rdi
xorl %edx, %edx
callq 0xa31d
testb %al, %al
jne 0x8615
leaq 0x49bba(%rip), %rsi     # 0x521a0
movq %r12, %rdi
xorl %edx, %edx
callq 0xa31d
pushq $0x2
popq %rbp
testb %al, %al
jne 0x8615
cmpb $0x0, 0xf(%rsp)
je 0x8613
leaq 0x49b6b(%rip), %rsi     # 0x52170
movq %r12, %rdi
xorl %edx, %edx
callq 0xa31d
testb %al, %al
jne 0x8615
xorl %ebp, %ebp
movl %ebp, 0x48(%r15)
movq 0x18(%rbx), %rax
movl $0x1, (%rax)
leaq 0x117bf(%rip), %rsi     # 0x19de9
movq %r13, %rdi
callq 0x4160
testl %eax, %eax
je 0x8675
movq %rbx, %rdi
movq %r14, %rsi
callq 0x797d
xorl %ebp, %ebp
jmp 0x8664
movq %rbx, %rdi
movq %r14, %rsi
callq 0x797d
pushq $0x1
popq %rax
movl %eax, 0x48(%r15)
movq 0x18(%rbx), %rcx
movl %eax, (%rcx)
movb $0x1, 0x50(%rcx)
movb $0x1, %bpl
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, 0x49(%r14)
je 0x8702
leaq 0x30(%r14), %r15
leaq 0x49b55(%rip), %rsi     # 0x521e0
leaq 0x49b5e(%rip), %rdx     # 0x521f0
pushq $0x1
popq %rcx
movq %r15, %rdi
callq 0xa3f4
movb $0x1, %bpl
testb %al, %al
jne 0x8664
leaq 0x49b55(%rip), %rsi     # 0x52200
leaq 0x49b5e(%rip), %rdx     # 0x52210
pushq $0x1
popq %rcx
movq %r15, %rdi
callq 0xa3f4
testb %al, %al
jne 0x8664
leaq 0x49b58(%rip), %rsi     # 0x52220
leaq 0x49b61(%rip), %rdx     # 0x52230
movq %r15, %rdi
xorl %ecx, %ecx
callq 0xa3f4
testb %al, %al
jne 0x8664
leaq 0x49b5c(%rip), %rsi     # 0x52240
leaq 0x49b65(%rip), %rdx     # 0x52250
movq %r15, %rdi
xorl %ecx, %ecx
callq 0xa3f4
testb %al, %al
je 0x8636
jmp 0x8664
movb $0x1, %bpl
cmpb $0x1, 0x4a(%r14)
jne 0x8664
leaq 0x49ab9(%rip), %rdi     # 0x521d0
movq 0x10(%rsp), %rsi
callq 0xa37e
testb %al, %al
je 0x8664
jmp 0x8680