// File: /workspace/github_c_makefile_star2_O1/mijallen[P]SimpleHTTPServer/lib/libyaml/src/api.c
// Function: yaml_document_initialize
YAML_DECLARE(int)
yaml_document_initialize(yaml_document_t *document,
        yaml_version_directive_t *version_directive,
        yaml_tag_directive_t *tag_directives_start,
        yaml_tag_directive_t *tag_directives_end,
        int start_implicit, int end_implicit)
{
    struct {
        yaml_error_type_t error;
    } context;
    struct {
        yaml_node_t *start;
        yaml_node_t *end;
        yaml_node_t *top;
    } nodes = { NULL, NULL, NULL };
    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 };
    yaml_mark_t mark = { 0, 0, 0 };

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

    if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error;

    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_INIT(*document, nodes.start, nodes.end, version_directive_copy,
            tag_directives_copy.start, tag_directives_copy.top,
            start_implicit, end_implicit, mark, mark);

    return 1;

error:
    STACK_DEL(&context, nodes);
    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 0x4316
movl %r9d, %ebp
movl %r8d, %r15d
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
setne %al
testq %rcx, %rcx
setne %cl
cmpq %r12, %rdx
je 0x404c
andb %cl, %al
je 0x4335
movl $0x600, %edi            # imm = 0x600
callq 0x21a0
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x408d
testq %rbx, %rbx
je 0x40a4
movl $0x8, %edi
callq 0x21a0
testq %rax, %rax
je 0x408d
movl %r15d, (%rsp)
movl %ebp, 0x4(%rsp)
movl (%rbx), %ecx
movl %ecx, (%rax)
movl 0x4(%rbx), %edx
movq %rax, 0x10(%rsp)
movl %edx, 0x4(%rax)
jmp 0x40b5
xorl %r12d, %r12d
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x8(%rsp), %rdi
jmp 0x428c
movl %r15d, (%rsp)
movl %ebp, 0x4(%rsp)
movq $0x0, 0x10(%rsp)
cmpq %r12, %r13
je 0x41d0
movq %r12, 0x20(%rsp)
movl $0x100, %edi            # imm = 0x100
callq 0x21a0
movq %rax, %r12
testq %rax, %rax
je 0x41dc
cmpq 0x20(%rsp), %r13
je 0x41e7
movq %r12, %rax
addq $0x100, %rax            # imm = 0x100
movq %r12, %rbx
movq %r14, 0x18(%rsp)
movq (%r13), %rbp
testq %rbp, %rbp
je 0x4373
movq %rax, 0x28(%rsp)
movq 0x8(%r13), %r15
testq %r15, %r15
je 0x4354
movq %rbp, %rdi
callq 0x20d0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x391b
testl %eax, %eax
je 0x41de
movq %r15, %rdi
callq 0x20d0
movq %r15, %rdi
movq %rax, %rsi
callq 0x391b
testl %eax, %eax
je 0x41de
movq %rbp, %rdi
callq 0x2220
movq %rax, %rbp
movq %r15, %rdi
callq 0x2220
movq %rax, %r15
testq %rbp, %rbp
je 0x41e3
testq %r15, %r15
je 0x41e3
movq 0x28(%rsp), %rax
cmpq %rax, %rbx
jne 0x41b2
movq %rax, %r14
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 0x28(%rsp), %rax
cmovneq %rdx, %rax
cmovneq %rcx, %rbx
je 0x430a
movq 0x18(%rsp), %r14
movq %rbp, (%rbx)
movq %r15, 0x8(%rbx)
addq $0x10, %rbx
addq $0x10, %r13
cmpq 0x20(%rsp), %r13
jne 0x40f5
xorl %ebp, %ebp
jmp 0x41ec
xorl %r12d, %r12d
xorl %ebx, %ebx
movq 0x8(%rsp), %rdi
jmp 0x41fe
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %eax, %eax
jmp 0x41f1
xorl %ebp, %ebp
movq %r12, %rbx
xorl %r15d, %r15d
movb $0x1, %al
testb %al, %al
movq 0x8(%rsp), %rdi
je 0x4287
movq %rdi, %rax
addq $0x600, %rax            # imm = 0x600
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x50(%r14)
movups %xmm0, 0x40(%r14)
movq $0x0, 0x60(%r14)
movq %rdi, (%r14)
movq %rax, 0x8(%r14)
movq %rdi, 0x10(%r14)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%r14)
movq %r12, 0x20(%r14)
movq %rbx, 0x28(%r14)
movl (%rsp), %eax
movl %eax, 0x30(%r14)
movl 0x4(%rsp), %eax
movl %eax, 0x34(%r14)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x38(%r14)
movq 0x40(%rsp), %rax
movq %rax, 0x48(%r14)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x50(%r14)
movq 0x40(%rsp), %rax
movq %rax, 0x60(%r14)
movl $0x1, %ebx
jmp 0x42f9
movq 0x10(%rsp), %r14
testq %rdi, %rdi
je 0x4296
callq 0x2040
testq %r14, %r14
je 0x42a3
movq %r14, %rdi
callq 0x2040
cmpq %rbx, %r12
je 0x42d0
movq -0x10(%rbx), %rdi
movq -0x8(%rbx), %r14
testq %rdi, %rdi
je 0x42ba
callq 0x2040
testq %r14, %r14
je 0x42c7
movq %r14, %rdi
callq 0x2040
addq $-0x10, %rbx
cmpq %r12, %rbx
jne 0x42a8
testq %r12, %r12
je 0x42dd
movq %r12, %rdi
callq 0x2040
testq %rbp, %rbp
je 0x42ea
movq %rbp, %rdi
callq 0x2040
xorl %ebx, %ebx
testq %r15, %r15
je 0x42f9
movq %r15, %rdi
callq 0x2040
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
movq 0x18(%rsp), %r14
jmp 0x41f1
leaq 0x15555(%rip), %rdi     # 0x19872
leaq 0x13d15(%rip), %rsi     # 0x18039
leaq 0x145b2(%rip), %rcx     # 0x188dd
movl $0x41d, %edx            # imm = 0x41D
callq 0x2100
leaq 0x1429d(%rip), %rdi     # 0x185d9
leaq 0x13cf6(%rip), %rsi     # 0x18039
leaq 0x14593(%rip), %rcx     # 0x188dd
movl $0x41f, %edx            # imm = 0x41F
callq 0x2100
leaq 0x142f1(%rip), %rdi     # 0x1864c
leaq 0x13cd7(%rip), %rsi     # 0x18039
leaq 0x14574(%rip), %rcx     # 0x188dd
movl $0x432, %edx            # imm = 0x432
callq 0x2100
leaq 0x142bc(%rip), %rdi     # 0x18636
leaq 0x13cb8(%rip), %rsi     # 0x18039
leaq 0x14555(%rip), %rcx     # 0x188dd
movl $0x431, %edx            # imm = 0x431
callq 0x2100