// File: /workspace/github_c_makefile_star2_O3/s3lase[P]v6shell/glob6.c
// Function: main
int
main(int argc, char **argv)
{
	const char **gav;	/* points to generated argument vector */
	int pmc = 0;		/* pattern-match count                 */

	setmyerrexit(&ut_errexit);
	setmyname(argv[0]);
	setmypid(getpid());

	/*
	 * Set-ID execution is not supported.
	 */
	if (geteuid() != getuid() || getegid() != getgid())
		err(SH_ERR, FMT1S, ERR_SETID);

	if (argc < 2)
		err(SH_ERR, FMT1S, ERR_GARGCOUNT);

	if ((gav = malloc(GAVNEW * sizeof(char *))) == NULL)
		err(SH_ERR, FMT1S, ERR_NOMEM);

	*gav = NULL, gavp = gav;
	gave = &gav[GAVNEW - 1];
	while (*++argv != NULL)
		gav = glob1(gav, *argv, &pmc);
	gavp = NULL;

	if (pmc == 0)
		err(SH_ERR, FMT1S, ERR_NOMATCH);

	(void)err_pexec(gav[0], (char *const *)gav);
	/*NOTREACHED*/
	return SH_ERR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x9a5(%rip), %rdi       # 0x1c8e
callq 0x1c1c
movq %rbx, %r15
movq (%rbx), %rdi
callq 0x1c29
callq 0x10b0
movl %eax, %edi
callq 0x1c7d
callq 0x1110
movl %eax, %r14d
callq 0x10e0
cmpl %eax, %r14d
jne 0x1329
callq 0x1190
movl %eax, %r14d
callq 0x1160
cmpl %eax, %r14d
je 0x1343
leaq 0x1ef9(%rip), %rsi      # 0x3229
leaq 0x1dd0(%rip), %rdx      # 0x3107
movl $0x2, %edi
xorl %eax, %eax
callq 0x19b0
cmpl $0x1, %ebp
jg 0x1362
leaq 0x1eda(%rip), %rsi      # 0x3229
leaq 0x1dc9(%rip), %rdx      # 0x311f
movl $0x2, %edi
xorl %eax, %eax
callq 0x19b0
movl $0x400, %edi            # imm = 0x400
callq 0x1180
movq %rax, %r12
testq %rax, %rax
movq %r15, %r14
jne 0x1391
leaq 0x1eab(%rip), %rsi      # 0x3229
leaq 0x1da4(%rip), %rdx      # 0x3129
movl $0x2, %edi
xorl %eax, %eax
callq 0x19b0
movq $0x0, (%r12)
movq %r12, 0x3d68(%rip)      # 0x5108
movq %r12, %rax
addq $0x3f8, %rax            # imm = 0x3F8
movq %rax, 0x3d60(%rip)      # 0x5110
movq 0x8(%r14), %rbp
testq %rbp, %rbp
je 0x1614
addq $0x8, %r14
movabsq $0x2000000200001, %r15  # imm = 0x2000000200001
movl $0x0, 0xc(%rsp)
xorl %ebx, %ebx
movq %rbp, %rax
movzbl (%rax), %ecx
leal -0x2a(%rcx), %edx
cmpl $0x31, %edx
ja 0x13e9
btq %rdx, %r15
jb 0x1427
incq %rax
incq %rbx
testb %cl, %cl
jne 0x13d8
movq %r12, %rdi
callq 0x165c
movq %rax, %r12
movq %rbp, %rdi
leaq 0x1dce(%rip), %rsi      # 0x31d6
callq 0x16ea
movq 0x3cf4(%rip), %rcx      # 0x5108
leaq 0x8(%rcx), %r13
movq %r13, 0x3ce9(%rip)      # 0x5108
movq %rax, (%rcx)
jmp 0x15e7
movq %rbp, %rdi
callq 0x10d0
cmpq $0x1000, %rax           # imm = 0x1000
jb 0x1451
movl $0x2, %edi
leaq 0x1de6(%rip), %rsi      # 0x3229
leaq 0x1cf6(%rip), %rdx      # 0x3140
xorl %eax, %eax
callq 0x19b0
testq %rbx, %rbx
je 0x147f
movb -0x1(%rbp,%rbx), %al
andb $0x7f, %al
decq %rbx
cmpb $0x2f, %al
jne 0x1451
testq %rbx, %rbx
movq %rbp, %r15
leaq 0x1(%rbp,%rbx), %rbp
leaq 0x1cdc(%rip), %rax      # 0x3151
cmoveq %rax, %r15
movb $-0x80, -0x1(%rbp)
jmp 0x1486
leaq 0x1d50(%rip), %r15      # 0x31d6
cmpb $0x0, (%r15)
movq %r15, %rax
leaq 0x1d6e(%rip), %rcx      # 0x3202
cmoveq %rcx, %rax
movb $0x0, 0x20(%rsp)
xorl %ecx, %ecx
movq %r12, 0x18(%rsp)
movb (%rax,%rcx), %dl
andb $0x7f, %dl
movb %dl, 0x20(%rsp,%rcx)
je 0x14be
incq %rcx
cmpq $0x1000, %rcx           # imm = 0x1000
jne 0x14a4
jmp 0x14d0
leaq 0x20(%rsp), %rdi
callq 0x10c0
movq %rax, %r12
testq %rax, %rax
jne 0x14ed
movl $0x2, %edi
leaq 0x1d4d(%rip), %rsi      # 0x3229
leaq 0x1c70(%rip), %rdx      # 0x3153
xorl %eax, %eax
callq 0x19b0
xorl %r12d, %r12d
movq 0x3c14(%rip), %rbx      # 0x5108
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r12, %rdi
callq 0x1170
testq %rax, %rax
je 0x1565
movq %rax, %r13
cmpb $0x2e, 0x13(%rax)
jne 0x151d
movb (%rbp), %al
andb $0x7f, %al
cmpb $0x2e, %al
jne 0x14fe
addq $0x13, %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x181a
testb %al, %al
je 0x14fe
movq 0x10(%rsp), %rdi
callq 0x165c
movq %rax, 0x10(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x16ea
movq 0x3bb7(%rip), %rcx      # 0x5108
leaq 0x8(%rcx), %rdx
movq %rdx, 0x3bac(%rip)      # 0x5108
movq %rax, (%rcx)
incl 0xc(%rsp)
jmp 0x14fe
subq 0x18(%rsp), %rbx
movq %r12, %rdi
callq 0x1120
movq 0x10(%rsp), %r12
addq %r12, %rbx
movq 0x3b87(%rip), %r13      # 0x5108
movq %r13, %rax
subq %rbx, %rax
cmpq $0x9, %rax
jl 0x15dd
movq %r14, 0x18(%rsp)
leaq 0x8(%rbx), %r14
cmpq %r13, %r14
jae 0x15c4
movq %r14, %rbp
movq (%rbx), %r15
movq (%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1140
testl %eax, %eax
jle 0x15bb
movq %r12, (%rbx)
movq %r15, (%rbp)
addq $0x8, %rbp
cmpq %r13, %rbp
jb 0x159e
movq %r13, %rax
subq %r14, %rax
movq %r14, %rbx
cmpq $0x8, %rax
jg 0x1592
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r14
movabsq $0x2000000200001, %r15  # imm = 0x2000000200001
movq $0x0, (%r13)
movq 0x8(%r14), %rbp
addq $0x8, %r14
testq %rbp, %rbp
jne 0x13d3
movq $0x0, 0x3afd(%rip) # 0x5108
cmpl $0x0, 0xc(%rsp)
jne 0x1639
jmp 0x161f
movq $0x0, 0x3ae9(%rip) # 0x5108
leaq 0x1c03(%rip), %rsi      # 0x3229
leaq 0x1b0a(%rip), %rdx      # 0x3137
movl $0x2, %edi
xorl %eax, %eax
callq 0x19b0
movq (%r12), %rdi
movq %r12, %rsi
callq 0x1fad
movl $0x2, %eax
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq