// File: /workspace/github_c_makefile_star2_O1/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, %r15d
movq %rdi, %rbx
testq %rdx, %rdx
je 0xcf65
movq %r14, %rdi
callq 0x20d0
movq %rax, %r13
jmp 0xcf68
xorl %r13d, %r13d
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movl $0x10, %edi
callq 0x2080
movq %rax, (%rsp)
testq %rax, %rax
je 0xcfd2
leaq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x8(%rsp), %rdx
movq %rcx, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rsp, %rbp
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
subq %rdi, %rax
cmpq %r13, %rax
ja 0xd002
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x20a0
testl %eax, %eax
jne 0xcfab
movl $0x1, (%rbx)
movq (%rsp), %rdi
callq 0x2140
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, 0x30(%rsp)
movl %r15d, 0x24(%rsp)
cmpq $0x2, %r13
jb 0xd029
incq %r14
leaq -0x1(%r13), %rbp
movq %r14, %rsi
movq %rbp, %rdx
callq 0x2170
addq %rbp, 0x10(%rsp)
movq %r13, 0x28(%rsp)
cmpq $0x0, 0xa8(%rbx)
jne 0xd049
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2060
testl %eax, %eax
je 0xcfd8
cmpl $0x0, 0x24(%rsp)
leaq 0xc351(%rip), %rax      # 0x193a6
leaq 0xc32b(%rip), %rbp      # 0x19387
cmoveq %rax, %rbp
leaq 0x40(%rbx), %r14
leaq 0x20(%rbx), %r13
leaq 0xe0(%rbx), %r15
movq 0x98(%rbx), %rax
movzbl (%rax), %eax
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
jb 0xd0be
movl %eax, %ecx
andb $-0x21, %cl
addb $-0x41, %cl
cmpb $0x1a, %cl
jb 0xd0be
leal -0x21(%rax), %ecx
cmpl $0x3e, %ecx
ja 0xd0b0
movabsq $0x54000000d6007fe9, %rdx # imm = 0x54000000D6007FE9
btq %rcx, %rdx
jb 0xd462
cmpq $0x4, %rcx
je 0xd0c7
cmpl $0x7e, %eax
je 0xd462
jmp 0xd59c
cmpl $0x25, %eax
jne 0xd462
movq 0x10(%rsp), %rax
addq $0x5, %rax
cmpq 0x8(%rsp), %rax
jb 0xd0f1
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x20a0
testl %eax, %eax
je 0xcfd2
xorl %r12d, %r12d
cmpq $0x2, 0xa8(%rbx)
ja 0xd113
movl $0x3, %esi
movq %rbx, %rdi
callq 0x2060
testl %eax, %eax
je 0xd225
movq 0x98(%rbx), %rcx
cmpb $0x25, (%rcx)
jne 0xd179
movb 0x1(%rcx), %al
leal -0x30(%rax), %esi
cmpb $0xa, %sil
jb 0xd146
movzbl %al, %edx
addl $-0x41, %edx
cmpl $0x25, %edx
ja 0xd179
movabsq $0x3f0000003f, %rdi     # imm = 0x3F0000003F
btq %rdx, %rdi
jae 0xd179
movb 0x2(%rcx), %cl
leal -0x30(%rcx), %edx
cmpb $0xa, %dl
jb 0xd16c
movzbl %cl, %edi
addl $-0x41, %edi
cmpl $0x25, %edi
ja 0xd179
movabsq $0x3f0000003f, %r8      # imm = 0x3F0000003F
btq %rdi, %r8
jae 0xd179
leal -0x41(%rax), %edi
cmpb $0x5, %dil
ja 0xd1a0
addb $-0x37, %al
jmp 0xd1b3
movl $0x3, (%rbx)
movq %rbp, 0x38(%rbx)
leaq 0x70(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%r14)
movups (%rcx), %xmm0
movups %xmm0, (%r14)
leaq 0xc23a(%rip), %rax      # 0x193d8
jmp 0xd210
leal -0x61(%rax), %edi
addb $-0x57, %al
cmpb $0x6, %dil
movzbl %sil, %esi
movzbl %al, %eax
cmovael %esi, %eax
leal -0x41(%rcx), %esi
cmpb $0x5, %sil
ja 0xd1c1
addb $-0x37, %cl
jmp 0xd1d4
leal -0x61(%rcx), %esi
addb $-0x57, %cl
cmpb $0x6, %sil
movzbl %dl, %edx
movzbl %cl, %ecx
cmovael %edx, %ecx
shlb $0x4, %al
addb %cl, %al
testl %r12d, %r12d
je 0xd22c
movl %eax, %ecx
andb $-0x40, %cl
negb %cl
jo 0xd27c
movl $0x3, (%rbx)
movq %rbp, 0x38(%rbx)
leaq 0x70(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%r14)
movups (%rcx), %xmm0
movups %xmm0, (%r14)
leaq 0xc20e(%rip), %rax      # 0x1941e
movq %rax, 0x8(%rbx)
movq 0x10(%r15), %rax
movq %rax, 0x10(%r13)
movups (%r15), %xmm0
movups %xmm0, (%r13)
xorl %eax, %eax
jmp 0xd40a
movl $0x1, %r12d
testb %al, %al
jns 0xd273
movzbl %al, %ecx
movl %ecx, %edx
andl $-0x20, %edx
movl $0x2, %r12d
cmpl $0xc0, %edx
je 0xd273
movl %ecx, %edx
andl $-0x10, %edx
movl $0x3, %r12d
cmpl $0xe0, %edx
je 0xd273
andl $-0x8, %ecx
xorl %r12d, %r12d
cmpl $0xf0, %ecx
sete %r12b
shll $0x2, %r12d
testl %r12d, %r12d
je 0xd420
movq 0x10(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rsp)
movb %al, (%rcx)
movq 0xe0(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xe0(%rbx)
movq 0xf0(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0xf0(%rbx)
movq 0x98(%rbx), %r8
movq 0xa8(%rbx), %rdx
leaq -0x1(%rdx), %rsi
movq %rsi, 0xa8(%rbx)
movzbl (%r8), %edi
movl $0x1, %esi
movl $0x1, %r9d
testb %dil, %dil
jns 0xd31d
movl %edi, %r10d
andl $-0x20, %r10d
movl $0x2, %r9d
cmpl $0xc0, %r10d
je 0xd31d
movl %edi, %r10d
andl $-0x10, %r10d
movl $0x3, %r9d
cmpl $0xe0, %r10d
je 0xd31d
andl $-0x8, %edi
xorl %r9d, %r9d
cmpl $0xf0, %edi
sete %r9b
shll $0x2, %r9d
leaq (%r8,%r9), %rdi
movq %rdi, 0x98(%rbx)
leaq 0x2(%rax), %r10
movq %r10, 0xe0(%rbx)
leaq 0x2(%rcx), %r10
movq %r10, 0xf0(%rbx)
leaq -0x2(%rdx), %r10
movq %r10, 0xa8(%rbx)
movzbl (%r8,%r9), %r8d
testb %r8b, %r8b
jns 0xd391
movl %r8d, %r9d
andl $-0x20, %r9d
movl $0x2, %esi
cmpl $0xc0, %r9d
je 0xd391
movl %r8d, %r9d
andl $-0x10, %r9d
movl $0x3, %esi
cmpl $0xe0, %r9d
je 0xd391
andl $-0x8, %r8d
xorl %esi, %esi
cmpl $0xf0, %r8d
sete %sil
shll $0x2, %esi
leaq (%rdi,%rsi), %r8
movq %r8, 0x98(%rbx)
addq $0x3, %rax
movq %rax, 0xe0(%rbx)
addq $0x3, %rcx
movq %rcx, 0xf0(%rbx)
addq $-0x3, %rdx
movq %rdx, 0xa8(%rbx)
movzbl (%rdi,%rsi), %eax
movl $0x1, %ecx
testb %al, %al
jns 0xd3fe
movl %eax, %edx
andl $-0x20, %edx
movl $0x2, %ecx
cmpl $0xc0, %edx
je 0xd3fe
movl %eax, %edx
andl $-0x10, %edx
movl $0x3, %ecx
cmpl $0xe0, %edx
je 0xd3fe
andl $-0x8, %eax
xorl %ecx, %ecx
cmpl $0xf0, %eax
sete %cl
shll $0x2, %ecx
addq %rcx, %r8
movq %r8, 0x98(%rbx)
movb $0x1, %al
testb %al, %al
je 0xd567
decl %r12d
jne 0xd0f4
jmp 0xd567
movl $0x3, (%rbx)
movq %rbp, 0x38(%rbx)
leaq 0x70(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%r14)
movups (%rcx), %xmm0
movups %xmm0, (%r14)
leaq 0xbfb2(%rip), %rax      # 0x193f7
movq %rax, 0x8(%rbx)
movq 0x10(%r15), %rax
movq %rax, 0x10(%r13)
movups (%r15), %xmm0
movups %xmm0, (%r13)
xorl %r12d, %r12d
jmp 0xd225
movq 0x10(%rsp), %rax
addq $0x5, %rax
cmpq 0x8(%rsp), %rax
jb 0xd48c
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x20a0
testl %eax, %eax
je 0xcfd2
movq 0x98(%rbx), %rax
movzbl (%rax), %ecx
testb %cl, %cl
jns 0xd533
movl %ecx, %edx
andl $-0x20, %edx
cmpl $0xc0, %edx
je 0xd50f
movl %ecx, %edx
andl $-0x10, %edx
cmpl $0xe0, %edx
je 0xd4eb
andl $-0x8, %ecx
cmpl $0xf0, %ecx
jne 0xd550
leaq 0x1(%rax), %rcx
movq %rcx, 0x98(%rbx)
movb (%rax), %al
movq 0x10(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rsp)
movb %al, (%rcx)
movq 0x98(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x98(%rbx)
movb (%rax), %al
movq 0x10(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rsp)
movb %al, (%rcx)
movq 0x98(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x98(%rbx)
movb (%rax), %al
movq 0x10(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rsp)
movb %al, (%rcx)
movq 0x98(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x98(%rbx)
movb (%rax), %al
movq 0x10(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rsp)
movb %al, (%rcx)
incq 0xe0(%rbx)
incq 0xf0(%rbx)
decq 0xa8(%rbx)
jmp 0xd56f
testb %al, %al
je 0xcfd8
incq 0x28(%rsp)
cmpq $0x0, 0xa8(%rbx)
jne 0xd06f
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2060
testl %eax, %eax
jne 0xd06f
jmp 0xcfd8
cmpq $0x0, 0x28(%rsp)
je 0xd5ba
movq (%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movl $0x1, %eax
jmp 0xcff3
movq 0x10(%rsp), %rax
addq $0x5, %rax
cmpq 0x8(%rsp), %rax
jb 0xd5e4
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x20a0
testl %eax, %eax
je 0xcfd2
cmpl $0x0, 0x24(%rsp)
leaq 0xbd97(%rip), %rax      # 0x19387
leaq 0xbdaf(%rip), %rcx      # 0x193a6
cmoveq %rcx, %rax
movl $0x3, (%rbx)
movq %rax, 0x38(%rbx)
leaq 0x70(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x40(%rbx)
movq 0x10(%rax), %rax
movq %rax, 0x50(%rbx)
leaq 0xbd9a(%rip), %rax      # 0x193ba
movq %rax, 0x8(%rbx)
movups 0xe0(%rbx), %xmm0
movups %xmm0, 0x20(%rbx)
movq 0xf0(%rbx), %rax
movq %rax, 0x30(%rbx)
jmp 0xcfd8