// File: /workspace/github_c_makefile_star2_O3/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 0x46a7
movq %rdx, %r12
testq %rdx, %rdx
je 0x46c6
movl %r8d, %ebp
movl %ecx, %r13d
movq %rdi, %rbx
testq %rsi, %rsi
leaq 0x134f1(%rip), %r15     # 0x17a70
cmovneq %rsi, %r15
movq %r15, %rdi
callq 0x20d0
movq %r15, %rdi
movq %rax, %rsi
callq 0x398c
xorl %r14d, %r14d
testl %eax, %eax
je 0x4688
movq %r15, %rdi
callq 0x2220
testq %rax, %rax
je 0x4688
movq %rax, %r15
movl %ebp, 0x4(%rsp)
testl %r13d, %r13d
jns 0x45c9
movq %r12, %rdi
callq 0x20d0
movq %rax, %r13
movslq %r13d, %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x398c
testl %eax, %eax
je 0x4680
leal 0x1(%r13), %eax
cmpl $0x1, %eax
adcl $0x1, %r13d
movslq %r13d, %rdi
callq 0x21a0
testq %rax, %rax
je 0x4680
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x2170
movb $0x0, (%r13,%rbp)
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rax
jne 0x4637
leaq 0x10(%rbx), %r12
leaq 0x8(%rbx), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x20e0
testl %eax, %eax
je 0x469a
movq (%r12), %rax
leaq 0x60(%rax), %rcx
movq %rcx, 0x10(%rbx)
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(%rbx), %rax
subq (%rbx), %rax
shrq $0x5, %rax
imull $0xaaaaaaab, %eax, %r14d # imm = 0xAAAAAAAB
jmp 0x4688
movq %r15, %rdi
callq 0x2040
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x2040
movq %r13, %rdi
jmp 0x4683
leaq 0x14240(%rip), %rdi     # 0x188ee
leaq 0x12984(%rip), %rsi     # 0x17039
leaq 0x1334c(%rip), %rcx     # 0x17a08
movl $0x4b6, %edx            # imm = 0x4B6
callq 0x2100
leaq 0x13092(%rip), %rdi     # 0x1775f
leaq 0x12965(%rip), %rsi     # 0x17039
leaq 0x1332d(%rip), %rcx     # 0x17a08
movl $0x4b7, %edx            # imm = 0x4B7
callq 0x2100