// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/lib/libyaml/src/parser.c
// Function: yaml_parser_parse_document_start
static int
yaml_parser_parse_document_start(yaml_parser_t *parser, yaml_event_t *event,
        int implicit)
{
    yaml_token_t *token;
    yaml_version_directive_t *version_directive = NULL;
    struct {
        yaml_tag_directive_t *start;
        yaml_tag_directive_t *end;
    } tag_directives = { NULL, NULL };

    token = PEEK_TOKEN(parser);
    if (!token) return 0;

    /* Parse extra document end indicators. */

    if (!implicit)
    {
        while (token->type == YAML_DOCUMENT_END_TOKEN) {
            SKIP_TOKEN(parser);
            token = PEEK_TOKEN(parser);
            if (!token) return 0;
        }
    }

    /* Parse an implicit document. */

    if (implicit && token->type != YAML_VERSION_DIRECTIVE_TOKEN &&
            token->type != YAML_TAG_DIRECTIVE_TOKEN &&
            token->type != YAML_DOCUMENT_START_TOKEN &&
            token->type != YAML_STREAM_END_TOKEN)
    {
        if (!yaml_parser_process_directives(parser, NULL, NULL, NULL))
            return 0;
        if (!PUSH(parser, parser->states, YAML_PARSE_DOCUMENT_END_STATE))
            return 0;
        parser->state = YAML_PARSE_BLOCK_NODE_STATE;
        DOCUMENT_START_EVENT_INIT(*event, NULL, NULL, NULL, 1,
                token->start_mark, token->start_mark);
        return 1;
    }

    /* Parse an explicit document. */

    else if (token->type != YAML_STREAM_END_TOKEN)
    {
        yaml_mark_t start_mark, end_mark;
        start_mark = token->start_mark;
        if (!yaml_parser_process_directives(parser, &version_directive,
                    &tag_directives.start, &tag_directives.end))
            return 0;
        token = PEEK_TOKEN(parser);
        if (!token) goto error;
        if (token->type != YAML_DOCUMENT_START_TOKEN) {
            yaml_parser_set_parser_error(parser,
                    "did not find expected <document start>", token->start_mark);
            goto error;
        }
        if (!PUSH(parser, parser->states, YAML_PARSE_DOCUMENT_END_STATE))
            goto error;
        parser->state = YAML_PARSE_DOCUMENT_CONTENT_STATE;
        end_mark = token->end_mark;
        DOCUMENT_START_EVENT_INIT(*event, version_directive,
                tag_directives.start, tag_directives.end, 0,
                start_mark, end_mark);
        SKIP_TOKEN(parser);
        version_directive = NULL;
        tag_directives.start = tag_directives.end = NULL;
        return 1;
    }

    /* Parse the stream end. */

    else
    {
        parser->state = YAML_PARSE_END_STATE;
        STREAM_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
        SKIP_TOKEN(parser);
        return 1;
    }

error:
    yaml_free(version_directive);
    while (tag_directives.start != tag_directives.end) {
        yaml_free(tag_directives.end[-1].handle);
        yaml_free(tag_directives.end[-1].prefix);
        tag_directives.end --;
    }
    yaml_free(tag_directives.start);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, 0x18(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
cmpl $0x0, 0x130(%rdi)
jne 0xd4ba
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
je 0xd839
movq 0x118(%rbx), %r13
xorl %r15d, %r15d
testq %r13, %r13
je 0xd83c
testl %ebp, %ebp
je 0xd5f9
movl (%r13), %eax
leal -0x2(%rax), %ecx
cmpl $0x4, %ecx
jb 0xd602
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xf090
testl %eax, %eax
je 0xd83c
movq 0x180(%rbx), %rax
cmpq 0x178(%rbx), %rax
jne 0xd537
leaq 0x180(%rbx), %r12
leaq 0x178(%rbx), %rdx
leaq 0x170(%rbx), %rdi
movq %r12, %rsi
callq 0x20e0
testl %eax, %eax
je 0xd84e
movq (%r12), %rax
leaq 0x4(%rax), %rcx
movq %rcx, 0x180(%rbx)
movl $0x4, (%rax)
movl $0x5, 0x188(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movups %xmm0, 0x50(%r14)
movups %xmm0, 0x40(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
andq $0x0, 0x60(%r14)
movl $0x3, (%r14)
movups 0x20(%r13), %xmm1
movups %xmm1, 0x38(%r14)
movq 0x30(%r13), %rax
movq %rax, 0x48(%r14)
movups 0x20(%r13), %xmm1
movups %xmm1, 0x50(%r14)
movq 0x30(%r13), %rax
movq %rax, 0x60(%r14)
andq $0x0, 0x18(%r14)
movups %xmm0, 0x8(%r14)
movl $0x1, 0x20(%r14)
jmp 0xd693
andl $0x0, 0x130(%rbx)
incq 0x128(%rbx)
andl $0x0, 0xfc(%rbx)
addq $0x50, %r13
movq %r13, 0x118(%rbx)
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
je 0xd83c
movq 0x118(%rbx), %r13
testq %r13, %r13
je 0xd83c
movl (%r13), %eax
cmpl $0x6, %eax
je 0xd5b9
cmpl $0x2, %eax
jne 0xd69c
movl $0x17, 0x188(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movups %xmm0, 0x50(%r14)
movups %xmm0, 0x40(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
andq $0x0, 0x60(%r14)
movl $0x2, (%r14)
movq 0x30(%r13), %rax
movq %rax, 0x48(%r14)
movups 0x20(%r13), %xmm0
movups %xmm0, 0x38(%r14)
movq 0x48(%r13), %rax
movq %rax, 0x60(%r14)
movups 0x38(%r13), %xmm0
movups %xmm0, 0x50(%r14)
andl $0x0, 0x130(%rbx)
incq 0x128(%rbx)
movq 0x118(%rbx), %rax
xorl %ecx, %ecx
cmpl $0x2, (%rax)
sete %cl
movl %ecx, 0xfc(%rbx)
addq $0x50, %rax
movq %rax, 0x118(%rbx)
pushq $0x1
popq %r15
jmp 0xd83c
movups 0x20(%r13), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x30(%r13), %rax
movq %rax, 0x50(%rsp)
leaq 0x8(%rsp), %rcx
leaq 0x18(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0xf090
testl %eax, %eax
je 0xd839
cmpl $0x0, 0x130(%rbx)
jne 0xd6e5
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
je 0xd7f5
movq 0x118(%rbx), %r12
testq %r12, %r12
je 0xd7f5
cmpl $0x5, (%r12)
jne 0xd7bd
movq 0x180(%rbx), %rax
cmpq 0x178(%rbx), %rax
jne 0xd738
leaq 0x180(%rbx), %r15
leaq 0x178(%rbx), %rdx
leaq 0x170(%rbx), %rdi
movq %r15, %rsi
callq 0x20e0
testl %eax, %eax
je 0xd856
movq (%r15), %rax
leaq 0x4(%rax), %rcx
movq %rcx, 0x180(%rbx)
movl $0x4, (%rax)
pushq $0x3
popq %rax
movl %eax, 0x188(%rbx)
movq 0x48(%r12), %rcx
movq %rcx, 0x30(%rsp)
movups 0x38(%r12), %xmm0
movaps %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
andq $0x0, 0x30(%r14)
movl %eax, (%r14)
movq 0x50(%rsp), %rax
movq %rax, 0x48(%r14)
movaps 0x40(%rsp), %xmm0
movups %xmm0, 0x38(%r14)
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x50(%r14)
movq 0x30(%rsp), %rax
movq %rax, 0x60(%r14)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%r14)
movaps (%rsp), %xmm0
movups %xmm0, 0x10(%r14)
jmp 0xd665
movq 0x30(%r12), %rax
movq %rax, 0x70(%rsp)
movups 0x20(%r12), %xmm0
movaps %xmm0, 0x60(%rsp)
movl $0x4, (%rbx)
leaq 0xa08a(%rip), %rax      # 0x17869
movq %rax, 0x8(%rbx)
movaps 0x60(%rsp), %xmm0
movups %xmm0, 0x20(%rbx)
movq 0x70(%rsp), %rax
movq %rax, 0x30(%rbx)
movq 0x18(%rsp), %rdi
callq 0x2140
movq 0x8(%rsp), %rax
movq (%rsp), %rdi
cmpq %rax, %rdi
je 0xd834
movq -0x10(%rax), %rdi
callq 0x2140
movq 0x8(%rsp), %rax
movq -0x8(%rax), %rdi
callq 0x2140
movq 0x8(%rsp), %rax
addq $-0x10, %rax
movq %rax, 0x8(%rsp)
jmp 0xd804
callq 0x2140
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, (%rbx)
jmp 0xd83c
movl $0x1, (%rbx)
jmp 0xd7f5