// File: /workspace/github_c_makefile_star2_O0/mijallen[P]SimpleHTTPServer/lib/libyaml/src/emitter.c
// Function: yaml_emitter_select_scalar_style
static int
yaml_emitter_select_scalar_style(yaml_emitter_t *emitter, yaml_event_t *event)
{
    yaml_scalar_style_t style = event->data.scalar.style;
    int no_tag = (!emitter->tag_data.handle && !emitter->tag_data.suffix);

    if (no_tag && !event->data.scalar.plain_implicit
            && !event->data.scalar.quoted_implicit) {
        return yaml_emitter_set_emitter_error(emitter,
                "neither tag nor implicit flags are specified");
    }

    if (style == YAML_ANY_SCALAR_STYLE)
        style = YAML_PLAIN_SCALAR_STYLE;

    if (emitter->canonical)
        style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;

    if (emitter->simple_key_context && emitter->scalar_data.multiline)
        style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;

    if (style == YAML_PLAIN_SCALAR_STYLE)
    {
        if ((emitter->flow_level && !emitter->scalar_data.flow_plain_allowed)
                || (!emitter->flow_level && !emitter->scalar_data.block_plain_allowed))
            style = YAML_SINGLE_QUOTED_SCALAR_STYLE;
        if (!emitter->scalar_data.length
                && (emitter->flow_level || emitter->simple_key_context))
            style = YAML_SINGLE_QUOTED_SCALAR_STYLE;
        if (no_tag && !event->data.scalar.plain_implicit)
            style = YAML_SINGLE_QUOTED_SCALAR_STYLE;
    }

    if (style == YAML_SINGLE_QUOTED_SCALAR_STYLE)
    {
        if (!emitter->scalar_data.single_quoted_allowed)
            style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;
    }

    if (style == YAML_LITERAL_SCALAR_STYLE || style == YAML_FOLDED_SCALAR_STYLE)
    {
        if (!emitter->scalar_data.block_allowed
                || emitter->flow_level || emitter->simple_key_context)
            style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;
    }

    if (no_tag && !event->data.scalar.quoted_implicit
            && style != YAML_PLAIN_SCALAR_STYLE)
    {
        emitter->tag_data.handle = (yaml_char_t *)"!";
        emitter->tag_data.handle_length = 1;
    }

    emitter->scalar_data.style = style;

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x148(%rcx)
movb %al, -0x21(%rbp)
jne 0x22721
movq -0x10(%rbp), %rax
cmpq $0x0, 0x158(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x2275e
movq -0x18(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jne 0x2275e
movq -0x18(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
jne 0x2275e
movq -0x10(%rbp), %rdi
leaq 0xa743(%rip), %rsi      # 0x2ce94
callq 0x20b90
movl %eax, -0x4(%rbp)
jmp 0x228cd
cmpl $0x0, -0x1c(%rbp)
jne 0x2276b
movl $0x1, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
je 0x2277c
movl $0x3, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x114(%rax)
je 0x2279d
movq -0x10(%rbp), %rax
cmpl $0x0, 0x178(%rax)
je 0x2279d
movl $0x3, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0x2282a
movq -0x10(%rbp), %rax
cmpl $0x0, 0x104(%rax)
je 0x227c1
movq -0x10(%rbp), %rax
cmpl $0x0, 0x17c(%rax)
je 0x227db
movq -0x10(%rbp), %rax
cmpl $0x0, 0x104(%rax)
jne 0x227e2
movq -0x10(%rbp), %rax
cmpl $0x0, 0x180(%rax)
jne 0x227e2
movl $0x2, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x170(%rax)
jne 0x22811
movq -0x10(%rbp), %rax
cmpl $0x0, 0x104(%rax)
jne 0x2280a
movq -0x10(%rbp), %rax
cmpl $0x0, 0x114(%rax)
je 0x22811
movl $0x2, -0x1c(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x22828
movq -0x18(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jne 0x22828
movl $0x2, -0x1c(%rbp)
jmp 0x2282a
cmpl $0x2, -0x1c(%rbp)
jne 0x22846
movq -0x10(%rbp), %rax
cmpl $0x0, 0x184(%rax)
jne 0x22844
movl $0x3, -0x1c(%rbp)
jmp 0x22846
cmpl $0x4, -0x1c(%rbp)
je 0x22852
cmpl $0x5, -0x1c(%rbp)
jne 0x22882
movq -0x10(%rbp), %rax
cmpl $0x0, 0x188(%rax)
je 0x22879
movq -0x10(%rbp), %rax
cmpl $0x0, 0x104(%rax)
jne 0x22879
movq -0x10(%rbp), %rax
cmpl $0x0, 0x114(%rax)
je 0x22880
movl $0x3, -0x1c(%rbp)
jmp 0x22882
cmpl $0x0, -0x20(%rbp)
je 0x228b9
movq -0x18(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
jne 0x228b9
cmpl $0x1, -0x1c(%rbp)
je 0x228b9
movq -0x10(%rbp), %rax
leaq 0xa00e(%rip), %rcx      # 0x2c8b1
movq %rcx, 0x148(%rax)
movq -0x10(%rbp), %rax
movq $0x1, 0x150(%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18c(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)