// File: /workspace/github_c_makefile_star2_O2/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, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0x3799
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
testq %rdx, %rdx
setne %al
testq %rcx, %rcx
setne %cl
cmpq %r15, %rdx
je 0x3564
andb %cl, %al
je 0x37b8
movq %rdi, 0x40(%rsp)
movl %r8d, 0x1c(%rsp)
testq %r14, %r14
je 0x358f
pushq $0x8
popq %rdi
callq 0x21a0
testq %rax, %rax
je 0x3687
movq %rax, %rbx
movq (%r14), %rax
movq %rax, (%rbx)
jmp 0x3591
xorl %ebx, %ebx
cmpq %r15, %r12
je 0x3681
movl $0x100, %edi            # imm = 0x100
callq 0x21a0
movq %rax, (%rsp)
testq %rax, %rax
je 0x3691
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq %r14, (%rax)
movq %r14, %rax
addq $0x100, %rax            # imm = 0x100
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
cmpq %r15, %r12
je 0x36eb
movq (%r12), %r13
testq %r13, %r13
je 0x375b
movq 0x8(%r12), %rbp
testq %rbp, %rbp
je 0x377a
movq %r13, %rdi
callq 0x20d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x37d7
testl %eax, %eax
je 0x369e
movq %rbp, %rdi
callq 0x20d0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x37d7
testl %eax, %eax
je 0x369e
movq %r13, %rdi
callq 0x20c0
movq %rax, %r13
movq %rbp, %rdi
callq 0x20c0
movq %rax, %rbp
testq %r13, %r13
je 0x36a3
testq %rbp, %rbp
je 0x36a3
cmpq 0x8(%rsp), %r14
jne 0x3665
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x20e0
testl %eax, %eax
je 0x36a3
movq 0x10(%rsp), %r14
leaq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movq %r13, (%r14)
movq %rbp, 0x8(%r14)
addq $0x10, %r12
movq %rax, %r14
jmp 0x35cd
xorl %eax, %eax
xorl %ecx, %ecx
jmp 0x36f4
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %ebx, %ebx
jmp 0x3697
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %r13d, %r13d
xorl %ebp, %ebp
jmp 0x36c2
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%rsp), %r14
movq 0x10(%rsp), %r15
jmp 0x36c2
leaq -0x10(%r15), %r12
movq -0x10(%r15), %rdi
movq -0x8(%r15), %rbx
callq 0x2040
movq %r12, %r15
movq %rbx, %rdi
callq 0x2040
cmpq %r14, %r15
jne 0x36ae
movq %r14, %rdi
callq 0x2040
movq %r13, %rdi
callq 0x2040
movq %rbp, %rdi
callq 0x2040
xorl %eax, %eax
jmp 0x374c
movq (%rsp), %rcx
movq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
movq 0x40(%rsp), %rsi
movups %xmm0, (%rsi)
andq $0x0, 0x30(%rsi)
movups %xmm0, 0x20(%rsi)
movups %xmm0, 0x10(%rsi)
movl $0x3, (%rsi)
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x38(%rsi)
movq 0x30(%rsp), %rdx
movq %rdx, 0x48(%rsi)
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x50(%rsi)
movq 0x30(%rsp), %rdx
movq %rdx, 0x60(%rsi)
movq %rbx, 0x8(%rsi)
movq %rcx, 0x10(%rsi)
movq %rax, 0x18(%rsi)
movl 0x1c(%rsp), %eax
movl %eax, 0x20(%rsi)
pushq $0x1
popq %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12ed4(%rip), %rdi     # 0x16636
leaq 0x128d0(%rip), %rsi     # 0x16039
leaq 0x12ddf(%rip), %rcx     # 0x1654f
movl $0x2dc, %edx            # imm = 0x2DC
callq 0x2100
leaq 0x12ecb(%rip), %rdi     # 0x1664c
leaq 0x128b1(%rip), %rsi     # 0x16039
leaq 0x12dc0(%rip), %rcx     # 0x1654f
movl $0x2dd, %edx            # imm = 0x2DD
callq 0x2100
leaq 0x12d2c(%rip), %rdi     # 0x164cc
leaq 0x12892(%rip), %rsi     # 0x16039
leaq 0x12da1(%rip), %rcx     # 0x1654f
movl $0x2ca, %edx            # imm = 0x2CA
callq 0x2100
leaq 0x12e1a(%rip), %rdi     # 0x165d9
leaq 0x12873(%rip), %rsi     # 0x16039
leaq 0x12d82(%rip), %rcx     # 0x1654f
movl $0x2cc, %edx            # imm = 0x2CC
callq 0x2100