// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/parse.c
// Function: stringend
static int stringend(JanetParser *p, JanetParseState *state) {
    Janet ret;
    uint8_t *bufstart = p->buf;
    int32_t buflen = (int32_t) p->bufcount;
    if (state->flags & PFLAG_LONGSTRING) {
        /* Post process to remove leading whitespace */
        JanetParseState top = p->states[p->statecount - 1];
        int32_t indent_col = (int32_t) top.column - 1;
        uint8_t *r = bufstart, *end = r + buflen;
        /* Unless there are only spaces before EOLs, disable reindenting */
        int reindent = 1;
        while (reindent && (r < end)) {
            if (*r++ == '\n') {
                for (int32_t j = 0; (r < end) && (*r != '\n') && (j < indent_col); j++, r++) {
                    if (*r != ' ') {
                        reindent = 0;
                        break;
                    }
                }
                if ((r + 1) < end && *r == '\r' && *(r + 1) == '\n') reindent = 1;
            }
        }
        /* Now reindent if able */
        if (reindent) {
            uint8_t *w = bufstart;
            r = bufstart;
            while (r < end) {
                if (*r == '\n') {
                    *w++ = *r++;
                    for (int32_t j = 0; (r < end) && (*r != '\n') && (j < indent_col); j++, r++);
                    if ((r + 1) < end && *r == '\r' && *(r + 1) == '\n') *w++ = *r++;
                } else {
                    *w++ = *r++;
                }
            }
            buflen = (int32_t)(w - bufstart);
        }
        /* Check for leading EOL so we can remove it */
        if (buflen > 1 && bufstart[0] == '\r' && bufstart[1] == '\n') { /* Windows EOL */
            buflen = buflen - 2;
            bufstart = bufstart + 2;
        } else if (buflen > 0 && bufstart[0] == '\n') { /* Unix EOL */
            buflen--;
            bufstart++;
        }
        /* Check for trailing EOL so we can remove it */
        if (buflen > 1 && bufstart[buflen - 2] == '\r' && bufstart[buflen - 1] == '\n') { /* Windows EOL */
            buflen = buflen - 2;
        } else if (buflen > 0 && bufstart[buflen - 1] == '\n') { /* Unix EOL */
            buflen--;
        }
    }
    if (state->flags & PFLAG_BUFFER) {
        JanetBuffer *b = janet_buffer(buflen);
        janet_buffer_push_bytes(b, bufstart, buflen);
        ret = janet_wrap_buffer(b);
    } else {
        ret = janet_wrap_string(janet_string(bufstart, buflen));
    }
    p->bufcount = 0;
    popstate(p, ret);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x52754
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
subq $0x1, %rax
imulq $0x28, %rax, %rax
addq %rax, %rsi
leaq -0x50(%rbp), %rdi
movl $0x28, %edx
callq 0x12680
movq -0x38(%rbp), %rax
subl $0x1, %eax
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movslq -0x24(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movl $0x1, -0x6c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x6c(%rbp)
movb %al, -0x99(%rbp)
je 0x5247f
movq -0x60(%rbp), %rax
cmpq -0x68(%rbp), %rax
setb %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x5248e
jmp 0x52554
movq -0x60(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x60(%rbp)
movzbl (%rax), %eax
cmpl $0xa, %eax
jne 0x5254f
movl $0x0, -0x70(%rbp)
movq -0x60(%rbp), %rcx
xorl %eax, %eax
cmpq -0x68(%rbp), %rcx
movb %al, -0x9a(%rbp)
jae 0x524e5
movq -0x60(%rbp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, -0x9a(%rbp)
je 0x524e5
movl -0x70(%rbp), %eax
cmpl -0x54(%rbp), %eax
setl %al
movb %al, -0x9a(%rbp)
movb -0x9a(%rbp), %al
testb $0x1, %al
jne 0x524f1
jmp 0x5251f
movq -0x60(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
je 0x52506
movl $0x0, -0x6c(%rbp)
jmp 0x5251f
jmp 0x52508
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x524b0
movq -0x60(%rbp), %rax
addq $0x1, %rax
cmpq -0x68(%rbp), %rax
jae 0x5254d
movq -0x60(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xd, %eax
jne 0x5254d
movq -0x60(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0xa, %eax
jne 0x5254d
movl $0x1, -0x6c(%rbp)
jmp 0x5254f
jmp 0x52460
cmpl $0x0, -0x6c(%rbp)
je 0x5268f
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x68(%rbp), %rax
jae 0x52681
movq -0x60(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xa, %eax
jne 0x5265a
movq -0x60(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x60(%rbp)
movb (%rax), %cl
movq -0x78(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x78(%rbp)
movb %cl, (%rax)
movl $0x0, -0x7c(%rbp)
movq -0x60(%rbp), %rcx
xorl %eax, %eax
cmpq -0x68(%rbp), %rcx
movb %al, -0x9b(%rbp)
jae 0x525ea
movq -0x60(%rbp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, -0x9b(%rbp)
je 0x525ea
movl -0x7c(%rbp), %eax
cmpl -0x54(%rbp), %eax
setl %al
movb %al, -0x9b(%rbp)
movb -0x9b(%rbp), %al
testb $0x1, %al
jne 0x525f6
jmp 0x5260f
jmp 0x525f8
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x525b5
movq -0x60(%rbp), %rax
addq $0x1, %rax
cmpq -0x68(%rbp), %rax
jae 0x52658
movq -0x60(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xd, %eax
jne 0x52658
movq -0x60(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0xa, %eax
jne 0x52658
movq -0x60(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x60(%rbp)
movb (%rax), %cl
movq -0x78(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x78(%rbp)
movb %cl, (%rax)
jmp 0x5267c
movq -0x60(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x60(%rbp)
movb (%rax), %cl
movq -0x78(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x78(%rbp)
movb %cl, (%rax)
jmp 0x5256e
movq -0x78(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
jle 0x526c5
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xd, %eax
jne 0x526c5
movq -0x20(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0xa, %eax
jne 0x526c5
movl -0x24(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
jmp 0x526ee
cmpl $0x0, -0x24(%rbp)
jle 0x526ec
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xa, %eax
jne 0x526ec
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x526ee
cmpl $0x1, -0x24(%rbp)
jle 0x5272b
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0xd, %eax
jne 0x5272b
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x5272b
movl -0x24(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x52752
cmpl $0x0, -0x24(%rbp)
jle 0x52750
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x52750
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x52752
jmp 0x52754
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x527b1
movl -0x24(%rbp), %edi
callq 0x18490
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x18790
movq -0x88(%rbp), %rdi
movabsq $-0x2800000000000, %rsi # imm = 0xFFFD800000000000
callq 0x7b610
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x527e1
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x64880
movq %rax, %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x7b550
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x51fe0
movl $0x1, %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)