// File: /workspace/github_c_makefile_star2_O2/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 0xbeaa
movq %r14, %rdi
callq 0x20d0
movq %rax, %r15
jmp 0xbead
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
pushq $0x10
popq %rdi
callq 0x2080
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xbf18
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 0xbf39
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20a0
testl %eax, %eax
jne 0xbef4
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 0xbf56
incq %r14
leaq -0x1(%r15), %rbp
movq %r14, %rsi
movq %rbp, %rdx
callq 0x2170
addq %rbp, 0x18(%rsp)
cmpq $0x0, 0xa8(%rbx)
jne 0xbf6f
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2060
testl %eax, %eax
je 0xbf1e
leaq 0xe0(%rbx), %rax
movq %rax, 0x28(%rsp)
pushq $0x1
popq %rbp
movq 0x98(%rbx), %rax
movb (%rax), %cl
leal -0x30(%rcx), %edx
cmpb $0xa, %dl
jb 0xbfbf
movl %ecx, %edx
andb $-0x21, %dl
addb $-0x41, %dl
cmpb $0x1a, %dl
jb 0xbfbf
movzbl %cl, %edx
leal -0x21(%rdx), %esi
cmpl $0x3e, %esi
ja 0xc3d2
movabsq $0x54000000d6007fe9, %rdi # imm = 0x54000000D6007FE9
btq %rsi, %rdi
jae 0xc0f0
movq 0x18(%rsp), %rdx
addq $0x5, %rdx
cmpq 0x10(%rsp), %rdx
jb 0xbff0
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20a0
testl %eax, %eax
je 0xbf18
movq 0x98(%rbx), %rax
movb (%rax), %cl
testb %cl, %cl
jns 0xc090
movzbl %cl, %ecx
movl %ecx, %edx
andl $-0x20, %edx
cmpl $0xc0, %edx
je 0xc06c
movl %ecx, %edx
andl $-0x10, %edx
cmpl $0xe0, %edx
je 0xc048
andl $-0x8, %ecx
cmpl $0xf0, %ecx
jne 0xc0ad
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 0xbf7e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2060
testl %eax, %eax
jne 0xbf7e
jmp 0xbf1e
cmpq $0x4, %rsi
jne 0xc3d2
movq 0x18(%rsp), %rax
addq $0x5, %rax
cmpq 0x10(%rsp), %rax
jb 0xc122
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20a0
testl %eax, %eax
je 0xbf18
movq 0xa8(%rbx), %rax
xorl %r14d, %r14d
cmpq $0x2, %rax
ja 0xc145
movq %rbx, %rdi
pushq $0x3
popq %rsi
callq 0x2060
testl %eax, %eax
je 0xbf1e
movq 0x98(%rbx), %rcx
cmpb $0x25, (%rcx)
jne 0xc3f5
movb 0x1(%rcx), %al
leal -0x30(%rax), %edx
cmpb $0xa, %dl
jb 0xc183
movzbl %al, %edx
addl $-0x41, %edx
cmpl $0x25, %edx
ja 0xc3f5
movabsq $0x3f0000003f, %rsi     # imm = 0x3F0000003F
btq %rdx, %rsi
jae 0xc3f5
movb 0x2(%rcx), %cl
leal -0x30(%rcx), %edx
cmpb $0xa, %dl
jb 0xc1b1
movzbl %cl, %esi
addl $-0x41, %esi
cmpl $0x25, %esi
ja 0xc3f5
movabsq $0x3f0000003f, %rdi     # imm = 0x3F0000003F
btq %rsi, %rdi
jae 0xc3f5
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 %r14d, %r14d
je 0xc208
movl %eax, %ecx
andb $-0x40, %cl
negb %cl
jo 0xc248
jmp 0xc3fe
pushq $0x1
popq %r14
testb %al, %al
jns 0xc248
movzbl %al, %ecx
movl %ecx, %edx
andl $-0x20, %edx
pushq $0x2
popq %r14
cmpl $0xc0, %edx
je 0xc248
movl %ecx, %edx
andl $-0x10, %edx
pushq $0x3
popq %r14
cmpl $0xe0, %edx
je 0xc248
andl $-0x8, %ecx
pushq $0x4
popq %r14
cmpl $0xf0, %ecx
jne 0xc4c4
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), %rdi
movq 0xa8(%rbx), %rax
leaq -0x1(%rax), %rsi
movq %rsi, 0xa8(%rbx)
movzbl (%rdi), %esi
movq %rbp, %r8
testb %sil, %sil
jns 0xc2dc
movl %esi, %r9d
andl $-0x20, %r9d
pushq $0x2
popq %r8
cmpl $0xc0, %r9d
je 0xc2dc
movl %esi, %r9d
andl $-0x10, %r9d
pushq $0x3
popq %r8
cmpl $0xe0, %r9d
je 0xc2dc
andl $-0x8, %esi
xorl %r8d, %r8d
cmpl $0xf0, %esi
sete %r8b
shll $0x2, %r8d
leaq (%rdi,%r8), %rsi
movq %rsi, 0x98(%rbx)
leaq 0x2(%rcx), %r9
movq %r9, 0xe0(%rbx)
leaq 0x2(%rdx), %r9
movq %r9, 0xf0(%rbx)
leaq -0x2(%rax), %r9
movq %r9, 0xa8(%rbx)
movzbl (%rdi,%r8), %edi
movq %rbp, %r8
testb %dil, %dil
jns 0xc351
movl %edi, %r9d
andl $-0x20, %r9d
pushq $0x2
popq %r8
cmpl $0xc0, %r9d
je 0xc351
movl %edi, %r9d
andl $-0x10, %r9d
pushq $0x3
popq %r8
cmpl $0xe0, %r9d
je 0xc351
andl $-0x8, %edi
xorl %r8d, %r8d
cmpl $0xf0, %edi
sete %r8b
shll $0x2, %r8d
leaq (%rsi,%r8), %rdi
movq %rdi, 0x98(%rbx)
addq $0x3, %rcx
movq %rcx, 0xe0(%rbx)
addq $0x3, %rdx
movq %rdx, 0xf0(%rbx)
addq $-0x3, %rax
movq %rax, 0xa8(%rbx)
movzbl (%rsi,%r8), %ecx
movq %rbp, %rdx
testb %cl, %cl
jns 0xc3ba
movl %ecx, %esi
andl $-0x20, %esi
pushq $0x2
popq %rdx
cmpl $0xc0, %esi
je 0xc3ba
movl %ecx, %esi
andl $-0x10, %esi
pushq $0x3
popq %rdx
cmpl $0xe0, %esi
je 0xc3ba
andl $-0x8, %ecx
xorl %edx, %edx
cmpl $0xf0, %ecx
sete %dl
shll $0x2, %edx
addq %rdx, %rdi
movq %rdi, 0x98(%rbx)
decl %r14d
jne 0xc12c
jmp 0xc0cc
cmpl $0x7e, %edx
je 0xbfbf
testq %r15, %r15
je 0xc457
movq 0x8(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, (%rcx)
pushq $0x1
popq %rax
jmp 0xbf2a
leaq 0xb048(%rip), %rdx      # 0x17444
jmp 0xc405
leaq 0xb085(%rip), %rdx      # 0x1748a
cmpl $0x0, 0x24(%rsp)
leaq 0xb001(%rip), %rax      # 0x17412
leaq 0xafdb(%rip), %rcx      # 0x173f3
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 0xbf1e
movq 0x18(%rsp), %rax
addq $0x5, %rax
cmpq 0x10(%rsp), %rax
jb 0xc47f
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20a0
testl %eax, %eax
je 0xbf18
cmpl $0x0, 0x24(%rsp)
leaq 0xaf87(%rip), %rax      # 0x17412
leaq 0xaf61(%rip), %rcx      # 0x173f3
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 0xaf6b(%rip), %rax      # 0x17426
movq %rax, 0x8(%rbx)
jmp 0xc43e
leaq 0xaf98(%rip), %rdx      # 0x17463
jmp 0xc405