// File: /workspace/github_c_makefile_star2_O1/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), %r12
movl (%rsi), %eax
testl %eax, %eax
je 0x8da9
cmpl $0x3, %eax
je 0x8d96
cmpl $0x4, %eax
jne 0x8ee9
movq 0x18(%rbx), %rax
movq 0x98(%rax), %rbx
movq %rbx, %rdi
callq 0xd3c9
movb $0x1, %bpl
cmpl $0x1, (%rbx)
jne 0x8f0b
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
jmp 0x8f0b
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0xb4a3
jmp 0x8f08
movb $0x1, 0x28(%r12)
movq 0x30(%r14), %r13
movq %r13, 0x30(%r12)
movq 0x38(%r14), %rax
movq %rax, 0x38(%r12)
movq 0x40(%r14), %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x40(%r12)
movl $0x1, %ebp
cmpb $0x0, 0x48(%r14)
jne 0x8eb8
movq 0x38(%r14), %r15
leaq 0x14f6f(%rip), %rsi     # 0x1dd59
movq %r13, %rdi
callq 0x4160
testl %eax, %eax
jne 0x8eb8
leaq 0x4bf9f(%rip), %rsi     # 0x54da0
movq %r15, %rdi
xorl %edx, %edx
callq 0xb505
testb %al, %al
jne 0x8eb8
leaq 0x4c306(%rip), %rsi     # 0x55120
movl $0x1, %ebp
movq %r15, %rdi
movl $0x1, %edx
callq 0xb505
testb %al, %al
jne 0x8eb8
movq %r15, 0x8(%rsp)
leaq 0x4c320(%rip), %rsi     # 0x55160
movl $0x1, %ebp
movq 0x10(%rsp), %rdi
movl $0x1, %edx
callq 0xb505
testb %al, %al
jne 0x8eb8
movb 0x4a(%r14), %al
movb %al, 0x7(%rsp)
testb %al, %al
movq 0x8(%rsp), %r15
jne 0x8e7e
leaq 0x4c310(%rip), %rsi     # 0x55180
movq %r15, %rdi
xorl %edx, %edx
callq 0xb505
testb %al, %al
jne 0x8eb8
leaq 0x4c32b(%rip), %rsi     # 0x551b0
movq %r15, %rdi
xorl %edx, %edx
callq 0xb505
movl $0x2, %ebp
testb %al, %al
jne 0x8eb8
cmpb $0x0, 0x7(%rsp)
movq 0x8(%rsp), %rdi
je 0x8eb6
leaq 0x4c2d5(%rip), %rsi     # 0x55180
xorl %edx, %edx
callq 0xb505
testb %al, %al
jne 0x8eb8
xorl %ebp, %ebp
movl %ebp, 0x48(%r12)
movq 0x18(%rbx), %rax
movl $0x1, (%rax)
leaq 0x14e8b(%rip), %rsi     # 0x1dd59
movq %r13, %rdi
callq 0x4160
testl %eax, %eax
je 0x8f1c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8171
xorl %ebp, %ebp
jmp 0x8f0b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8171
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 $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, 0x49(%r14)
je 0x8fad
leaq 0x30(%r14), %r15
leaq 0x4c2ae(%rip), %rsi     # 0x551e0
leaq 0x4c2b7(%rip), %rdx     # 0x551f0
movq %r15, %rdi
movl $0x1, %ecx
callq 0xb62a
movb $0x1, %bpl
testb %al, %al
jne 0x8f0b
leaq 0x4c2ac(%rip), %rsi     # 0x55200
leaq 0x4c2b5(%rip), %rdx     # 0x55210
movq %r15, %rdi
movl $0x1, %ecx
callq 0xb62a
testb %al, %al
jne 0x8f0b
leaq 0x4c2ad(%rip), %rsi     # 0x55220
leaq 0x4c2b6(%rip), %rdx     # 0x55230
movq %r15, %rdi
xorl %ecx, %ecx
callq 0xb62a
testb %al, %al
jne 0x8f0b
leaq 0x4c2b1(%rip), %rsi     # 0x55240
leaq 0x4c2ba(%rip), %rdx     # 0x55250
movq %r15, %rdi
xorl %ecx, %ecx
callq 0xb62a
testb %al, %al
je 0x8eda
jmp 0x8f0b
movb $0x1, %bpl
cmpb $0x1, 0x4a(%r14)
jne 0x8f0b
movq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x40b0
cmpq $0x13, %rax
jne 0x8f0b
leaq 0x156c2(%rip), %rdi     # 0x1e69b
movq %r15, %rsi
movq %rax, %rdx
callq 0x4200
testl %eax, %eax
jne 0x8f0b
jmp 0x8f27