// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/lib/error.c
// Function: gumbo_error_to_string
void gumbo_error_to_string (
  const GumboError* error,
  GumboStringBuffer* output
) {
  print_message (
    output,
    "@%zu:%zu: ",
    error->position.line,
    error->position.column
  );
  switch (error->type) {
    case GUMBO_ERR_UTF8_INVALID:
      print_message (
        output,
        "Invalid UTF8 character 0x%" PRIx32,
        error->v.codepoint
      );
      break;
    case GUMBO_ERR_UTF8_TRUNCATED:
      print_message (
        output,
        "Input stream ends with a truncated UTF8 character 0x%" PRIx32,
        error->v.codepoint
      );
      break;
    case GUMBO_ERR_UTF8_NULL:
      print_message (
        output,
        "Unexpected NULL character in the input stream"
      );
      break;
    case GUMBO_ERR_NUMERIC_CHAR_REF_NO_DIGITS:
      print_message (
        output,
        "No digits after &# in numeric character reference"
      );
      break;
    case GUMBO_ERR_NUMERIC_CHAR_REF_WITHOUT_SEMICOLON:
      print_message (
        output,
        "The numeric character reference &#%" PRIu32 " should be followed "
        "by a semicolon",
        error->v.codepoint
      );
      break;
    case GUMBO_ERR_NUMERIC_CHAR_REF_INVALID:
      print_message (
        output,
        "The numeric character reference &#%" PRIu32 "; encodes an invalid "
        "unicode codepoint",
        error->v.codepoint
      );
      break;
    case GUMBO_ERR_NAMED_CHAR_REF_WITHOUT_SEMICOLON:
      // The textual data came from one of the literal strings in the table, and
      // so it'll be null-terminated.
      print_message (
        output,
        "The named character reference &%.*s should be followed by a "
        "semicolon",
        (int) error->v.text.length,
        error->v.text.data
      );
      break;
    case GUMBO_ERR_NAMED_CHAR_REF_INVALID:
      print_message (
        output,
        "The named character reference &%.*s; is not a valid entity name",
        (int) error->v.text.length,
        error->v.text.data
      );
      break;
    case GUMBO_ERR_DUPLICATE_ATTR:
      print_message (
        output,
        "Attribute %s occurs multiple times, at positions %u and %u",
        error->v.duplicate_attr.name,
        error->v.duplicate_attr.original_index,
        error->v.duplicate_attr.new_index
      );
      break;
    case GUMBO_ERR_DASHES_OR_DOCTYPE:
      print_message (
        output,
        "Incorrectly opened comment; expected '--', 'DOCTYPE', or '[CDATA['"
      );
      break;
    case GUMBO_ERR_PARSER:
    case GUMBO_ERR_UNACKNOWLEDGED_SELF_CLOSING_TAG:
      handle_parser_error(&error->v.parser, output);
      break;
    default:
      print_message (
        output,
        "Tokenizer error with an unimplemented error message"
      );
      break;
  }
  gumbo_string_buffer_append_codepoint('.', output);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rcx
leaq 0x12f90(%rip), %rsi     # 0x1a294
movq %rbx, %rdi
xorl %eax, %eax
callq 0x74cf
movl (%r14), %eax
cmpl $0x17, %eax
jg 0x733d
cmpl $0x7, %eax
ja 0x7398
movl %eax, %eax
leaq 0x12f2c(%rip), %rcx     # 0x1a250
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x28(%r14), %edx
leaq 0x12f67(%rip), %rsi     # 0x1a29f
jmp 0x7414
leal -0x28(%rax), %ecx
cmpl $0x2, %ecx
jb 0x735f
cmpl $0x18, %eax
je 0x73e7
cmpl $0x1b, %eax
jne 0x7398
leaq 0x1314b(%rip), %rsi     # 0x1a4a5
jmp 0x7492
movl 0x30(%r14), %eax
addq $0x28, %r14
testl %eax, %eax
je 0x743b
movl (%r14), %ecx
cmpq $0x8, %rcx
ja 0x749c
leaq 0x12eed(%rip), %rdx     # 0x1a270
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x13232(%rip), %rsi     # 0x1a5c5
jmp 0x7492
leaq 0x13149(%rip), %rsi     # 0x1a4e8
jmp 0x7492
movl 0x28(%r14), %edx
leaq 0x12fa3(%rip), %rsi     # 0x1a352
jmp 0x7414
leaq 0x12f3a(%rip), %rsi     # 0x1a2f2
jmp 0x7492
leaq 0x12f5c(%rip), %rsi     # 0x1a320
jmp 0x7492
movl 0x30(%r14), %edx
movq 0x28(%r14), %rcx
leaq 0x13052(%rip), %rsi     # 0x1a42a
jmp 0x742f
movl 0x28(%r14), %edx
leaq 0x12ed6(%rip), %rsi     # 0x1a2bb
jmp 0x7414
movq 0x28(%r14), %rdx
movl 0x30(%r14), %ecx
movl 0x34(%r14), %r8d
leaq 0x13070(%rip), %rsi     # 0x1a46a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x74cf
jmp 0x749c
movl 0x28(%r14), %edx
leaq 0x12f85(%rip), %rsi     # 0x1a399
movq %rbx, %rdi
xorl %eax, %eax
callq 0x74cf
jmp 0x749c
movl 0x30(%r14), %edx
movq 0x28(%r14), %rcx
leaq 0x12fb5(%rip), %rsi     # 0x1a3e4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x74cf
jmp 0x749c
cmpl $0x0, (%r14)
je 0x736f
leaq 0x130d5(%rip), %rsi     # 0x1a521
jmp 0x7492
leaq 0x131e8(%rip), %rsi     # 0x1a63d
jmp 0x746b
leaq 0x130f7(%rip), %rsi     # 0x1a555
jmp 0x7492
testl %eax, %eax
je 0x748b
leaq 0x131bc(%rip), %rsi     # 0x1a627
movq %rbx, %rdi
xorl %eax, %eax
callq 0x74cf
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7781
jmp 0x749c
leaq 0x1315f(%rip), %rsi     # 0x1a5e8
jmp 0x7492
leaq 0x1317a(%rip), %rsi     # 0x1a60c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x74cf
movl $0x2e, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4322
leaq 0x17e6e(%rip), %rdi     # 0x1f325
leaq 0x130b3(%rip), %rsi     # 0x1a571
leaq 0x130b8(%rip), %rcx     # 0x1a57d
movl $0x51, %edx
callq 0x4100