// File: /workspace/github_c_makefile_star2_O1/mijallen[P]SimpleHTTPServer/lib/libyaml/src/api.c
// Function: yaml_document_start_event_initialize
YAML_DECLARE(int)
yaml_document_start_event_initialize(yaml_event_t *event,
        yaml_version_directive_t *version_directive,
        yaml_tag_directive_t *tag_directives_start,
        yaml_tag_directive_t *tag_directives_end,
        int implicit)
{
    struct {
        yaml_error_type_t error;
    } context;
    yaml_mark_t mark = { 0, 0, 0 };
    yaml_version_directive_t *version_directive_copy = NULL;
    struct {
        yaml_tag_directive_t *start;
        yaml_tag_directive_t *end;
        yaml_tag_directive_t *top;
    } tag_directives_copy = { NULL, NULL, NULL };
    yaml_tag_directive_t value = { NULL, NULL };

    assert(event);          /* Non-NULL event object is expected. */
    assert((tag_directives_start && tag_directives_end) ||
            (tag_directives_start == tag_directives_end));
                            /* Valid tag directives are expected. */

    if (version_directive) {
        version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t));
        if (!version_directive_copy) goto error;
        version_directive_copy->major = version_directive->major;
        version_directive_copy->minor = version_directive->minor;
    }

    if (tag_directives_start != tag_directives_end) {
        yaml_tag_directive_t *tag_directive;
        if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE))
            goto error;
        for (tag_directive = tag_directives_start;
                tag_directive != tag_directives_end; tag_directive ++) {
            assert(tag_directive->handle);
            assert(tag_directive->prefix);
            if (!yaml_check_utf8(tag_directive->handle,
                        strlen((char *)tag_directive->handle)))
                goto error;
            if (!yaml_check_utf8(tag_directive->prefix,
                        strlen((char *)tag_directive->prefix)))
                goto error;
            value.handle = yaml_strdup(tag_directive->handle);
            value.prefix = yaml_strdup(tag_directive->prefix);
            if (!value.handle || !value.prefix) goto error;
            if (!PUSH(&context, tag_directives_copy, value))
                goto error;
            value.handle = NULL;
            value.prefix = NULL;
        }
    }

    DOCUMENT_START_EVENT_INIT(*event, version_directive_copy,
            tag_directives_copy.start, tag_directives_copy.top,
            implicit, mark, mark);

    return 1;

error:
    yaml_free(version_directive_copy);
    while (!STACK_EMPTY(context, tag_directives_copy)) {
        yaml_tag_directive_t value = POP(context, tag_directives_copy);
        yaml_free(value.handle);
        yaml_free(value.prefix);
    }
    STACK_DEL(context, tag_directives_copy);
    yaml_free(value.handle);
    yaml_free(value.prefix);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
