// File: /workspace/github_c_makefile_star2_O3/mijallen[P]SimpleHTTPServer/lib/libyaml/src/scanner.c
// Function: yaml_parser_scan_tag_uri
static int
yaml_parser_scan_tag_uri(yaml_parser_t *parser, int directive,
        yaml_char_t *head, yaml_mark_t start_mark, yaml_char_t **uri)
{
    size_t length = head ? strlen((char *)head) : 0;
    yaml_string_t string = NULL_STRING;

    if (!STRING_INIT(parser, string, INITIAL_STRING_SIZE)) goto error;

    /* Resize the string to include the head. */

    while ((size_t)(string.end - string.start) <= length) {
        if (!yaml_string_extend(&string.start, &string.pointer, &string.end)) {
            parser->error = YAML_MEMORY_ERROR;
            goto error;
        }
    }

    /*
     * Copy the head if needed.
     *
     * Note that we don't copy the leading '!' character.
     */

    if (length > 1) {
        memcpy(string.start, head+1, length-1);
        string.pointer += length-1;
    }

    /* Scan the tag. */

    if (!CACHE(parser, 1)) goto error;

    /*
     * The set of characters that may appear in URI is as follows:
     *
     *      '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&',
     *      '=', '+', '$', ',', '.', '!', '~', '*', '\'', '(', ')', '[', ']',
     *      '%'.
     */

    while (IS_ALPHA(parser->buffer) || CHECK(parser->buffer, ';')
            || CHECK(parser->buffer, '/') || CHECK(parser->buffer, '?')
            || CHECK(parser->buffer, ':') || CHECK(parser->buffer, '@')
            || CHECK(parser->buffer, '&') || CHECK(parser->buffer, '=')
            || CHECK(parser->buffer, '+') || CHECK(parser->buffer, '$')
            || CHECK(parser->buffer, ',') || CHECK(parser->buffer, '.')
            || CHECK(parser->buffer, '!') || CHECK(parser->buffer, '~')
            || CHECK(parser->buffer, '*') || CHECK(parser->buffer, '\'')
            || CHECK(parser->buffer, '(') || CHECK(parser->buffer, ')')
            || CHECK(parser->buffer, '[') || CHECK(parser->buffer, ']')
            || CHECK(parser->buffer, '%'))
    {
        /* Check if it is a URI-escape sequence. */

        if (CHECK(parser->buffer, '%')) {
            if (!STRING_EXTEND(parser, string))
                goto error;

            if (!yaml_parser_scan_uri_escapes(parser,
                        directive, start_mark, &string)) goto error;
        }
        else {
            if (!READ(parser, string)) goto error;
        }

        length ++;
        if (!CACHE(parser, 1)) goto error;
    }

    /* Check if the tag is non-empty. */

    if (!length) {
        if (!STRING_EXTEND(parser, string))
            goto error;

        yaml_parser_set_scanner_error(parser, directive ?
                "while parsing a %TAG directive" : "while parsing a tag",
                start_mark, "did not find expected tag URI");
        goto error;
    }

    *uri = string.start;

    return 1;

error:
    STRING_DEL(parser, string);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r12
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
testq %rdx, %rdx
je 0xc71a
movq %r14, %rdi
callq 0x20d0
movq %rax, %r15
jmp 0xc71d
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl $0x10, %edi
callq 0x2080
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xc78a
movq %r12, 0x30(%rsp)
movl %ebp, 0x24(%rsp)
leaq 0x18(%rsp), %r12
movq %rax, (%r12)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x10(%rsp), %r13
movq %rcx, (%r13)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x8(%rsp), %rbp
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
subq %rdi, %rax
cmpq %r15, %rax
ja 0xc7ab
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20a0
testl %eax, %eax
jne 0xc766
movl $0x1, (%rbx)
movq 0x8(%rsp), %rdi
callq 0x2140
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x2, %r15
jb 0xc7c8
incq %r14
leaq -0x1(%r15), %rbp
movq %r14, %rsi
movq %rbp, %rdx
callq 0x2170
addq %rbp, 0x18(%rsp)
cmpq $0x0, 0xa8(%rbx)
jne 0xc7e3
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2060
testl %eax, %eax
je 0xc790
leaq 0xe0(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0x8(%rsp), %r14
movq 0x98(%rbx), %rax
movb (%rax), %cl
leal -0x30(%rcx), %edx
cmpb $0xa, %dl
jb 0xc835
movl %ecx, %edx
andb $-0x21, %dl
addb $-0x41, %dl
cmpb $0x1a, %dl
jb 0xc835
movzbl %cl, %edx
leal -0x21(%rdx), %esi
cmpl $0x3e, %esi
ja 0xcc5a
movabsq $0x54000000d6007fe9, %rdi # imm = 0x54000000D6007FE9
btq %rsi, %rdi
jae 0xc966
movq 0x18(%rsp), %rdx
addq $0x5, %rdx
cmpq 0x10(%rsp), %rdx
jb 0xc864
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20a0
testl %eax, %eax
je 0xc78a
movq 0x98(%rbx), %rax
movb (%rax), %cl
testb %cl, %cl
jns 0xc904
movzbl %cl, %ecx
movl %ecx, %edx
andl $-0x20, %edx
cmpl $0xc0, %edx
je 0xc8e0
movl %ecx, %edx
andl $-0x10, %edx
cmpl $0xe0, %edx
je 0xc8bc
andl $-0x8, %ecx
cmpl $0xf0, %ecx
jne 0xc921
leaq 0x1(%rax), %rcx
movq %rcx, 0x98(%rbx)
movb (%rax), %al
movq 0x18(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x18(%rsp)
movb %al, (%rcx)
movq 0x98(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x98(%rbx)
movb (%rax), %al
movq 0x18(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x18(%rsp)
movb %al, (%rcx)
movq 0x98(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x98(%rbx)
movb (%rax), %al
movq 0x18(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x18(%rsp)
movb %al, (%rcx)
movq 0x98(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x98(%rbx)
movb (%rax), %al
movq 0x18(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x18(%rsp)
movb %al, (%rcx)
incq 0xe0(%rbx)
incq 0xf0(%rbx)
movq 0xa8(%rbx), %rax
decq %rax
movq %rax, 0xa8(%rbx)
incq %r15
testq %rax, %rax
jne 0xc7f4
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2060
testl %eax, %eax
jne 0xc7f4
jmp 0xc790
cmpq $0x4, %rsi
jne 0xcc5a
movq 0x18(%rsp), %rax
addq $0x5, %rax
cmpq 0x10(%rsp), %rax
jb 0xc996
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20a0
testl %eax, %eax
je 0xc78a
movq 0xa8(%rbx), %rax
xorl %ebp, %ebp
cmpq $0x2, %rax
ja 0xc9ba
movl $0x3, %esi
movq %rbx, %rdi
callq 0x2060
testl %eax, %eax
je 0xc790
movq 0x98(%rbx), %rcx
cmpb $0x25, (%rcx)
jne 0xcc7f
movb 0x1(%rcx), %al
leal -0x30(%rax), %edx
cmpb $0xa, %dl
jb 0xc9f8
movzbl %al, %edx
addl $-0x41, %edx
cmpl $0x25, %edx
ja 0xcc7f
movabsq $0x3f0000003f, %rsi     # imm = 0x3F0000003F
btq %rdx, %rsi
jae 0xcc7f
movb 0x2(%rcx), %cl
leal -0x30(%rcx), %edx
cmpb $0xa, %dl
jb 0xca26
movzbl %cl, %esi
addl $-0x41, %esi
cmpl $0x25, %esi
ja 0xcc7f
movabsq $0x3f0000003f, %rdi     # imm = 0x3F0000003F
btq %rsi, %rdi
jae 0xcc7f
leal -0x41(%rax), %esi
movl %eax, %edi
shlb $0x4, %dil
leal -0x70(%rdi), %r8d
cmpb $0x6, %sil
movzbl %dil, %esi
movzbl %r8b, %edi
cmovbl %edi, %esi
cmpb $0x61, %al
cmovael %edi, %esi
leal -0x41(%rcx), %eax
leal -0x37(%rcx), %edi
leal -0x57(%rcx), %r8d
cmpb $0x61, %cl
movzbl %dl, %ecx
movzbl %r8b, %edx
cmovbl %ecx, %edx
cmpb $0x6, %al
movzbl %dil, %eax
cmovael %edx, %eax
addb %sil, %al
testl %ebp, %ebp
je 0xca7c
movl %eax, %ecx
andb $-0x40, %cl
negb %cl
jo 0xcac0
jmp 0xcc88
movl $0x1, %ebp
testb %al, %al
jns 0xcac0
movzbl %al, %ecx
movl %ecx, %edx
andl $-0x20, %edx
movl $0x2, %ebp
cmpl $0xc0, %edx
je 0xcac0
movl %ecx, %edx
andl $-0x10, %edx
movl $0x3, %ebp
cmpl $0xe0, %edx
je 0xcac0
andl $-0x8, %ecx
movl $0x4, %ebp
cmpl $0xf0, %ecx
jne 0xcd4e
movq 0x18(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x18(%rsp)
movb %al, (%rcx)
movq 0xe0(%rbx), %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0xe0(%rbx)
movq 0xf0(%rbx), %rdx
leaq 0x1(%rdx), %rax
movq %rax, 0xf0(%rbx)
movq 0x98(%rbx), %r8
movq 0xa8(%rbx), %rax
leaq -0x1(%rax), %rsi
movq %rsi, 0xa8(%rbx)
movzbl (%r8), %edi
movl $0x1, %esi
movl $0x1, %r9d
testb %dil, %dil
jns 0xcb61
movl %edi, %r10d
andl $-0x20, %r10d
movl $0x2, %r9d
cmpl $0xc0, %r10d
je 0xcb61
movl %edi, %r10d
andl $-0x10, %r10d
movl $0x3, %r9d
cmpl $0xe0, %r10d
je 0xcb61
andl $-0x8, %edi
xorl %r9d, %r9d
cmpl $0xf0, %edi
sete %r9b
shll $0x2, %r9d
leaq (%r8,%r9), %rdi
movq %rdi, 0x98(%rbx)
leaq 0x2(%rcx), %r10
movq %r10, 0xe0(%rbx)
leaq 0x2(%rdx), %r10
movq %r10, 0xf0(%rbx)
leaq -0x2(%rax), %r10
movq %r10, 0xa8(%rbx)
movzbl (%r8,%r9), %r8d
testb %r8b, %r8b
jns 0xcbd5
movl %r8d, %r9d
andl $-0x20, %r9d
movl $0x2, %esi
cmpl $0xc0, %r9d
je 0xcbd5
movl %r8d, %r9d
andl $-0x10, %r9d
movl $0x3, %esi
cmpl $0xe0, %r9d
je 0xcbd5
andl $-0x8, %r8d
xorl %esi, %esi
cmpl $0xf0, %r8d
sete %sil
shll $0x2, %esi
leaq (%rdi,%rsi), %r8
movq %r8, 0x98(%rbx)
addq $0x3, %rcx
movq %rcx, 0xe0(%rbx)
addq $0x3, %rdx
movq %rdx, 0xf0(%rbx)
addq $-0x3, %rax
movq %rax, 0xa8(%rbx)
movzbl (%rdi,%rsi), %ecx
movl $0x1, %edx
testb %cl, %cl
jns 0xcc43
movl %ecx, %esi
andl $-0x20, %esi
movl $0x2, %edx
cmpl $0xc0, %esi
je 0xcc43
movl %ecx, %esi
andl $-0x10, %esi
movl $0x3, %edx
cmpl $0xe0, %esi
je 0xcc43
andl $-0x8, %ecx
xorl %edx, %edx
cmpl $0xf0, %ecx
sete %dl
shll $0x2, %edx
addq %rdx, %r8
movq %r8, 0x98(%rbx)
decl %ebp
jne 0xc99f
jmp 0xc940
cmpl $0x7e, %edx
je 0xc835
testq %r15, %r15
je 0xcce1
movq 0x8(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movl $0x1, %eax
jmp 0xc79c
leaq 0xb7ce(%rip), %rdx      # 0x18454
jmp 0xcc8f
leaq 0xb80b(%rip), %rdx      # 0x1849a
cmpl $0x0, 0x24(%rsp)
leaq 0xb787(%rip), %rax      # 0x18422
leaq 0xb761(%rip), %rcx      # 0x18403
cmoveq %rax, %rcx
movl $0x3, (%rbx)
movq %rcx, 0x38(%rbx)
leaq 0x70(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x40(%rbx)
movq 0x10(%rax), %rax
movq %rax, 0x50(%rbx)
movq %rdx, 0x8(%rbx)
movq 0x28(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x20(%rbx)
movq 0x10(%rax), %rax
movq %rax, 0x30(%rbx)
jmp 0xc790
movq 0x18(%rsp), %rax
addq $0x5, %rax
cmpq 0x10(%rsp), %rax
jb 0xcd09
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20a0
testl %eax, %eax
je 0xc78a
cmpl $0x0, 0x24(%rsp)
leaq 0xb70d(%rip), %rax      # 0x18422
leaq 0xb6e7(%rip), %rcx      # 0x18403
cmoveq %rax, %rcx
movl $0x3, (%rbx)
movq %rcx, 0x38(%rbx)
leaq 0x70(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x40(%rbx)
movq 0x10(%rax), %rax
movq %rax, 0x50(%rbx)
leaq 0xb6f1(%rip), %rax      # 0x18436
movq %rax, 0x8(%rbx)
jmp 0xccc8
leaq 0xb71e(%rip), %rdx      # 0x18473
jmp 0xcc8f