// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2120
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x5c87
jmp 0x5ca6
leaq 0x26c70(%rip), %rdi     # 0x2c8fe
leaq 0x253dc(%rip), %rsi     # 0x2b071
movl $0x4b6, %edx            # imm = 0x4B6
leaq 0x25d9f(%rip), %rcx     # 0x2ba40
callq 0x2100
cmpq $0x0, -0x20(%rbp)
je 0x5caf
jmp 0x5cce
leaq 0x25ae1(%rip), %rdi     # 0x2b797
leaq 0x253b4(%rip), %rsi     # 0x2b071
movl $0x4b7, %edx            # imm = 0x4B7
leaq 0x25d77(%rip), %rcx     # 0x2ba40
callq 0x2100
cmpq $0x0, -0x18(%rbp)
jne 0x5ce0
leaq 0x25dcc(%rip), %rax     # 0x2baa8
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20d0
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x4940
cmpl $0x0, %eax
jne 0x5d0d
jmp 0x5e90
movq -0x18(%rbp), %rdi
callq 0x20c0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x5d26
jmp 0x5e90
cmpl $0x0, -0x24(%rbp)
jge 0x5d38
movq -0x20(%rbp), %rdi
callq 0x20d0
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rsi
callq 0x4940
cmpl $0x0, %eax
jne 0x5d4f
jmp 0x5e90
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x2080
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x5d6d
jmp 0x5e90
movq -0x58(%rbp), %rdi
movq -0x20(%rbp), %rsi
movslq -0x24(%rbp), %rdx
callq 0x2180
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
leaq -0xb8(%rbp), %rdi
xorl %esi, %esi
movl $0x60, %edx
callq 0x2120
movl $0x1, -0xb8(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xa8(%rbp)
movslq -0x24(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x5e34
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
callq 0x20e0
cmpl $0x0, %eax
je 0x5e60
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq %rdi, %rcx
addq $0x60, %rcx
movq %rcx, 0x10(%rax)
leaq -0xb8(%rbp), %rsi
movl $0x60, %edx
callq 0x2180
movb $0x1, %al
testb $0x1, %al
jne 0x5e6f
jmp 0x5e6d
movl $0x1, -0x2c(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x5e6f
jmp 0x5e90
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movl $0x60, %ecx
cqto
idivq %rcx
movl %eax, -0x4(%rbp)
jmp 0x5ea9
movq -0x50(%rbp), %rdi
callq 0x2140
movq -0x58(%rbp), %rdi
callq 0x2140
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)