// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movslq 0xc(%rdi), %rax
movq %rax, -0x40(%rbp)
testl %ecx, %ecx
movl $0x7, %eax
movl $0xc5, %ecx
cmovnel %eax, %ecx
leaq -0x44(%rbp), %rsi
movl %ecx, (%rsi)
callq 0x13178
movq %r14, -0x30(%rbp)
subq %r13, %r14
shrq $0x2, %r14
movl 0xc(%rbx), %eax
leal (%r14,%rax), %esi
incl %esi
cmpl 0x8(%rbx), %esi
jle 0x11272
movq %rbx, %rdi
callq 0x131ba
movl 0xc(%rbx), %eax
movslq %eax, %r15
shlq $0x2, %r15
movq %rbx, -0x38(%rbp)
addq (%rbx), %r15
xorl %r14d, %r14d
cmpq -0x30(%rbp), %r13
jae 0x11375
xorl %r14d, %r14d
movq %r13, %r12
movq %r13, %rdi
leaq 0x69a6(%rip), %rsi      # 0x17c43
callq 0x2030
movslq %r14d, %r14
leaq (%r15,%r14), %rdi
movslq %eax, %rbx
movq %r13, %rsi
movq %rbx, %rdx
callq 0x2130
addl %ebx, %r14d
addq %rbx, %r13
movb (%r12,%rbx), %al
movzbl %al, %ecx
cmpl $0x2e, %ecx
jle 0x112f5
cmpl $0x2f, %ecx
je 0x11337
cmpl $0x40, %ecx
je 0x112dc
cmpl $0x5d, %ecx
jne 0x1136b
cmpq -0x30(%rbp), %r13
jae 0x11375
incq %r13
movslq %r14d, %rcx
incl %r14d
movb %al, (%r15,%rcx)
jmp 0x1136b
cmpl $0xd, %ecx
je 0x11352
cmpl $0x22, %ecx
jne 0x11357
leaq 0x1(%r13), %rdi
callq 0x4f49
xorl %r12d, %r12d
cmpb $0x22, (%rax)
sete %r12b
addq %rax, %r12
movslq %r14d, %rdi
addq %r15, %rdi
movq %r12, %rbx
subq %r13, %rbx
movq %r13, %rsi
movq %rbx, %rdx
callq 0x2130
addl %r14d, %ebx
movl %ebx, %r14d
movq %r12, %r13
jmp 0x1136b
cmpb $0x2f, 0x1(%r13)
jne 0x1135d
movq %r13, %rdi
leaq 0x68f1(%rip), %rsi      # 0x17c39
callq 0x2030
addq %rax, %r13
jmp 0x1136b
incq %r13
jmp 0x1136b
testl %ecx, %ecx
jne 0x1136b
jmp 0x11375
incq %r13
movslq %r14d, %rax
incl %r14d
movb $0x2f, (%r15,%rax)
cmpq -0x30(%rbp), %r13
jb 0x11290
movslq %r14d, %rbx
addq %rbx, %r15
movl %ebx, %eax
andl $0x3, %eax
movl $0x4, %edx
subq %rax, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20b0
movl %ebx, %eax
sarl $0x2, %eax
movq -0x38(%rbp), %rdx
movl 0xc(%rdx), %ecx
addl %ecx, %eax
incl %eax
movl %eax, 0xc(%rdx)
shll $0x8, %ebx
movq (%rdx), %rax
movq -0x40(%rbp), %rcx
orl %ebx, (%rax,%rcx,4)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq