// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2120
movq $0x0, -0x50(%rbp)
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2120
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2120
cmpq $0x0, -0x10(%rbp)
je 0x45a0
jmp 0x45bf
leaq 0x26f5d(%rip), %rdi     # 0x2b504
leaq 0x26ac3(%rip), %rsi     # 0x2b071
movl $0x2ca, %edx            # imm = 0x2CA
leaq 0x26fcd(%rip), %rcx     # 0x2b587
callq 0x2100
cmpq $0x0, -0x20(%rbp)
je 0x45cd
cmpq $0x0, -0x28(%rbp)
jne 0x45d7
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x45d9
jmp 0x45f8
leaq 0x27031(%rip), %rdi     # 0x2b611
leaq 0x26a8a(%rip), %rsi     # 0x2b071
movl $0x2cc, %edx            # imm = 0x2CC
leaq 0x26f94(%rip), %rcx     # 0x2b587
callq 0x2100
cmpq $0x0, -0x18(%rbp)
je 0x4633
movl $0x8, %edi
callq 0x2080
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x4619
jmp 0x489d
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x4811
movl $0x100, %edi            # imm = 0x100
callq 0x2080
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
je 0x4673
movq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x68(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x60(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x4685
jmp 0x4680
movl $0x1, -0x30(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x4685
jmp 0x489d
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x480f
movq -0x80(%rbp), %rax
cmpq $0x0, (%rax)
je 0x46a7
jmp 0x46c6
leaq 0x26fc0(%rip), %rdi     # 0x2b66e
leaq 0x269bc(%rip), %rsi     # 0x2b071
movl $0x2dc, %edx            # imm = 0x2DC
leaq 0x26ec6(%rip), %rcx     # 0x2b587
callq 0x2100
movq -0x80(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x46d3
jmp 0x46f2
leaq 0x26faa(%rip), %rdi     # 0x2b684
leaq 0x26990(%rip), %rsi     # 0x2b071
movl $0x2dd, %edx            # imm = 0x2DD
leaq 0x26e9a(%rip), %rcx     # 0x2b587
callq 0x2100
movq -0x80(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rdi
callq 0x20d0
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x4940
cmpl $0x0, %eax
jne 0x4725
jmp 0x489d
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x20d0
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x4940
cmpl $0x0, %eax
jne 0x475a
jmp 0x489d
movq -0x80(%rbp), %rax
movq (%rax), %rdi
callq 0x20c0
movq %rax, -0x78(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x20c0
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x4789
cmpq $0x0, -0x70(%rbp)
jne 0x478e
jmp 0x489d
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jne 0x47b6
leaq -0x68(%rbp), %rdi
leaq -0x68(%rbp), %rsi
addq $0x10, %rsi
leaq -0x68(%rbp), %rdx
addq $0x8, %rdx
callq 0x20e0
cmpl $0x0, %eax
je 0x47dc
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, -0x58(%rbp)
movq -0x78(%rbp), %rcx
movq %rcx, (%rax)
movq -0x70(%rbp), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, %al
testb $0x1, %al
jne 0x47ee
jmp 0x47e9
movl $0x1, -0x30(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x47ee
jmp 0x489d
movq $0x0, -0x78(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x80(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x80(%rbp)
jmp 0x468d
jmp 0x4811
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x2120
movq -0x10(%rbp), %rax
movl $0x3, (%rax)
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x38(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x50(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x60(%rax)
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x4932
movq -0x50(%rbp), %rdi
callq 0x2140
movq -0x68(%rbp), %rax
cmpq -0x58(%rbp), %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x48b9
jmp 0x48f8
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $-0x10, %rcx
movq %rcx, -0x58(%rbp)
movq -0x10(%rax), %rcx
movq %rcx, -0x90(%rbp)
movq -0x8(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x90(%rbp), %rdi
callq 0x2140
movq -0x88(%rbp), %rdi
callq 0x2140
jmp 0x48a6
movq -0x68(%rbp), %rdi
callq 0x2140
movq $0x0, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x78(%rbp), %rdi
callq 0x2140
movq -0x70(%rbp), %rdi
callq 0x2140
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nop