// File: /workspace/github_c_makefile_star2_O1/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 0x9bd(%rip), %rdi       # 0x1ca6
callq 0x1c34
movq %rbx, %r15
movq (%rbx), %rdi
callq 0x1c41
callq 0x10b0
movl %eax, %edi
callq 0x1c95
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 0x19c8
cmpl $0x1, %ebp
jg 0x1362
leaq 0x1eda(%rip), %rsi      # 0x3229
leaq 0x1dc9(%rip), %rdx      # 0x311f
movl $0x2, %edi
xorl %eax, %eax
callq 0x19c8
movl $0x400, %edi            # imm = 0x400
callq 0x1180
movq %rax, %rbp
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 0x19c8
movq $0x0, (%rbp)
movq %rbp, 0x3d68(%rip)      # 0x5108
movq %rbp, %rax
addq $0x3f8, %rax            # imm = 0x3F8
movq %rax, 0x3d60(%rip)      # 0x5110
movq 0x8(%r14), %r13
testq %r13, %r13
je 0x1617
addq $0x8, %r14
movabsq $0x2000000200001, %r15  # imm = 0x2000000200001
movl $0x0, 0xc(%rsp)
xorl %ebx, %ebx
movq %r13, %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 %rbp, %rdi
callq 0x1665
movq %rax, %rbp
movq %r13, %rdi
leaq 0x1dce(%rip), %rsi      # 0x31d6
callq 0x16f0
movq 0x3cf4(%rip), %rcx      # 0x5108
leaq 0x8(%rcx), %r13
movq %r13, 0x3ce9(%rip)      # 0x5108
movq %rax, (%rcx)
jmp 0x15f4
movq %r13, %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 0x19c8
testq %rbx, %rbx
je 0x1481
movb -0x1(%r13,%rbx), %al
andb $0x7f, %al
decq %rbx
cmpb $0x2f, %al
jne 0x1451
testq %rbx, %rbx
movq %r13, %r15
leaq 0x1(%r13,%rbx), %r13
leaq 0x1cdb(%rip), %rax      # 0x3151
cmoveq %rax, %r15
movb $-0x80, -0x1(%r13)
jmp 0x1488
leaq 0x1d4e(%rip), %r15      # 0x31d6
cmpb $0x0, (%r15)
movq %r15, %rax
leaq 0x1d6c(%rip), %rcx      # 0x3202
cmoveq %rcx, %rax
movb $0x0, 0x20(%rsp)
movb (%rax), %cl
andb $0x7f, %cl
movb %cl, 0x20(%rsp)
je 0x14c8
movl $0x1, %ecx
cmpq $0x1000, %rcx           # imm = 0x1000
je 0x14d7
movb (%rax,%rcx), %dl
andb $0x7f, %dl
movb %dl, 0x20(%rsp,%rcx)
leaq 0x1(%rcx), %rcx
jne 0x14af
leaq 0x20(%rsp), %rdi
callq 0x10c0
movq %rax, %r12
jmp 0x14da
xorl %r12d, %r12d
testq %r12, %r12
jne 0x14f9
movl $0x2, %edi
leaq 0x1d3e(%rip), %rsi      # 0x3229
leaq 0x1c61(%rip), %rdx      # 0x3153
xorl %eax, %eax
callq 0x19c8
movq 0x3c08(%rip), %rbx      # 0x5108
movq %rbp, 0x18(%rsp)
movq %rbp, 0x10(%rsp)
movq %r12, %rdi
callq 0x1170
testq %rax, %rax
je 0x1572
movq %rax, %rbp
cmpb $0x2e, 0x13(%rax)
jne 0x152a
movb (%r13), %al
andb $0x7f, %al
cmpb $0x2e, %al
jne 0x150a
addq $0x13, %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x1820
testb %al, %al
je 0x150a
movq 0x10(%rsp), %rdi
callq 0x1665
movq %rax, 0x10(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x16f0
movq 0x3baa(%rip), %rcx      # 0x5108
leaq 0x8(%rcx), %rdx
movq %rdx, 0x3b9f(%rip)      # 0x5108
movq %rax, (%rcx)
incl 0xc(%rsp)
jmp 0x150a
subq 0x18(%rsp), %rbx
movq %r12, %rdi
callq 0x1120
movq 0x10(%rsp), %rbp
addq %rbp, %rbx
movq 0x3b7a(%rip), %r13      # 0x5108
movq %r13, %rax
subq %rbx, %rax
cmpq $0x9, %rax
jl 0x15ea
movq %r14, 0x18(%rsp)
leaq 0x8(%rbx), %r14
cmpq %r13, %r14
jae 0x15d1
movq %r14, %rbp
movq (%rbx), %r15
movq (%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1140
testl %eax, %eax
jle 0x15c8
movq %r12, (%rbx)
movq %r15, (%rbp)
addq $0x8, %rbp
cmpq %r13, %rbp
jb 0x15ab
movq %r13, %rax
subq %r14, %rax
movq %r14, %rbx
cmpq $0x8, %rax
jg 0x159f
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %r14
movabsq $0x2000000200001, %r15  # imm = 0x2000000200001
movq $0x0, (%r13)
movq 0x8(%r14), %r13
addq $0x8, %r14
testq %r13, %r13
jne 0x13d3
cmpl $0x0, 0xc(%rsp)
sete %al
jmp 0x1619
movb $0x1, %al
movq $0x0, 0x3ae4(%rip) # 0x5108
testb %al, %al
je 0x1642
leaq 0x1bfa(%rip), %rsi      # 0x3229
leaq 0x1b01(%rip), %rdx      # 0x3137
movl $0x2, %edi
xorl %eax, %eax
callq 0x19c8
movq (%rbp), %rdi
movq %rbp, %rsi
callq 0x1f81
movl $0x2, %eax
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq