// File: /workspace/github_cpp_makefile_star2_O2/Fohlen[P]cubescript-standalone/command.cpp
// Function: compileblockstr(vector<unsigned int>&, char const*, char const*, bool)
static bool compileblockstr(vector<uint> &code, const char *str, const char *end, bool macro)
{
    int start = code.length();
    code.add(macro ? CODE_MACRO : CODE_VAL|RET_STR); 
    char *buf = (char *)code.reserve((end-str)/sizeof(uint)+1).buf;
    int len = 0;
    while(str < end)
    {
        int n = strcspn(str, "\r/\"@]\0");
        memcpy(&buf[len], str, n);
        len += n;
        str += n;
        switch(*str)
        {
            case '\r': str++; break;
            case '\"':
            {
                const char *start = str; 
                str = parsestring(str+1);
                if(*str=='\"') str++;
                memcpy(&buf[len], start, str-start);
                len += str-start;
                break;
            }
            case '/': 
                if(str[1] == '/') str += strcspn(str, "\n\0");
                else buf[len++] = *str++;
                break;
            case '@':
            case ']':
                if(str < end) { buf[len++] = *str++; break; }
            case '\0': goto done;
        }
    }
done:
    memset(&buf[len], '\0', sizeof(uint)-len%sizeof(uint));
    code.advance(len/sizeof(uint)+1);
    code[start] |= len<<8;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
movslq 0xc(%rdi), %rax
movq %rax, -0x48(%rbp)
testl %ecx, %ecx
pushq $0x7
popq %rax
movl $0xc5, %ecx
cmovnel %eax, %ecx
leaq -0x60(%rbp), %rsi
movl %ecx, (%rsi)
callq 0xd7c0
movq %rbx, -0x38(%rbp)
movq %rbx, %rdx
subq %r13, %rdx
shrq $0x2, %rdx
incl %edx
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
movq %r14, -0x40(%rbp)
movq %r14, %rsi
callq 0xd1d6
movq (%rbx), %rax
movq %rax, -0x30(%rbp)
xorl %r14d, %r14d
cmpq -0x38(%rbp), %r13
jae 0xbb38
movq %r13, %rdi
leaq 0x5cf1(%rip), %rsi      # 0x11737
callq 0x2030
movslq %r14d, %rbx
movq -0x30(%rbp), %rcx
leaq (%rcx,%rbx), %rdi
movslq %eax, %r12
movq %r13, %rsi
movq %r12, %rdx
callq 0x2150
leal (%r12,%rbx), %r14d
leaq (%r12,%r13), %rbx
movzbl (%r13,%r12), %eax
cmpl $0xd, %eax
je 0xbadb
movslq %r14d, %r15
cmpl $0x22, %eax
je 0xbae6
cmpl $0x2f, %eax
je 0xbabb
cmpl $0x40, %eax
je 0xba9a
cmpl $0x5d, %eax
je 0xba9a
movq %rbx, %r13
testl %eax, %eax
jne 0xba32
jmp 0xbb38
cmpq -0x38(%rbp), %rbx
jae 0xbb38
incq %rbx
leal 0x1(%r15), %r14d
movq -0x30(%rbp), %rcx
movb %al, (%rcx,%r15)
movq %rbx, %r13
jmp 0xba32
cmpb $0x2f, 0x1(%rbx)
jne 0xbb20
movq %rbx, %rdi
leaq 0x5c62(%rip), %rsi      # 0x1172d
callq 0x2030
movq %rax, %r13
addq %rbx, %r13
jmp 0xba32
incq %rbx
movq %rbx, %r13
jmp 0xba32
leaq 0x1(%rbx), %rdi
callq 0x47ed
xorl %r13d, %r13d
cmpb $0x22, (%rax)
sete %r13b
addq %rax, %r13
movq -0x30(%rbp), %rax
leaq (%rax,%r15), %rdi
movq %r13, %r12
subq %rbx, %r12
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2150
addl %r12d, %r15d
movl %r15d, %r14d
jmp 0xba32
incq %rbx
leal 0x1(%r15), %r14d
movq -0x30(%rbp), %rax
movb $0x2f, (%rax,%r15)
movq %rbx, %r13
jmp 0xba32
movslq %r14d, %rbx
movq -0x30(%rbp), %rdi
addq %rbx, %rdi
movl %ebx, %eax
andl $0x3, %eax
pushq $0x4
popq %rdx
subq %rax, %rdx
xorl %esi, %esi
callq 0x20d0
movl %ebx, %eax
sarl $0x2, %eax
movq -0x40(%rbp), %rdx
movl 0xc(%rdx), %ecx
addl %ecx, %eax
incl %eax
movl %eax, 0xc(%rdx)
shll $0x8, %ebx
movq (%rdx), %rax
movq -0x48(%rbp), %rcx
orl %ebx, (%rax,%rcx,4)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq