// File: /workspace/github_c_makefile_star2_O0/mijallen[P]SimpleHTTPServer/lib/libyaml/src/emitter.c
// Function: yaml_emitter_analyze_tag
static int
yaml_emitter_analyze_tag(yaml_emitter_t *emitter,
        yaml_char_t *tag)
{
    size_t tag_length;
    yaml_string_t string;
    yaml_tag_directive_t *tag_directive;

    tag_length = strlen((char *)tag);
    STRING_ASSIGN(string, tag, tag_length);

    if (string.start == string.end) {
        return yaml_emitter_set_emitter_error(emitter,
                "tag value must not be empty");
    }

    for (tag_directive = emitter->tag_directives.start;
            tag_directive != emitter->tag_directives.top; tag_directive ++) {
        size_t prefix_length = strlen((char *)tag_directive->prefix);
        if (prefix_length < (size_t)(string.end - string.start)
                && strncmp((char *)tag_directive->prefix, (char *)string.start,
                    prefix_length) == 0)
        {
            emitter->tag_data.handle = tag_directive->handle;
            emitter->tag_data.handle_length =
                strlen((char *)tag_directive->handle);
            emitter->tag_data.suffix = string.start + prefix_length;
            emitter->tag_data.suffix_length =
                (string.end - string.start) - prefix_length;
            return 1;
        }
    }

    emitter->tag_data.suffix = string.start;
    emitter->tag_data.suffix_length = string.end - string.start;

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20d0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0x2794b
movq -0x10(%rbp), %rdi
leaq 0x565c(%rip), %rsi      # 0x2cf9a
callq 0x20b90
movl %eax, -0x4(%rbp)
jmp 0x27a4f
movq -0x10(%rbp), %rax
movq 0xe8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0xf8(%rcx), %rax
je 0x27a23
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x20d0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jae 0x27a10
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x2050
cmpl $0x0, %eax
jne 0x27a10
movq -0x40(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x148(%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rdi
callq 0x20d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x150(%rax)
movq -0x38(%rbp), %rcx
addq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x158(%rax)
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
subq %rax, %rcx
subq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x160(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x27a4f
jmp 0x27a12
movq -0x40(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x40(%rbp)
jmp 0x2795a
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x158(%rax)
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
subq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x160(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)