// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxGlob.c
// Function: AppendResult
static void
AppendResult(
    Hax_Interp *interp,		/* Interpreter whose result should be
				 * appended to. */
    char *dir,			/* Name of directory, without trailing
				 * slash except for root directory. */
    char *separator,		/* Separator string so use between dir and
				 * name:  either "/" or "" depending on dir. */
    char *name,			/* Name of file withing directory (NOT
				 * necessarily null-terminated!). */
    int nameLength		/* Number of characters in name. */)
{
    Hax_Memoryp *memoryp;
    int dirFlags, nameFlags;
    char *p, saved;

    memoryp = Hax_GetMemoryp (interp);

    /*
     * Next, see if we can put together a valid list element from dir
     * and name by calling Hax_AppendResult.
     */

    if (*dir == 0) {
	dirFlags = 0;
    } else {
	Hax_ScanElement(dir, &dirFlags);
    }
    saved = name[nameLength];
    name[nameLength] = 0;
    Hax_ScanElement(name, &nameFlags);
    if ((dirFlags == 0) && (nameFlags == 0)) {
	if (*interp->result != 0) {
	    Hax_AppendResult(interp, " ", dir, separator, name, (char *) NULL);
	} else {
	    Hax_AppendResult(interp, dir, separator, name, (char *) NULL);
	}
	name[nameLength] = saved;
	return;
    }

    /*
     * This name has weird characters in it, so we have to convert it to
     * a list element.  To do that, we have to merge the characters
     * into a single name.  To do that, malloc a buffer to hold everything.
     */

    p = (char *) ckalloc(memoryp, (unsigned) (strlen(dir) + strlen(separator)
	    + nameLength + 1));
    sprintf(p, "%s%s%s", dir, separator, name);
    name[nameLength] = saved;
    Hax_AppendElement(interp, p, 0);
    ckfree(memoryp, p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3540
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x4dfe
movl $0x0, -0x34(%rbp)
jmp 0x4e0b
movq -0x10(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x3100
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x41(%rbp)
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3100
cmpl $0x0, -0x34(%rbp)
jne 0x4ea1
cmpl $0x0, -0x38(%rbp)
jne 0x4ea1
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x4e72
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq 0x6582(%rip), %rsi      # 0xb3e6
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0x3510
jmp 0x4e8e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x3510
movb -0x41(%rbp), %dl
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x4f45
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3190
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3190
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movq -0x50(%rbp), %rax
addq %rcx, %rax
movslq -0x24(%rbp), %rcx
addq %rcx, %rax
addq $0x1, %rax
movl %eax, %eax
movl %eax, %esi
leaq 0x6256(%rip), %rdx      # 0xb139
movl $0x75, %ecx
callq 0x34c0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq 0x62e7(%rip), %rsi      # 0xb1ef
movb $0x0, %al
callq 0x35a0
movb -0x41(%rbp), %dl
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x3070
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq 0x61fe(%rip), %rdx      # 0xb139
movl $0x79, %ecx
callq 0x31f0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)