// File: /workspace/github_cpp_makefile_star2_O2/Fohlen[P]cubescript-standalone/command.cpp
// Function: conc(tagval*, int, bool, char const*, int)
static char *conc(tagval *v, int n, bool space, const char *prefix, int prefixlen)
{
    static int vlen[MAXARGS];
    static char numbuf[3*MAXSTRLEN];
    int len = prefixlen, numlen = 0, i = 0;
    for(; i < n; i++) switch(v[i].type)
    {
        case VAL_MACRO: len += (vlen[i] = v[i].code[-1]>>8); break;
        case VAL_STR: len += (vlen[i] = int(strlen(v[i].s))); break;
        case VAL_INT:
            if(numlen + MAXSTRLEN > int(sizeof(numbuf))) goto overflow;
            intformat(&numbuf[numlen], v[i].i);
            numlen += (vlen[i] = strlen(&numbuf[numlen]));
            break;
        case VAL_FLOAT:
            if(numlen + MAXSTRLEN > int(sizeof(numbuf))) goto overflow;
            floatformat(&numbuf[numlen], v[i].f);
            numlen += (vlen[i] = strlen(&numbuf[numlen]));
            break;
        default: vlen[i] = 0; break;
    }
overflow:
    if(space) len += max(prefix ? i : i-1, 0);
    char *buf = newstring(len + numlen);
    int offset = 0, numoffset = 0;
    if(prefix)
    {
        memcpy(buf, prefix, prefixlen);
        offset += prefixlen;
        if(space && i) buf[offset++] = ' ';
    }
    loopj(i)
    {
        if(v[j].type == VAL_INT || v[j].type == VAL_FLOAT)
        {
            memcpy(&buf[offset], &numbuf[numoffset], vlen[j]);
            numoffset += vlen[j];
        }
        else if(vlen[j]) memcpy(&buf[offset], v[j].s, vlen[j]);
        offset += vlen[j];
        if(j==i-1) break;
        if(space) buf[offset++] = ' ';
    }
    buf[offset] = '\0';
    if(i < n)
    {
        char *morebuf = conc(&v[i], n-i, space, buf, offset);
        delete[] buf;
        return morebuf;
    }
    return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, -0x50(%rbp)
movl %edx, -0x2c(%rbp)
movslq %esi, %rax
xorl %r13d, %r13d
movq %rax, -0x70(%rbp)
testl %eax, %eax
movl $0x0, %eax
movl %esi, -0x54(%rbp)
cmovgl %esi, %eax
movq %rax, -0x38(%rbp)
leaq 0x4d09(%rip), %r12      # 0x116fc
xorl %ecx, %ecx
xorl %r14d, %r14d
movl %r8d, -0x48(%rbp)
movl %r8d, %r15d
movq %rdi, -0x40(%rbp)
cmpq %rcx, -0x38(%rbp)
je 0xcb03
movl 0x8(%rdi,%r13,4), %eax
decl %eax
cmpl $0x5, %eax
ja 0xcae4
movslq (%r12,%rax,4), %rax
addq %r12, %rax
movslq %r14d, %rbx
jmpq *%rax
cmpl $0x208, %r14d           # imm = 0x208
jg 0xcafd
leaq 0xd403(%rip), %rax      # 0x19e40
addq %rax, %rbx
movl (%rdi,%r13,4), %esi
movq %rbx, %rdi
movl %r15d, %r12d
movq %rcx, %r15
callq 0x74d5
jmp 0xca9f
movq (%rdi,%r13,4), %rdi
movq %rcx, %rbx
callq 0x20a0
movq %rbx, %rcx
movq -0x40(%rbp), %rdi
leaq 0xd362(%rip), %rdx      # 0x19dd0
movl %eax, (%r13,%rdx)
addl %eax, %r15d
jmp 0xcaf1
cmpl $0x208, %r14d           # imm = 0x208
jg 0xcafd
leaq 0xd3b8(%rip), %rax      # 0x19e40
addq %rax, %rbx
movss (%rdi,%r13,4), %xmm0
movq %rbx, %rdi
movl %r15d, %r12d
movq %rcx, %r15
callq 0x74fd
movq %rbx, %rdi
callq 0x20a0
movq %r15, %rcx
movl %r12d, %r15d
leaq 0x4c48(%rip), %r12      # 0x116fc
movq -0x40(%rbp), %rdi
leaq 0xd311(%rip), %rdx      # 0x19dd0
movl %eax, (%r13,%rdx)
addl %eax, %r14d
jmp 0xcaf1
movq (%rdi,%r13,4), %rax
movl -0x4(%rax), %eax
shrl $0x8, %eax
leaq 0xd2f6(%rip), %rdx      # 0x19dd0
movl %eax, (%r13,%rdx)
addl %eax, %r15d
jmp 0xcaf1
leaq 0xd2e5(%rip), %rax      # 0x19dd0
andl $0x0, (%r13,%rax)
incq %rcx
addq $0x4, %r13
jmp 0xca03
movl %ecx, %eax
movq %rax, -0x38(%rbp)
cmpb $0x0, -0x2c(%rbp)
movq -0x50(%rbp), %rbx
movq %rcx, -0x68(%rbp)
je 0xcb26
cmpq $0x1, %rbx
movq -0x38(%rbp), %rax
sbbl $0x0, %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovgl %eax, %ecx
addl %ecx, %r15d
addl %r14d, %r15d
movslq %r15d, %rdi
callq 0xd31f
movq %rax, %r15
xorl %r12d, %r12d
movl $0x0, %r13d
testq %rbx, %rbx
je 0xcb71
movl -0x48(%rbp), %r13d
movslq %r13d, %r14
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2150
cmpl $0x0, -0x38(%rbp)
sete %al
movl -0x2c(%rbp), %ecx
xorb $0x1, %cl
orb %al, %cl
jne 0xcb71
leal 0x1(%r14), %r13d
movb $0x20, (%r15,%r14)
movq -0x38(%rbp), %rax
leal -0x1(%rax), %ecx
movl %eax, %eax
movq %rax, -0x60(%rbp)
leaq (,%rax,4), %rax
movq %rax, -0x50(%rbp)
shlq $0x2, %rcx
movq %rcx, -0x48(%rbp)
xorl %ebx, %ebx
movq -0x40(%rbp), %rcx
cmpq %rbx, -0x50(%rbp)
je 0xcc3f
movl 0x8(%rcx,%rbx,4), %eax
decl %eax
movslq %r13d, %rdi
cmpl $0x1, %eax
ja 0xcbea
addq %r15, %rdi
movl %r13d, -0x58(%rbp)
movq %r15, %r13
movslq %r12d, %r15
leaq 0xd27c(%rip), %rax      # 0x19e40
leaq (%rax,%r15), %rsi
leaq 0xd201(%rip), %rax      # 0x19dd0
movl (%rbx,%rax), %r14d
movslq %r14d, %r12
movq %r12, %rdx
callq 0x2150
addl %r15d, %r12d
movq %r13, %r15
movl -0x58(%rbp), %r13d
jmp 0xcc0e
leaq 0xd1df(%rip), %rax      # 0x19dd0
movslq (%rbx,%rax), %r14
testq %r14, %r14
je 0xcc0b
addq %r15, %rdi
movq (%rcx,%rbx,4), %rsi
movq %r14, %rdx
callq 0x2150
jmp 0xcc0e
xorl %r14d, %r14d
addl %r13d, %r14d
cmpq %rbx, -0x48(%rbp)
je 0xcc38
cmpb $0x0, -0x2c(%rbp)
je 0xcc28
movslq %r14d, %rax
incl %r14d
movb $0x20, (%r15,%rax)
movq -0x40(%rbp), %rcx
addq $0x4, %rbx
movl %r14d, %r13d
jmp 0xcb98
movl %r14d, %r13d
movq -0x40(%rbp), %rcx
movslq %r13d, %rax
movb $0x0, (%r15,%rax)
movq -0x68(%rbp), %rax
cmpq -0x70(%rbp), %rax
jge 0xcc84
movq -0x60(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movl -0x54(%rbp), %esi
subl -0x38(%rbp), %esi
movzbl -0x2c(%rbp), %edx
movq %rcx, %rdi
movq %r15, %rcx
movl %r13d, %r8d
callq 0xc9b9
movq %rax, %r14
movq %r15, %rdi
callq 0xf9a8
movq %r14, %rax
jmp 0xcc87
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq