// File: /workspace/github_c_makefile_star2_O1/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 0x4685
movq %rdx, %r15
testq %rdx, %rdx
je 0x46a4
movl %r8d, %ebp
movl %ecx, %r12d
movq %rdi, %rbx
testq %rsi, %rsi
leaq 0x1450c(%rip), %r14     # 0x18a70
cmovneq %rsi, %r14
movq %r14, %rdi
callq 0x20d0
movq %r14, %rdi
movq %rax, %rsi
callq 0x391b
testl %eax, %eax
je 0x4652
movq %r14, %rdi
callq 0x2220
testq %rax, %rax
je 0x4652
movq %rax, %r14
testl %r12d, %r12d
jns 0x45a7
movq %r15, %rdi
callq 0x20d0
movq %rax, %r12
movslq %r12d, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x391b
testl %eax, %eax
je 0x4655
leal 0x1(%r12), %eax
cmpl $0x1, %eax
adcl $0x1, %r12d
movslq %r12d, %rdi
callq 0x21a0
testq %rax, %rax
je 0x4655
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2170
movb $0x0, (%r12,%r13)
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rax
jne 0x460a
leaq 0x10(%rbx), %rsi
leaq 0x8(%rbx), %rdx
movq %rbx, %rdi
callq 0x20e0
testl %eax, %eax
je 0x4658
movq 0x10(%rbx), %rax
leaq 0x60(%rax), %rcx
movq %rcx, 0x10(%rbx)
movq $0x1, (%rax)
movq %r14, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r13, 0x18(%rax)
movl %ebp, 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, %ebx # imm = 0xAAAAAAAB
jmp 0x4674
xorl %r14d, %r14d
xorl %r12d, %r12d
testq %r14, %r14
je 0x4665
movq %r14, %rdi
callq 0x2040
xorl %ebx, %ebx
testq %r12, %r12
je 0x4674
movq %r12, %rdi
callq 0x2040
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x151e6(%rip), %rdi     # 0x19872
leaq 0x139a6(%rip), %rsi     # 0x18039
leaq 0x1436e(%rip), %rcx     # 0x18a08
movl $0x4b6, %edx            # imm = 0x4B6
callq 0x2100
leaq 0x140b4(%rip), %rdi     # 0x1875f
leaq 0x13987(%rip), %rsi     # 0x18039
leaq 0x1434f(%rip), %rcx     # 0x18a08
movl $0x4b7, %edx            # imm = 0x4B7
callq 0x2100