// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxUtil.c
// Function: Hax_Merge
char *
Hax_Merge(
    Hax_Interp *interp,
    int argc,			/* How many strings to merge. */
    char **argv			/* Array of string values. */)
{
    Interp *iPtr = (Interp *) interp;
    Hax_Memoryp *memoryp = iPtr->memoryp;
#   define LOCAL_SIZE 20
    int localFlags[LOCAL_SIZE], *flagPtr;
    int numChars;
    char *result;
    char *dst;
    int i;

    /*
     * Pass 1: estimate space, gather flags.
     */

    if (argc <= LOCAL_SIZE) {
	flagPtr = localFlags;
    } else {
	flagPtr = (int *) ckalloc(memoryp, (unsigned) argc*sizeof(int));
    }
    numChars = 1;
    for (i = 0; i < argc; i++) {
	numChars += Hax_ScanElement(argv[i], &flagPtr[i]) + 1;
    }

    /*
     * Pass two: copy into the result area.
     */

    result = (char *) ckalloc(memoryp, (unsigned) numChars);
    dst = result;
    for (i = 0; i < argc; i++) {
	numChars = Hax_ConvertElement(argv[i], dst, flagPtr[i]);
	dst += numChars;
	*dst = ' ';
	dst++;
    }
    if (dst == result) {
	*dst = 0;
    } else {
	dst[-1] = 0;
    }

    if (flagPtr != localFlags) {
	ckfree(memoryp, (char *) flagPtr);
    }
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x280(%rax), %rax
movq %rax, -0x28(%rbp)
cmpl $0x14, -0xc(%rbp)
jg 0x18440
leaq -0x80(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x18465
movq -0x28(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, %esi
shlq $0x2, %rsi
leaq 0x73d6(%rip), %rdx      # 0x1f82a
movl $0x2b1, %ecx            # imm = 0x2B1
callq 0x44c0
movq %rax, -0x88(%rbp)
movl $0x1, -0x8c(%rbp)
movl $0x0, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x184cd
movq -0x18(%rbp), %rax
movslq -0xa4(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x88(%rbp), %rsi
movslq -0xa4(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x4100
addl $0x1, %eax
addl -0x8c(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x18479
movq -0x28(%rbp), %rdi
movl -0x8c(%rbp), %eax
movl %eax, %esi
leaq 0x734a(%rip), %rdx      # 0x1f82a
movl $0x2bc, %ecx            # imm = 0x2BC
callq 0x44c0
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl $0x0, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x18590
movq -0x18(%rbp), %rax
movslq -0xa4(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0xa0(%rbp), %rsi
movq -0x88(%rbp), %rax
movslq -0xa4(%rbp), %rcx
movl (%rax,%rcx,4), %edx
callq 0x4150
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %ecx
movq -0xa0(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movb $0x20, (%rax)
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x18509
movq -0xa0(%rbp), %rax
cmpq -0x98(%rbp), %rax
jne 0x185ac
movq -0xa0(%rbp), %rax
movb $0x0, (%rax)
jmp 0x185b7
movq -0xa0(%rbp), %rax
movb $0x0, -0x1(%rax)
movq -0x88(%rbp), %rax
leaq -0x80(%rbp), %rcx
cmpq %rcx, %rax
je 0x185e3
movq -0x28(%rbp), %rdi
movq -0x88(%rbp), %rsi
leaq 0x7251(%rip), %rdx      # 0x1f82a
movl $0x2cb, %ecx            # imm = 0x2CB
callq 0x4260
movq -0x98(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)