// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
testq %rdi, %rdi
je 0x394e
movl %r8d, %r15d
movq %rdx, %rbp
movq %rsi, %rbx
movq %rdi, %r12
testq %rdx, %rdx
setne %al
testq %rcx, %rcx
setne %dl
movq %rcx, 0x18(%rsp)
cmpq %rcx, %rbp
je 0x36a0
andb %dl, %al
je 0x396d
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x36cb
movl $0x8, %edi
callq 0x21a0
testq %rax, %rax
je 0x38ec
movq %r12, 0x20(%rsp)
movq (%rbx), %rcx
movq %rcx, (%rax)
movq %rax, %r14
jmp 0x36d0
movq %r12, 0x20(%rsp)
cmpq 0x18(%rsp), %rbp
je 0x37ec
movl $0x100, %edi            # imm = 0x100
callq 0x21a0
testq %rax, %rax
je 0x386c
movq %rax, %r12
movl %r15d, 0x14(%rsp)
movq %r14, 0x8(%rsp)
movq %rax, %r14
addq $0x100, %r14            # imm = 0x100
movq %rax, (%rsp)
movq 0x18(%rsp), %r15
movq (%rbp), %r13
testq %r13, %r13
je 0x392f
movq 0x8(%rbp), %rbx
testq %rbx, %rbx
je 0x3910
movq %r13, %rdi
callq 0x20d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x398c
testl %eax, %eax
je 0x3878
movq %rbx, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x398c
testl %eax, %eax
je 0x3878
movq %r13, %rdi
callq 0x2220
movq %rax, %r13
movq %rbx, %rdi
callq 0x2220
movq %rax, %rbx
testq %r13, %r13
je 0x387d
testq %rbx, %rbx
je 0x387d
cmpq %r14, %r12
jne 0x37cc
movq %rbx, 0x28(%rsp)
movq %r12, %r14
movq (%rsp), %r15
subq %r15, %r14
leaq (%r14,%r14), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2130
testq %rax, %rax
je 0x38fe
addq %rax, %r14
addq %rax, %rbx
movq %rax, (%rsp)
movq %r14, %r12
movq 0x18(%rsp), %r15
movq %rbx, %r14
movq 0x28(%rsp), %rbx
leaq 0x10(%r12), %rax
movq %r13, (%r12)
movq %rbx, 0x8(%r12)
addq $0x10, %rbp
movq %rax, %r12
cmpq %r15, %rbp
jne 0x370e
jmp 0x3800
movl %r15d, 0x14(%rsp)
movq %r14, 0x8(%rsp)
movq $0x0, (%rsp)
xorl %eax, %eax
xorps %xmm0, %xmm0
movq 0x20(%rsp), %rdx
movups %xmm0, (%rdx)
movups %xmm0, 0x20(%rdx)
movups %xmm0, 0x10(%rdx)
movq $0x0, 0x30(%rdx)
movl $0x3, (%rdx)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x38(%rdx)
movq 0x40(%rsp), %rcx
movq %rcx, 0x48(%rdx)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x50(%rdx)
movq 0x40(%rsp), %rcx
movq %rcx, 0x60(%rdx)
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rdx)
movq (%rsp), %rcx
movq %rcx, 0x10(%rdx)
movq %rax, 0x18(%rdx)
movl 0x14(%rsp), %eax
movl %eax, 0x20(%rdx)
movl $0x1, %r14d
jmp 0x38ec
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebx, %ebx
jmp 0x3886
xorl %r13d, %r13d
xorl %ebx, %ebx
movq 0x8(%rsp), %r14
movq (%rsp), %rbp
testq %r14, %r14
je 0x3893
movq %r14, %rdi
callq 0x2040
cmpq %r12, %rbp
je 0x38c2
movq -0x10(%r12), %rdi
movq -0x8(%r12), %r15
testq %rdi, %rdi
je 0x38ac
callq 0x2040
testq %r15, %r15
je 0x38b9
movq %r15, %rdi
callq 0x2040
addq $-0x10, %r12
cmpq %rbp, %r12
jne 0x3898
testq %rbp, %rbp
je 0x38cf
movq %rbp, %rdi
callq 0x2040
testq %r13, %r13
je 0x38dc
movq %r13, %rdi
callq 0x2040
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x38ec
movq %rbx, %rdi
callq 0x2040
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %r14
movq %r15, %rbp
movq 0x28(%rsp), %rbx
jmp 0x3886
leaq 0x13d35(%rip), %rdi     # 0x1764c
leaq 0x1371b(%rip), %rsi     # 0x17039
leaq 0x13c2a(%rip), %rcx     # 0x1754f
movl $0x2dd, %edx            # imm = 0x2DD
callq 0x2100
leaq 0x13d00(%rip), %rdi     # 0x17636
leaq 0x136fc(%rip), %rsi     # 0x17039
leaq 0x13c0b(%rip), %rcx     # 0x1754f
movl $0x2dc, %edx            # imm = 0x2DC
callq 0x2100
leaq 0x13b77(%rip), %rdi     # 0x174cc
leaq 0x136dd(%rip), %rsi     # 0x17039
leaq 0x13bec(%rip), %rcx     # 0x1754f
movl $0x2ca, %edx            # imm = 0x2CA
callq 0x2100
leaq 0x13c65(%rip), %rdi     # 0x175d9
leaq 0x136be(%rip), %rsi     # 0x17039
leaq 0x13bcd(%rip), %rcx     # 0x1754f
movl $0x2cc, %edx            # imm = 0x2CC
callq 0x2100