// File: /workspace/github_c_makefile_star2_O2/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, %r12
movl %edi, %ebp
leaq 0x935(%rip), %rdi       # 0x1c1e
callq 0x1bae
movq (%r12), %rdi
callq 0x1bbb
callq 0x10b0
movl %eax, %edi
callq 0x1c0d
callq 0x1110
movl %eax, %ebx
callq 0x10e0
cmpl %eax, %ebx
jne 0x1323
callq 0x1190
movl %eax, %ebx
callq 0x1160
cmpl %eax, %ebx
je 0x133b
leaq 0x1eff(%rip), %rsi      # 0x3229
leaq 0x1dd6(%rip), %rdx      # 0x3107
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x194c
cmpl $0x1, %ebp
jg 0x1358
leaq 0x1ee2(%rip), %rsi      # 0x3229
leaq 0x1dd1(%rip), %rdx      # 0x311f
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x194c
movl $0x400, %edi            # imm = 0x400
callq 0x1180
movq %rax, %r15
testq %rax, %rax
jne 0x1382
leaq 0x1eb8(%rip), %rsi      # 0x3229
leaq 0x1db1(%rip), %rdx      # 0x3129
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x194c
andq $0x0, (%r15)
movq %r15, 0x3d7b(%rip)      # 0x5108
movq %r15, %rax
addq $0x3f8, %rax            # imm = 0x3F8
movq %rax, 0x3d73(%rip)      # 0x5110
movabsq $0x2000000200001, %r14  # imm = 0x2000000200001
movl $0x0, 0x14(%rsp)
movq 0x8(%r12), %r13
testq %r13, %r13
je 0x15d7
addq $0x8, %r12
xorl %ebx, %ebx
movq %r13, %rax
movzbl (%rax), %ecx
leal -0x2a(%rcx), %edx
cmpl $0x31, %edx
ja 0x13d7
btq %rdx, %r14
jb 0x1417
incq %rax
incq %rbx
testb %cl, %cl
jne 0x13c6
movq %r15, %rdi
callq 0x161e
movq %rax, 0x8(%rsp)
movq %r13, %rdi
leaq 0x1dde(%rip), %rsi      # 0x31d6
callq 0x16aa
movq 0x3d04(%rip), %rcx      # 0x5108
leaq 0x8(%rcx), %r15
movq %r15, 0x3cf9(%rip)      # 0x5108
movq %rax, (%rcx)
jmp 0x15c9
movq %r13, %rdi
callq 0x10d0
cmpq $0x1000, %rax           # imm = 0x1000
jb 0x143f
pushq $0x2
popq %rdi
leaq 0x1df8(%rip), %rsi      # 0x3229
leaq 0x1d08(%rip), %rdx      # 0x3140
xorl %eax, %eax
callq 0x194c
movq %r12, 0x18(%rsp)
testq %rbx, %rbx
je 0x1477
movb -0x1(%r13,%rbx), %al
andb $0x7f, %al
decq %rbx
cmpb $0x2f, %al
jne 0x1444
movq %r15, %r12
testq %rbx, %rbx
movq %r13, %r15
leaq 0x1(%r13,%rbx), %r13
leaq 0x1ce5(%rip), %rax      # 0x3151
cmoveq %rax, %r15
movb $-0x80, -0x1(%r13)
jmp 0x1481
movq %r15, %r12
leaq 0x1d55(%rip), %r15      # 0x31d6
cmpb $0x0, (%r15)
movq %r15, %rax
leaq 0x1d73(%rip), %rcx      # 0x3202
cmoveq %rcx, %rax
movb $0x0, 0x20(%rsp)
xorl %ecx, %ecx
cmpq $0x1000, %rcx           # imm = 0x1000
je 0x14c6
movb (%rax,%rcx), %dl
andb $0x7f, %dl
movb %dl, 0x20(%rsp,%rcx)
je 0x14b4
incq %rcx
jmp 0x149a
leaq 0x20(%rsp), %rdi
callq 0x10c0
movq %rax, %rbp
testq %rax, %rax
jne 0x14e0
pushq $0x2
popq %rdi
leaq 0x1d59(%rip), %rsi      # 0x3229
leaq 0x1c7c(%rip), %rdx      # 0x3153
xorl %eax, %eax
callq 0x194c
xorl %ebp, %ebp
movq 0x3c21(%rip), %r14      # 0x5108
movq %r12, 0x8(%rsp)
movq %rbp, %rdi
callq 0x1170
testq %rax, %rax
je 0x1554
movq %rax, %rbx
cmpb $0x2e, 0x13(%rax)
jne 0x150c
movb (%r13), %al
andb $0x7f, %al
cmpb $0x2e, %al
jne 0x14ec
addq $0x13, %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x17cc
testb %al, %al
je 0x14ec
movq 0x8(%rsp), %rdi
callq 0x161e
movq %rax, 0x8(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x16aa
movq 0x3bc8(%rip), %rcx      # 0x5108
leaq 0x8(%rcx), %rdx
movq %rdx, 0x3bbd(%rip)      # 0x5108
movq %rax, (%rcx)
incl 0x14(%rsp)
jmp 0x14ec
subq %r12, %r14
movq %rbp, %rdi
callq 0x1120
movq 0x8(%rsp), %rax
leaq (%rax,%r14), %r13
movq 0x3b99(%rip), %r15      # 0x5108
leaq (%rax,%r14), %r12
addq $0x8, %r12
movq %r15, %rax
subq %r13, %rax
cmpq $0x9, %rax
jl 0x15ba
movq %r12, %rbp
cmpq %r15, %rbp
jae 0x15b0
movq (%r13), %rbx
movq (%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1140
testl %eax, %eax
jle 0x15aa
movq %r14, (%r13)
movq %rbx, (%rbp)
addq $0x8, %rbp
jmp 0x1586
addq $0x8, %r13
addq $0x8, %r12
jmp 0x1577
movq 0x18(%rsp), %r12
movabsq $0x2000000200001, %r14  # imm = 0x2000000200001
andq $0x0, (%r15)
movq 0x8(%rsp), %r15
jmp 0x13af
andq $0x0, 0x3b29(%rip)      # 0x5108
cmpl $0x0, 0x14(%rsp)
jne 0x15fe
leaq 0x1c3c(%rip), %rsi      # 0x3229
leaq 0x1b43(%rip), %rdx      # 0x3137
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x194c
movq (%r15), %rdi
movq %r15, %rsi
callq 0x1f28
pushq $0x2
popq %rax
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq