// File: /workspace/github_cpp_makefile_star2_O1/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 0x12c34
movq %r14, -0x30(%rbp)
subq %r13, %r14
shrq $0x2, %r14
movl 0xc(%rbx), %ecx
leal (%r14,%rcx), %esi
incl %esi
cmpl 0x8(%rbx), %esi
jle 0x10d3f
movq %rbx, %rdi
callq 0x12c74
movslq 0xc(%rbx), %r15
shlq $0x2, %r15
movq %rbx, -0x38(%rbp)
addq (%rbx), %r15
xorl %r14d, %r14d
cmpq -0x30(%rbp), %r13
jae 0x10e45
movq %r13, %rdi
leaq 0x5d7e(%rip), %rsi      # 0x16ae3
callq 0x2030
movslq %r14d, %r14
leaq (%r15,%r14), %rdi
movslq %eax, %rbx
movq %r13, %rsi
movq %rbx, %rdx
callq 0x2130
addl %ebx, %r14d
leaq (%r13,%rbx), %r12
movb (%r13,%rbx), %cl
movzbl %cl, %edx
movl $0x5, %eax
cmpl $0x2e, %edx
jg 0x10dee
testl %edx, %edx
je 0x10e35
cmpl $0xd, %edx
je 0x10e30
cmpl $0x22, %edx
jne 0x10e33
leaq 0x1(%r12), %rdi
callq 0x4f5c
xorl %r13d, %r13d
cmpb $0x22, (%rax)
sete %r13b
addq %rax, %r13
movslq %r14d, %rdi
addq %r15, %rdi
movq %r13, %rbx
subq %r12, %rbx
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2130
addl %r14d, %ebx
xorl %eax, %eax
movl %ebx, %r14d
movq %r13, %r12
jmp 0x10e35
cmpl $0x2f, %edx
je 0x10e05
cmpl $0x40, %edx
je 0x10dfd
cmpl $0x5d, %edx
jne 0x10e33
cmpq -0x30(%rbp), %r12
jb 0x10e21
jmp 0x10e35
cmpb $0x2f, 0x1(%r12)
jne 0x10e21
movq %r12, %rdi
leaq 0x5cc2(%rip), %rsi      # 0x16ad9
callq 0x2030
addq %rax, %r12
jmp 0x10e33
incq %r12
movslq %r14d, %rax
incl %r14d
movb %cl, (%r15,%rax)
jmp 0x10e33
incq %r12
xorl %eax, %eax
movq %r12, %r13
testl %eax, %eax
je 0x10d51
cmpl $0x5, %eax
jne 0x10e82
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