// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: fragment_parser_init
static void fragment_parser_init (
  GumboParser* parser,
  GumboTag fragment_ctx,
  GumboNamespaceEnum fragment_namespace
) {
  GumboNode* root;
  assert(fragment_ctx != GUMBO_TAG_LAST);

  // 3
  parser->_parser_state->_fragment_ctx = create_element(parser, fragment_ctx);
  parser->_parser_state->_fragment_ctx->v.element.tag_namespace =
      fragment_namespace;

  // 4
  if (fragment_namespace == GUMBO_NAMESPACE_HTML) {
    // Non-HTML namespaces always start in the DATA state.
    switch (fragment_ctx) {
      case GUMBO_TAG_TITLE:
      case GUMBO_TAG_TEXTAREA:
        gumbo_tokenizer_set_state(parser, GUMBO_LEX_RCDATA);
        break;

      case GUMBO_TAG_STYLE:
      case GUMBO_TAG_XMP:
      case GUMBO_TAG_IFRAME:
      case GUMBO_TAG_NOEMBED:
      case GUMBO_TAG_NOFRAMES:
        gumbo_tokenizer_set_state(parser, GUMBO_LEX_RAWTEXT);
        break;

      case GUMBO_TAG_SCRIPT:
        gumbo_tokenizer_set_state(parser, GUMBO_LEX_SCRIPT);
        break;

      case GUMBO_TAG_NOSCRIPT:
        /* scripting is disabled in Gumbo, so leave the tokenizer
         * in the default data state */
        break;

      case GUMBO_TAG_PLAINTEXT:
        gumbo_tokenizer_set_state(parser, GUMBO_LEX_PLAINTEXT);
        break;

      default:
        /* default data state */
        break;
    }
  }

  // 5. 6. 7.
  root = insert_element_of_tag_type (
    parser,
    GUMBO_TAG_HTML,
    GUMBO_INSERTION_IMPLIED
  );
  parser->_output->root = root;

  // 8.
  if (fragment_ctx == GUMBO_TAG_TEMPLATE) {
    push_template_insertion_mode(parser, GUMBO_INSERTION_MODE_IN_TEMPLATE);
  }

  // 10.
  reset_insertion_mode_appropriately(parser);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
cmpl $0x97, -0xc(%rbp)
je 0x73ed
jmp 0x740c
leaq 0x2bb89(%rip), %rdi     # 0x32f7d
leaq 0x2ba79(%rip), %rsi     # 0x32e74
movl $0x1115, %edx           # imm = 0x1115
leaq 0x2bb95(%rip), %rcx     # 0x32f9c
callq 0x4100
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x7d60
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x48(%rax)
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x48(%rax), %rax
movl %ecx, 0x2c(%rax)
cmpl $0x0, -0x10(%rbp)
jne 0x74f8
movl -0xc(%rbp), %eax
movl %eax, -0x1c(%rbp)
subl $0x2, %eax
je 0x74b2
jmp 0x7450
movl -0x1c(%rbp), %eax
subl $0x6, %eax
je 0x74c2
jmp 0x745a
movl -0x1c(%rbp), %eax
subl $0x7, %eax
je 0x74d2
jmp 0x7464
movl -0x1c(%rbp), %eax
subl $0x8, %eax
je 0x74e2
jmp 0x746e
movl -0x1c(%rbp), %eax
subl $0x48, %eax
je 0x74c2
jmp 0x7478
movl -0x1c(%rbp), %eax
subl $0x73, %eax
je 0x74b2
jmp 0x7482
movl -0x1c(%rbp), %eax
subl $0x82, %eax
je 0x74c2
jmp 0x748e
movl -0x1c(%rbp), %eax
subl $0x84, %eax
je 0x74c2
jmp 0x749a
movl -0x1c(%rbp), %eax
subl $0x86, %eax
je 0x74c2
jmp 0x74a6
movl -0x1c(%rbp), %eax
subl $0x87, %eax
je 0x74e4
jmp 0x74f4
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x11a10
jmp 0x74f6
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x11a10
jmp 0x74f6
movq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0x11a10
jmp 0x74f6
jmp 0x74f6
movq -0x8(%rbp), %rdi
movl $0x6, %esi
callq 0x11a10
jmp 0x74f6
jmp 0x74f6
jmp 0x74f8
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x7ea0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
cmpl $0x9, -0xc(%rbp)
jne 0x7530
movq -0x8(%rbp), %rdi
movl $0x11, %esi
callq 0x7f10
movq -0x8(%rbp), %rdi
callq 0x7f40
addq $0x20, %rsp
popq %rbp
retq
nop