// File: /workspace/github_c_makefile_star2_O3/s3lase[P]v6shell/osh.c
// Function: glob
static const char **
glob(enum sbikey key, char **av)
{
	char *gp, **sav;
	const char **gav;	/* points to generated argument vector */
	int pmc = 0;		/* pattern-match count                 */
	bool gerr = false;	/* glob error flag                     */

	gavtot = 0;

	sav  = av;
	gav  = xmalloc(GAVNEW * sizeof(char *));
	*gav = NULL, gavp = gav;
	gave = &gav[GAVNEW - 1];
	while (*av != NULL) {
		if ((gp = gtrim(UCPTR(*av))) == NULL) {
			gerr = true;
			break;
		}
		gav = glob1(key, gav, gp, &pmc, &gerr);
		if (gerr)
			break;
		av++;
	}
	gavp = NULL;

	if (pmc == 0 && !gerr) {
		err(-2, FMT2S, getmyname(), ERR_NOMATCH);
		gerr = true;
	}
	if (gerr)
		vfree((char **)gav);
	vfree(sav);

	return gerr ? NULL : gav;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1048, %rsp           # imm = 0x1048
movq %rsi, %r14
movl %edi, %ebx
xorl %r15d, %r15d
movq %r15, 0xc848(%rip)      # 0x11310
movl $0x400, %edi            # imm = 0x400
callq 0x42b3
movq %rax, %rbp
movq %r15, (%rax)
movq %rax, 0xc839(%rip)      # 0x11318
addq $0x3f8, %rax            # imm = 0x3F8
movq %rax, 0xc834(%rip)      # 0x11320
movq (%r14), %r13
testq %r13, %r13
je 0x4ed3
addl $-0x4, %ebx
movl %ebx, 0x1c(%rsp)
movabsq $0xe00000020000921, %rbx # imm = 0xE00000020000921
movq %r14, %r8
movb $0x0, 0x40(%rsp)
xorl %r12d, %r12d
movq %r13, %rcx
movb (%rcx), %al
movzbl %al, %edx
cmpl $0x26, %edx
jle 0x4b69
cmpl $0x27, %edx
je 0x4b6e
cmpl $0x5c, %edx
jne 0x4bdb
leaq 0x1(%rcx), %rdx
movb 0x1(%rcx), %al
movzbl %al, %esi
leal -0x22(%rsi), %edi
cmpl $0x3b, %edi
ja 0x4bfe
btq %rdi, %rbx
jae 0x4bfe
movb $0x5c, 0x40(%rsp,%r12)
cmpq $0xfff, %r12            # imm = 0xFFF
je 0x4eb5
incq %r12
movb (%rdx), %al
jmp 0x4bde
cmpl $0x22, %edx
jne 0x4bd7
movb 0x1(%rcx), %sil
incq %rcx
cmpb %al, %sil
je 0x4be9
movq %rcx, %rdx
movzbl %sil, %ecx
leal -0x22(%rcx), %edi
cmpl $0x3b, %edi
ja 0x4bce
btq %rdi, %rbx
jae 0x4bce
movb $0x5c, 0x40(%rsp,%r12)
cmpq $0xffe, %r12            # imm = 0xFFE
jg 0x4eb5
incq %r12
movb (%rdx), %sil
movq %r12, %rdi
movb %sil, 0x40(%rsp,%r12)
incq %r12
leaq 0x1(%rdx), %rcx
cmpq $0xffe, %rdi            # imm = 0xFFE
jg 0x4be9
movb 0x1(%rdx), %sil
movq %rcx, %rdx
cmpb %al, %sil
jne 0x4b7d
jmp 0x4be9
testl %ecx, %ecx
jne 0x4ba8
jmp 0x4eb5
testl %edx, %edx
je 0x4c04
movq %rcx, %rdx
movb %al, 0x40(%rsp,%r12)
incq %r12
movq %rdx, %rcx
incq %rcx
cmpq $0x1000, %r12           # imm = 0x1000
jl 0x4b17
jmp 0x4eb5
testl %esi, %esi
je 0x4be9
jmp 0x4bde
movq %r8, 0x20(%rsp)
movb $0x0, 0x40(%rsp,%r12)
incq %r12
movq %r13, %rdi
callq 0x2130
incq %rax
cmpq %rax, %r12
jbe 0x4c35
movq %r13, %rdi
callq 0x2050
movq %r12, %rdi
callq 0x42b3
movq %rax, %r13
leaq 0x40(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x22a0
testq %r13, %r13
sete %r12b
je 0x4f32
movq %r13, %rdi
callq 0x5bde
testq %rax, %rax
je 0x4caf
leaq 0x40(%rsp), %rdi
leaq 0x4665(%rip), %rdx      # 0x92d0
leaq 0x4bae(%rip), %rsi      # 0x9820
leaq 0x470b(%rip), %r8       # 0x9384
movq %r15, 0x10(%rsp)
cmpq %r13, %rax
je 0x4d0a
leaq -0x1(%rax), %rcx
cmpb $0x2f, -0x1(%rax)
movq %rcx, %rax
jne 0x4c7e
movb $0x0, (%rcx)
cmpq %r13, %rcx
setne %al
movl %eax, (%rsp)
movq %r13, %r9
cmoveq %r8, %r9
incq %rcx
movq %rcx, %r13
jmp 0x4d14
movq %rbp, %rdi
callq 0x5c3f
movq %rax, %rbp
cmpl $-0x3, 0x1c(%rsp)
ja 0x4cc9
movq %r13, %rdi
callq 0x5cf8
movq %r13, %rdi
leaq 0x45fd(%rip), %rsi      # 0x92d0
xorl %edx, %edx
callq 0x5de1
testq %rax, %rax
je 0x4f32
movq 0xc62e(%rip), %rcx      # 0x11318
leaq 0x8(%rcx), %rdx
movq %rdx, 0xc623(%rip)      # 0x11318
movq %rax, (%rcx)
movq $0x0, 0x8(%rcx)
movq 0x20(%rsp), %r8
jmp 0x4e9b
movl $0x0, (%rsp)
movq %rdx, %r9
cmpb $0x0, (%r9)
movq %r9, %rax
cmoveq %rsi, %rax
movb $0x0, 0x40(%rsp)
xorl %ecx, %ecx
movb (%rax,%rcx), %dl
movb %dl, 0x40(%rsp,%rcx)
testb %dl, %dl
je 0x4d42
incq %rcx
cmpq $0x1000, %rcx           # imm = 0x1000
jne 0x4d26
jmp 0x4f6b
movq %r9, %r15
callq 0x5cf8
leaq 0x40(%rsp), %rdi
callq 0x2110
leaq 0x40(%rsp), %rcx
testq %rax, %rax
je 0x4f6b
movq %r15, %rdx
movq %rax, %r15
movq %r12, 0x38(%rsp)
cmpb $0x0, (%rdx)
cmovneq %rcx, %rdx
movq %rdx, 0x8(%rsp)
movq 0xc598(%rip), %rax      # 0x11318
subq %rbp, %rax
sarq $0x3, %rax
movq %rax, 0x30(%rsp)
movq %r15, %rdi
callq 0x22c0
testq %rax, %rax
je 0x4e04
movq %rax, %r12
cmpb $0x2e, 0x13(%rax)
jne 0x4da9
cmpb $0x2e, (%r13)
jne 0x4d8c
addq $0x13, %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x5efa
testb %al, %al
je 0x4d8c
movq %rbp, %rdi
callq 0x5c3f
movq %rax, %rbp
movzbl (%rsp), %edx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x5de1
testq %rax, %rax
je 0x4f88
movq 0xc530(%rip), %rcx      # 0x11318
leaq 0x8(%rcx), %rdx
movq %rdx, 0xc525(%rip)      # 0x11318
movq %rax, (%rcx)
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x10(%rsp)
jmp 0x4d8c
movq %r14, 0x8(%rsp)
movq %r15, %rdi
callq 0x21f0
movq %rbp, 0x28(%rsp)
movq 0x30(%rsp), %rax
leaq (%rbp,%rax,8), %rbp
movq 0xc4f1(%rip), %r13      # 0x11318
movq %r13, %rax
subq %rbp, %rax
cmpq $0x9, %rax
jl 0x4e7a
leaq 0x8(%rbp), %rax
movq %rax, (%rsp)
cmpq %r13, %rax
jae 0x4e6a
movq (%rsp), %r14
movq (%rbp), %r15
movq (%r14), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2230
testl %eax, %eax
jle 0x4e61
movq %r12, (%rbp)
movq %r15, (%r14)
addq $0x8, %r14
cmpq %r13, %r14
jb 0x4e44
movq %r13, %rax
movq (%rsp), %rbp
subq %rbp, %rax
cmpq $0x8, %rax
jg 0x4e33
movq $0x0, (%r13)
movq 0x8(%rsp), %r14
movq 0x28(%rsp), %rbp
movq 0x10(%rsp), %r15
movq 0x20(%rsp), %r8
movq 0x38(%rsp), %r12
movq 0x8(%r8), %r13
addq $0x8, %r8
testq %r13, %r13
jne 0x4b0c
testl %r15d, %r15d
setne %r15b
jmp 0x4ed6
callq 0x6a87
movq %rax, %r15
movq %r13, %rdi
callq 0x5bde
testq %rax, %rax
je 0x4f0f
leaq 0x44a2(%rip), %rcx      # 0x9373
jmp 0x4f1c
xorl %r12d, %r12d
movq $0x0, 0xc437(%rip) # 0x11318
testb %r15b, %r15b
jne 0x4f64
testb %r12b, %r12b
jne 0x4f64
callq 0x6a87
leaq 0x4440(%rip), %rsi      # 0x9337
leaq 0x446c(%rip), %rcx      # 0x936a
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
movq %rax, %rdx
xorl %eax, %eax
callq 0x6840
jmp 0x4f3d
movl $0x24, %edi
callq 0x2380
movq %rax, %rcx
leaq 0x4414(%rip), %rsi      # 0x9337
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
movq %r15, %rdx
xorl %eax, %eax
callq 0x6840
movq $0x0, 0xc3db(%rip) # 0x11318
movq %rbp, %rdi
callq 0x4a67
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x4a67
movq %rbp, %rax
addq $0x1048, %rsp           # imm = 0x1048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %r12b, %r12b
jne 0x4f3d
jmp 0x4f47
callq 0x6a87
leaq 0x43c0(%rip), %rsi      # 0x9337
leaq 0x4408(%rip), %rcx      # 0x9386
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
movq %rax, %rdx
jmp 0x4f2b
movq %r15, %rdi
callq 0x21f0
jmp 0x4f32