// File: /workspace/github_c_makefile_star2_O0/mijallen[P]SimpleHTTPServer/lib/libyaml/src/emitter.c
// Function: yaml_emitter_emit_document_start
static int
yaml_emitter_emit_document_start(yaml_emitter_t *emitter,
        yaml_event_t *event, int first)
{
    if (event->type == YAML_DOCUMENT_START_EVENT)
    {
        yaml_tag_directive_t default_tag_directives[] = {
            {(yaml_char_t *)"!", (yaml_char_t *)"!"},
            {(yaml_char_t *)"!!", (yaml_char_t *)"tag:yaml.org,2002:"},
            {NULL, NULL}
        };
        yaml_tag_directive_t *tag_directive;
        int implicit;

        if (event->data.document_start.version_directive) {
            if (!yaml_emitter_analyze_version_directive(emitter,
                        *event->data.document_start.version_directive))
                return 0;
        }

        for (tag_directive = event->data.document_start.tag_directives.start;
                tag_directive != event->data.document_start.tag_directives.end;
                tag_directive ++) {
            if (!yaml_emitter_analyze_tag_directive(emitter, *tag_directive))
                return 0;
            if (!yaml_emitter_append_tag_directive(emitter, *tag_directive, 0))
                return 0;
        }

        for (tag_directive = default_tag_directives;
                tag_directive->handle; tag_directive ++) {
            if (!yaml_emitter_append_tag_directive(emitter, *tag_directive, 1))
                return 0;
        }

        implicit = event->data.document_start.implicit;
        if (!first || emitter->canonical) {
            implicit = 0;
        }

        if ((event->data.document_start.version_directive ||
                    (event->data.document_start.tag_directives.start
                     != event->data.document_start.tag_directives.end)) &&
                emitter->open_ended)
        {
            if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
                return 0;
            if (!yaml_emitter_write_indent(emitter))
                return 0;
        }

        if (event->data.document_start.version_directive) {
            implicit = 0;
            if (!yaml_emitter_write_indicator(emitter, "%YAML", 1, 0, 0))
                return 0;
            if (!yaml_emitter_write_indicator(emitter, "1.1", 1, 0, 0))
                return 0;
            if (!yaml_emitter_write_indent(emitter))
                return 0;
        }
        
        if (event->data.document_start.tag_directives.start
                != event->data.document_start.tag_directives.end) {
            implicit = 0;
            for (tag_directive = event->data.document_start.tag_directives.start;
                    tag_directive != event->data.document_start.tag_directives.end;
                    tag_directive ++) {
                if (!yaml_emitter_write_indicator(emitter, "%TAG", 1, 0, 0))
                    return 0;
                if (!yaml_emitter_write_tag_handle(emitter, tag_directive->handle,
                            strlen((char *)tag_directive->handle)))
                    return 0;
                if (!yaml_emitter_write_tag_content(emitter, tag_directive->prefix,
                            strlen((char *)tag_directive->prefix), 1))
                    return 0;
                if (!yaml_emitter_write_indent(emitter))
                    return 0;
            }
        }

        if (yaml_emitter_check_empty_document(emitter)) {
            implicit = 0;
        }

        if (!implicit) {
            if (!yaml_emitter_write_indent(emitter))
                return 0;
            if (!yaml_emitter_write_indicator(emitter, "---", 1, 0, 0))
                return 0;
            if (emitter->canonical) {
                if (!yaml_emitter_write_indent(emitter))
                    return 0;
            }
        }

        emitter->state = YAML_EMIT_DOCUMENT_CONTENT_STATE;

        return 1;
    }

    else if (event->type == YAML_STREAM_END_EVENT)
    {
        if (emitter->open_ended)
        {
            if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
                return 0;
            if (!yaml_emitter_write_indent(emitter))
                return 0;
        }

        if (!yaml_emitter_flush(emitter))
            return 0;

        emitter->state = YAML_EMIT_END_STATE;

        return 1;
    }

    return yaml_emitter_set_emitter_error(emitter,
            "expected DOCUMENT-START or STREAM-END");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x1fbd5
leaq -0x50(%rbp), %rdi
leaq 0x115e2(%rip), %rsi     # 0x30de0
movl $0x30, %edx
callq 0x2180
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1f83a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rsi
callq 0x20c50
cmpl $0x0, %eax
jne 0x1f838
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
jmp 0x1f83a
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x18(%rcx), %rax
je 0x1f8b0
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x20ca0
cmpl $0x0, %eax
jne 0x1f879
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
xorl %ecx, %ecx
callq 0x20ed0
cmpl $0x0, %eax
jne 0x1f8a0
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
jmp 0x1f8a2
movq -0x58(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x58(%rbp)
jmp 0x1f846
leaq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq $0x0, (%rax)
je 0x1f8fc
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl $0x1, %ecx
callq 0x20ed0
cmpl $0x0, %eax
jne 0x1f8ec
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
jmp 0x1f8ee
movq -0x58(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x58(%rbp)
jmp 0x1f8b8
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1f916
movq -0x10(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
je 0x1f91d
movl $0x0, -0x5c(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1f93a
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x18(%rcx), %rax
je 0x1f98f
movq -0x10(%rbp), %rax
cmpl $0x0, 0x128(%rax)
je 0x1f98f
movq -0x10(%rbp), %rdi
leaq 0xd3fe(%rip), %rsi      # 0x2cd50
movl $0x1, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x21060
cmpl $0x0, %eax
jne 0x1f973
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rdi
callq 0x213e0
cmpl $0x0, %eax
jne 0x1f98d
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
jmp 0x1f98f
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1fa15
movl $0x0, -0x5c(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xd3a8(%rip), %rsi      # 0x2cd54
movl $0x1, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x21060
cmpl $0x0, %eax
jne 0x1f9cd
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rdi
leaq 0xd382(%rip), %rsi      # 0x2cd5a
movl $0x1, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x21060
cmpl $0x0, %eax
jne 0x1f9f9
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rdi
callq 0x213e0
cmpl $0x0, %eax
jne 0x1fa13
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
jmp 0x1fa15
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x18(%rcx), %rax
je 0x1fb32
movl $0x0, -0x5c(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x18(%rcx), %rax
je 0x1fb30
movq -0x10(%rbp), %rdi
leaq 0xd303(%rip), %rsi      # 0x2cd5e
movl $0x1, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x21060
cmpl $0x0, %eax
jne 0x1fa7c
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %rdi
callq 0x20d0
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq %rax, %rdx
callq 0x21600
cmpl $0x0, %eax
jne 0x1fabc
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x20d0
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq %rax, %rdx
movl $0x1, %ecx
callq 0x21930
cmpl $0x0, %eax
jne 0x1fb03
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rdi
callq 0x213e0
cmpl $0x0, %eax
jne 0x1fb1d
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
jmp 0x1fb1f
movq -0x58(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x58(%rbp)
jmp 0x1fa3e
jmp 0x1fb32
movq -0x10(%rbp), %rdi
callq 0x22000
cmpl $0x0, %eax
je 0x1fb47
movl $0x0, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x1fbbb
movq -0x10(%rbp), %rdi
callq 0x213e0
cmpl $0x0, %eax
jne 0x1fb67
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rdi
leaq 0xd1f1(%rip), %rsi      # 0x2cd63
movl $0x1, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x21060
cmpl $0x0, %eax
jne 0x1fb93
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
je 0x1fbb9
movq -0x10(%rbp), %rdi
callq 0x213e0
cmpl $0x0, %eax
jne 0x1fbb7
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
jmp 0x1fbb9
jmp 0x1fbbb
movq -0x10(%rbp), %rax
movl $0x3, 0xa8(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x1fc70
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x1fc5b
movq -0x10(%rbp), %rax
cmpl $0x0, 0x128(%rax)
je 0x1fc2d
movq -0x10(%rbp), %rdi
leaq 0xd15a(%rip), %rsi      # 0x2cd50
movl $0x1, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x21060
cmpl $0x0, %eax
jne 0x1fc14
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rdi
callq 0x213e0
cmpl $0x0, %eax
jne 0x1fc2b
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
jmp 0x1fc2d
movq -0x10(%rbp), %rdi
callq 0x21a0
cmpl $0x0, %eax
jne 0x1fc44
movl $0x0, -0x4(%rbp)
jmp 0x1fc70
movq -0x10(%rbp), %rax
movl $0x11, 0xa8(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x1fc70
jmp 0x1fc5d
movq -0x10(%rbp), %rdi
leaq 0xd0ff(%rip), %rsi      # 0x2cd67
callq 0x20b90
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)