// File: /workspace/github_c_makefile_star2_O2/haxlang[P]hax/haxGlob.c
// Function: Hax_GlobCmd
int
Hax_GlobCmd(
    ClientData clientData,		/* Unix Client Data */
    Hax_Interp *interp,			/* Current interpreter. */
    int argc,				/* Number of arguments. */
    char **argv				/* Argument strings. */)
{
    UnixClientData *clientDataPtr = (UnixClientData *) clientData;
    int i, result, noComplain;

    if (argc < 2) {
	notEnoughArgs:
	Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		" ?-nocomplain? name ?name ...?\"", (char *) NULL);
	return HAX_ERROR;
    }
    noComplain = 0;
    if ((argv[1][0] == '-') && (strcmp(argv[1], "-nocomplain") == 0)) {
	if (argc < 3) {
	    goto notEnoughArgs;
	}
	noComplain = 1;
    }

    for (i = 1 + noComplain; i < argc; i++) {
	char *thisName;

	/*
	 * Do special checks for names starting at the root and for
	 * names beginning with ~.  Then let DoGlob do the rest.
	 */

	thisName = argv[i];
	if (*thisName == '~') {
	    thisName = Hax_TildeSubst(interp, clientDataPtr, thisName);
	    if (thisName == NULL) {
		return HAX_ERROR;
	    }
	}
	if (*thisName == '/') {
	    result = DoGlob(interp, (char *) "/", thisName+1);
	} else {
	    result = DoGlob(interp, (char *) "", thisName);
	}
	if (result != HAX_OK) {
	    return result;
	}
    }
    if ((*interp->result == 0) && !noComplain) {
	const char *sep = "";

	Hax_AppendResult(interp, "no files matched glob pattern",
		(argc == 2) ? " \"" : "s \"", (char *) NULL);
	for (i = 1; i < argc; i++) {
	    Hax_AppendResult(interp, (char *) sep, argv[i], (char *) NULL);
	    sep = " ";
	}
	Hax_AppendResult(interp, "\"", (char *) NULL);
	return HAX_ERROR;
    }
    return HAX_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
cmpl $0x1, %edx
jg 0x3fc4
movq (%r14), %rdx
leaq 0x41a5(%rip), %rsi      # 0x8143
leaq 0x41b8(%rip), %rcx      # 0x815d
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3500
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %edx, %r12d
movq 0x8(%r14), %rdi
cmpb $0x2d, (%rdi)
jne 0x3fe4
leaq 0x41a6(%rip), %rsi      # 0x817d
callq 0x3310
testl %eax, %eax
je 0x40c1
movq $0x0, (%rsp)
xorl %r15d, %r15d
pushq $0x1
popq %rbp
movl %r12d, 0xc(%rsp)
movl %r12d, %r13d
incq %r15
leaq 0x4891(%rip), %r12      # 0x8895
cmpq %r13, %r15
jae 0x4059
movq (%r14,%r15,8), %rax
movb (%rax), %cl
cmpb $0x7e, %cl
jne 0x402b
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x3560
testq %rax, %rax
je 0x3fb2
movb (%rax), %cl
cmpb $0x2f, %cl
jne 0x403f
incq %rax
movq %rbx, %rdi
leaq 0x414c(%rip), %rsi      # 0x8189
jmp 0x4045
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x40f2
incq %r15
testl %eax, %eax
je 0x4004
jmp 0x3fb5
movq (%rbx), %rax
cmpb $0x0, (%rax)
setne %cl
xorl %eax, %eax
movq (%rsp), %rdx
orb %cl, %dl
jne 0x3fb5
cmpl $0x2, 0xc(%rsp)
leaq 0x40a3(%rip), %rax      # 0x811f
leaq 0x4126(%rip), %rdx      # 0x81a9
cmoveq %rax, %rdx
leaq 0x40fd(%rip), %rsi      # 0x818b
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3500
leaq 0x43d2(%rip), %r15      # 0x8473
cmpq %r13, %rbp
jae 0x40da
movq (%r14,%rbp,8), %rdx
movq %rbx, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3500
incq %rbp
movq %r15, %r12
jmp 0x40a1
cmpl $0x2, %r12d
je 0x3f94
pushq $0x1
popq %r15
movb $0x1, %al
movq %rax, (%rsp)
jmp 0x3fef
leaq 0x403f(%rip), %rsi      # 0x8120
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3500
jmp 0x3fb2