// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2120
movq $0x0, -0x58(%rbp)
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2120
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2120
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2120
cmpq $0x0, -0x10(%rbp)
je 0x54e7
jmp 0x5506
leaq 0x27410(%rip), %rdi     # 0x2c8fe
leaq 0x25b7c(%rip), %rsi     # 0x2b071
movl $0x41d, %edx            # imm = 0x41D
leaq 0x26414(%rip), %rcx     # 0x2b915
callq 0x2100
cmpq $0x0, -0x20(%rbp)
je 0x5514
cmpq $0x0, -0x28(%rbp)
jne 0x551e
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x5520
jmp 0x553f
leaq 0x260ea(%rip), %rdi     # 0x2b611
leaq 0x25b43(%rip), %rsi     # 0x2b071
movl $0x41f, %edx            # imm = 0x41F
leaq 0x263db(%rip), %rcx     # 0x2b915
callq 0x2100
movl $0x600, %edi            # imm = 0x600
callq 0x2080
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x5571
movq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
addq $0x600, %rax            # imm = 0x600
movq %rax, -0x48(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x5583
jmp 0x557e
movl $0x1, -0x34(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x5583
jmp 0x5881
cmpq $0x0, -0x18(%rbp)
je 0x55be
movl $0x8, %edi
callq 0x2080
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x55a4
jmp 0x5881
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x58(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x57c0
movl $0x100, %edi            # imm = 0x100
callq 0x2080
movq %rax, -0x70(%rbp)
cmpq $0x0, %rax
je 0x55fe
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x70(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x68(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x5610
jmp 0x560b
movl $0x1, -0x34(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x5610
jmp 0x5881
movq -0x20(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x57be
movq -0xa0(%rbp), %rax
cmpq $0x0, (%rax)
je 0x563b
jmp 0x565a
leaq 0x2602c(%rip), %rdi     # 0x2b66e
leaq 0x25a28(%rip), %rsi     # 0x2b071
movl $0x431, %edx            # imm = 0x431
leaq 0x262c0(%rip), %rcx     # 0x2b915
callq 0x2100
movq -0xa0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x566a
jmp 0x5689
leaq 0x26013(%rip), %rdi     # 0x2b684
leaq 0x259f9(%rip), %rsi     # 0x2b071
movl $0x432, %edx            # imm = 0x432
leaq 0x26291(%rip), %rcx     # 0x2b915
callq 0x2100
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
movq -0xa0(%rbp), %rax
movq (%rax), %rdi
callq 0x20d0
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
callq 0x4940
cmpl $0x0, %eax
jne 0x56c2
jmp 0x5881
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x20d0
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x4940
cmpl $0x0, %eax
jne 0x56fd
jmp 0x5881
movq -0xa0(%rbp), %rax
movq (%rax), %rdi
callq 0x20c0
movq %rax, -0x80(%rbp)
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x20c0
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x80(%rbp)
je 0x5732
cmpq $0x0, -0x78(%rbp)
jne 0x5737
jmp 0x5881
movq -0x60(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x575f
leaq -0x70(%rbp), %rdi
leaq -0x70(%rbp), %rsi
addq $0x10, %rsi
leaq -0x70(%rbp), %rdx
addq $0x8, %rdx
callq 0x20e0
cmpl $0x0, %eax
je 0x5785
movq -0x60(%rbp), %rax
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, -0x60(%rbp)
movq -0x80(%rbp), %rcx
movq %rcx, (%rax)
movq -0x78(%rbp), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, %al
testb $0x1, %al
jne 0x5797
jmp 0x5792
movl $0x1, -0x34(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x5797
jmp 0x5881
movq $0x0, -0x80(%rbp)
movq $0x0, -0x78(%rbp)
movq -0xa0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xa0(%rbp)
jmp 0x561b
jmp 0x57c0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x2120
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x70(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x60(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
movl -0x30(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x10(%rbp), %rax
movq -0x98(%rbp), %rcx
movq %rcx, 0x38(%rax)
movq -0x90(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq -0x88(%rbp), %rcx
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq -0x98(%rbp), %rcx
movq %rcx, 0x50(%rax)
movq -0x90(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq -0x88(%rbp), %rcx
movq %rcx, 0x60(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5937
movq -0x50(%rbp), %rdi
callq 0x2140
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2140
movq -0x70(%rbp), %rax
cmpq -0x60(%rbp), %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x58be
jmp 0x58fd
movq -0x60(%rbp), %rax
movq %rax, %rcx
addq $-0x10, %rcx
movq %rcx, -0x60(%rbp)
movq -0x10(%rax), %rcx
movq %rcx, -0xb0(%rbp)
movq -0x8(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x2140
movq -0xa8(%rbp), %rdi
callq 0x2140
jmp 0x58ab
movq -0x70(%rbp), %rdi
callq 0x2140
movq $0x0, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x80(%rbp), %rdi
callq 0x2140
movq -0x78(%rbp), %rdi
callq 0x2140
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)