// File: /workspace/github_c_makefile_star2_O2/mijallen[P]SimpleHTTPServer/lib/libyaml/src/api.c
// Function: yaml_document_add_scalar
YAML_DECLARE(int)
yaml_document_add_scalar(yaml_document_t *document,
        yaml_char_t *tag, yaml_char_t *value, int length,
        yaml_scalar_style_t style)
{
    struct {
        yaml_error_type_t error;
    } context;
    yaml_mark_t mark = { 0, 0, 0 };
    yaml_char_t *tag_copy = NULL;
    yaml_char_t *value_copy = NULL;
    yaml_node_t node;

    assert(document);   /* Non-NULL document object is expected. */
    assert(value);      /* Non-NULL value is expected. */

    if (!tag) {
        tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG;
    }

    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;
    tag_copy = yaml_strdup(tag);
    if (!tag_copy) goto error;

    if (length < 0) {
        length = strlen((char *)value);
    }

    if (!yaml_check_utf8(value, length)) goto error;
    value_copy = yaml_malloc(length+1);
    if (!value_copy) goto error;
    memcpy(value_copy, value, length);
    value_copy[length] = '\0';

    SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark);
    if (!PUSH(&context, document->nodes, node)) goto error;

    return document->nodes.top - document->nodes.start;

error:
    yaml_free(tag_copy);
    yaml_free(value_copy);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x43d2
movq %rdx, %r12
testq %rdx, %rdx
je 0x43f1
movl %r8d, %ebp
movl %ecx, %r13d
movq %rdi, %r14
testq %rsi, %rsi
leaq 0x127bd(%rip), %r15     # 0x16a70
cmovneq %rsi, %r15
movq %r15, %rdi
callq 0x20d0
movq %r15, %rdi
movq %rax, %rsi
callq 0x37d7
xorl %ebx, %ebx
testl %eax, %eax
je 0x43ab
movq %r15, %rdi
callq 0x2230
testq %rax, %rax
je 0x43ab
movq %rax, %r15
movl %ebp, 0x4(%rsp)
testl %r13d, %r13d
jns 0x42fc
movq %r12, %rdi
callq 0x20d0
movq %rax, %r13
movslq %r13d, %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x37d7
testl %eax, %eax
je 0x43ae
incl %r13d
movslq %r13d, %rdi
callq 0x2080
testq %rax, %rax
je 0x43ae
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x2170
movb $0x0, (%r13,%rbp)
movq 0x10(%r14), %rax
cmpq 0x8(%r14), %rax
jne 0x4362
leaq 0x10(%r14), %r12
leaq 0x8(%r14), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x20e0
testl %eax, %eax
je 0x43b1
movq (%r12), %rax
leaq 0x60(%rax), %rcx
movq %rcx, 0x10(%r14)
movq $0x1, (%rax)
movq %r15, 0x8(%rax)
movq %r13, 0x10(%rax)
movq %rbp, 0x18(%rax)
movl 0x4(%rsp), %ecx
movl %ecx, 0x20(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x24(%rax)
movups %xmm0, 0x34(%rax)
movups %xmm0, 0x44(%rax)
movups %xmm0, 0x50(%rax)
movq 0x10(%r14), %rax
subq (%r14), %rax
pushq $0x60
popq %rcx
cqto
idivq %rcx
movq %rax, %rbx
jmp 0x43c1
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x2040
movq %r13, %rdi
callq 0x2040
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13505(%rip), %rdi     # 0x178de
leaq 0x11c59(%rip), %rsi     # 0x16039
leaq 0x12621(%rip), %rcx     # 0x16a08
movl $0x4b6, %edx            # imm = 0x4B6
callq 0x2100
leaq 0x12367(%rip), %rdi     # 0x1675f
leaq 0x11c3a(%rip), %rsi     # 0x16039
leaq 0x12602(%rip), %rcx     # 0x16a08
movl $0x4b7, %edx            # imm = 0x4B7
callq 0x2100