testq %rdi, %rdi
je 0x38dd
movl %r8d, %r14d
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %rbx
movq %rdi, %r15
testq %rdx, %rdx
setne %al
testq %rcx, %rcx
setne %cl
cmpq %r12, %rdx
je 0x35f7
andb %cl, %al
je 0x38fc
testq %rbx, %rbx
je 0x3620
movl $0x8, %edi
callq 0x21a0
testq %rax, %rax
je 0x376f
movq %r15, 0x20(%rsp)
movl (%rbx), %ecx
movl %ecx, (%rax)
movl 0x4(%rbx), %ecx
movl %ecx, 0x4(%rax)
jmp 0x3627
movq %r15, 0x20(%rsp)
xorl %eax, %eax
cmpq %r12, %rbp
movq %rax, 0x28(%rsp)
je 0x3768
movl $0x100, %edi            # imm = 0x100
callq 0x21a0
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x3781
cmpq %r12, %rbp
je 0x3792
movq 0x8(%rsp), %rbx
movq %rbx, %rax
addq $0x100, %rax            # imm = 0x100
movl %r14d, 0x14(%rsp)
movq %r12, 0x50(%rsp)
movq (%rbp), %r12
testq %r12, %r12
je 0x38be
movq 0x8(%rbp), %r15
testq %r15, %r15
je 0x389f
movq %rax, %r13
movq %r12, %rdi
callq 0x20d0
movq %r12, %rdi
movq %rax, %rsi
callq 0x391b
testl %eax, %eax
je 0x3783
movq %r15, %rdi
callq 0x20d0
movq %r15, %rdi
movq %rax, %rsi
callq 0x391b
testl %eax, %eax
je 0x3783
movq %r12, %rdi
callq 0x2220
movq %rax, %r12
movq %r15, %rdi
callq 0x2220
movq %rax, %r15
testq %r12, %r12
je 0x3789
testq %r15, %r15
je 0x3789
movq %r13, %rax
cmpq %r13, %rbx
jne 0x3741
movq %r12, 0x18(%rsp)
movq %rax, %r14
movq 0x8(%rsp), %r12
subq %r12, %r14
leaq (%r14,%r14), %rsi
movq %r12, %rdi
callq 0x2130
movq %rbx, %rcx
subq %r12, %rcx
addq %rax, %rcx
leaq (%rax,%r14,2), %rdx
testq %rax, %rax
cmovneq %rax, %r12
movq %r12, 0x8(%rsp)
movq %r13, %rax
cmovneq %rdx, %rax
cmovneq %rcx, %rbx
je 0x3889
movl 0x14(%rsp), %r14d
movq 0x18(%rsp), %r12
movq %r12, (%rbx)
movq %r15, 0x8(%rbx)
addq $0x10, %rbx
addq $0x10, %rbp
movq 0x50(%rsp), %r12
cmpq %r12, %rbp
jne 0x366e
xorl %r12d, %r12d
xorl %r15d, %r15d
movb $0x1, %al
jmp 0x378b
xorl %r13d, %r13d
xorl %ebx, %ebx
jmp 0x37a6
xorl %r13d, %r13d
xorl %ebx, %ebx
xorl %edi, %edi
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x3818
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %eax, %eax
movq 0x8(%rsp), %r13
jmp 0x37a2
xorl %r12d, %r12d
movq 0x8(%rsp), %r13
movq %r13, %rbx
xorl %r15d, %r15d
movb $0x1, %al
testb %al, %al
je 0x3813
xorps %xmm0, %xmm0
movq 0x20(%rsp), %rcx
movups %xmm0, (%rcx)
movups %xmm0, 0x50(%rcx)
movups %xmm0, 0x40(%rcx)
movups %xmm0, 0x30(%rcx)
movups %xmm0, 0x20(%rcx)
movups %xmm0, 0x10(%rcx)
movq $0x0, 0x60(%rcx)
movl $0x3, (%rcx)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x38(%rcx)
movq 0x40(%rsp), %rax
movq %rax, 0x48(%rcx)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x50(%rcx)
movq 0x40(%rsp), %rax
movq %rax, 0x60(%rcx)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rcx)
movq %r13, 0x10(%rcx)
movq %rbx, 0x18(%rcx)
movl %r14d, 0x20(%rcx)
movl $0x1, %ebx
jmp 0x3878
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3822
callq 0x2040
cmpq %rbx, %r13
je 0x384f
movq -0x10(%rbx), %rdi
movq -0x8(%rbx), %r14
testq %rdi, %rdi
je 0x3839
callq 0x2040
testq %r14, %r14
je 0x3846
movq %r14, %rdi
callq 0x2040
addq $-0x10, %rbx
cmpq %r13, %rbx
jne 0x3827
testq %r13, %r13
je 0x385c
movq %r13, %rdi
callq 0x2040
testq %r12, %r12
je 0x3869
movq %r12, %rdi
callq 0x2040
xorl %ebx, %ebx
testq %r15, %r15
je 0x3878
movq %r15, %rdi
callq 0x2040
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
movl 0x14(%rsp), %r14d
movq 0x8(%rsp), %r13
movq 0x18(%rsp), %r12
jmp 0x37a2
leaq 0x14da6(%rip), %rdi     # 0x1864c
leaq 0x1478c(%rip), %rsi     # 0x18039
leaq 0x14c9b(%rip), %rcx     # 0x1854f
movl $0x2dd, %edx            # imm = 0x2DD
callq 0x2100
leaq 0x14d71(%rip), %rdi     # 0x18636
leaq 0x1476d(%rip), %rsi     # 0x18039
leaq 0x14c7c(%rip), %rcx     # 0x1854f
movl $0x2dc, %edx            # imm = 0x2DC
callq 0x2100
leaq 0x14be8(%rip), %rdi     # 0x184cc
leaq 0x1474e(%rip), %rsi     # 0x18039
leaq 0x14c5d(%rip), %rcx     # 0x1854f
movl $0x2ca, %edx            # imm = 0x2CA
callq 0x2100
leaq 0x14cd6(%rip), %rdi     # 0x185d9
leaq 0x1472f(%rip), %rsi     # 0x18039
leaq 0x14c3e(%rip), %rcx     # 0x1854f
movl $0x2cc, %edx            # imm = 0x2CC
callq 0x2100