// File: /workspace/github_cpp_makefile_star2_O2/arnoldrobbins[P]mcilroy-regex/grep.cpp
// Function: main
int
main(int argc, char **argv)
{
	for(;;) {
		switch(getopt(argc, argv, "AEFclqinsvxe:f:h")) {
		case 'A':
			options |= REG_AUGMENTED;
			if(REG_AUGMENTED)
				continue;
			
		case '?':
			fprintf(stderr,
			  "usage: grep -EFclqinsvxh pattern [file] ...\n"
			  "       grep -EFclqinsvxh -ef pattern-or-file ... [file] ...\n");
			exit(2);
		case 'E':
			Eflag = 1;
			options |= REG_EXTENDED;
			continue;
		case 'F':
			Fflag = 1;
			options |= REG_LITERAL;
			continue;
		case 'c':
			cflag = 1;
			continue;
		case 'l':
			lflag = 1;
			continue;
		case 'q':
			qflag = 1;
			continue;
		case 'i':
			options |= REG_ICASE;
			continue;
		case 'n':
			nflag = 1;
			continue;
		case 's':
			sflag = 1;
			continue;
		case 'v':
			vflag = 1;
			continue;
		case 'x':
			options |= REG_ANCH;
			continue;
		case 'h':
			hflag = 1;
			continue;
		case 'e':
			argpat.assure(nargpat);
			argpat[nargpat++] = optarg;
			continue;
		case 'f':
			filepat.assure(nfilepat);
			filepat[nfilepat++] = optarg;
			continue;
		case -1:
			break;
		}
		break;
	}
	if(nargpat + nfilepat == 0) {
		if(optind >= argc)
			error("no pattern", "");
		else
			argpat[nargpat++] = argv[optind++];
	}
	if(Fflag+Eflag > 1)
		error("-E and -F are incompatible", "");
	grepcomp();
	nfiles = argc - optind;
	if(nfiles <= 0)
		execute(stdin, "(standard input)");
	else for( ; optind<argc; optind++) {
		FILE *input = fopen(argv[optind], "r");
		if(input) {
			execute(input, argv[optind]);
			fclose(input);
		} else if(!sflag)
			error("cannot open", argv[optind]);
		else
			retval = 2;
		if(qflag && anyhits)
			break;
	}
	return anyhits? 0: retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4be9(%rip), %r14      # 0x907c
leaq 0x4b6a(%rip), %r13      # 0x9004
leaq 0x4b83(%rip), %r15      # 0x9024
movq 0x9b10(%rip), %r12      # 0xdfb8
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4070
leal -0x63(%rax), %ecx
cmpl $0x15, %ecx
ja 0x44d2
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
jmpq *%rax
movl $0x1, 0xa0c0(%rip)      # 0xe590
jmp 0x44a8
addl $-0x3f, %eax
cmpl $0x7, %eax
ja 0x45ec
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
orb $0x2, 0x9c86(%rip)      # 0xe175
jmp 0x44a8
movl $0x1, 0xa0a9(%rip)      # 0xe5a4
jmp 0x44a8
orb $-0x80, 0x9c70(%rip)    # 0xe174
jmp 0x44a8
orb $0x2, 0x9c67(%rip)      # 0xe174
jmp 0x44a8
movl $0x1, 0xa07f(%rip)      # 0xe598
jmp 0x44a8
movl $0x1, 0xa077(%rip)      # 0xe59c
jmp 0x44a8
movl 0xa133(%rip), %esi      # 0xe660
leaq 0xa07c(%rip), %rdi      # 0xe5b0
callq 0x4c1c
movq (%r12), %rax
movslq 0xa11c(%rip), %rcx      # 0xe660
leal 0x1(%rcx), %edx
movl %edx, 0xa113(%rip)      # 0xe660
movq 0xa05c(%rip), %rdx      # 0xe5b0
movq %rax, (%rdx,%rcx,8)
jmp 0x44a8
movl $0x1, 0xa02d(%rip)      # 0xe594
jmp 0x44a8
movl 0xa1a6(%rip), %esi      # 0xe718
leaq 0xa0ef(%rip), %rdi      # 0xe668
callq 0x4c1c
movq (%r12), %rax
movslq 0xa18f(%rip), %rcx      # 0xe718
leal 0x1(%rcx), %edx
movl %edx, 0xa186(%rip)      # 0xe718
movq 0xa0cf(%rip), %rdx      # 0xe668
movq %rax, (%rdx,%rcx,8)
jmp 0x44a8
movl $0x1, 0x9ffc(%rip)      # 0xe5a8
jmp 0x44a8
movl $0x1, 0x9fe5(%rip)      # 0xe5a0
jmp 0x44a8
movl $0x1, 0x9fc2(%rip)      # 0xe58c
orb $0x1, 0x9ba4(%rip)      # 0xe175
jmp 0x44a8
movl $0x1, 0x9fa8(%rip)      # 0xe588
orb $0x1, 0x9b8d(%rip)      # 0xe174
jmp 0x44a8
movslq 0xa06d(%rip), %rax      # 0xe660
movl 0xa11f(%rip), %ecx      # 0xe718
addl %eax, %ecx
jne 0x462c
movq 0x99d4(%rip), %rcx      # 0xdfd8
movslq (%rcx), %rdx
cmpl %ebp, %edx
jge 0x4744
leal 0x1(%rdx), %esi
movl %esi, (%rcx)
movq (%rbx,%rdx,8), %rcx
leal 0x1(%rax), %edx
movl %edx, 0xa03f(%rip)      # 0xe660
movq 0x9f88(%rip), %rdx      # 0xe5b0
movq %rcx, (%rdx,%rax,8)
movl 0x9f56(%rip), %eax      # 0xe588
addl 0x9f54(%rip), %eax      # 0xe58c
cmpl $0x2, %eax
jge 0x473b
callq 0x4765
movq 0x998b(%rip), %r12      # 0xdfd8
movl (%r12), %eax
movl %ebp, %ecx
subl %eax, %ecx
movl %ecx, 0xa425(%rip)      # 0xea80
jle 0x46cd
leaq 0x5146(%rip), %r14      # 0x97aa
cmpl %ebp, %eax
jge 0x46e3
cltq
movq (%rbx,%rax,8), %rdi
movq %r14, %rsi
callq 0x41b0
testq %rax, %rax
je 0x4698
movq %rax, %r15
movslq (%r12), %rax
movq (%rbx,%rax,8), %rsi
movq %r15, %rdi
callq 0x4872
movq %r15, %rdi
callq 0x4160
jmp 0x46af
cmpl $0x0, 0x9f01(%rip)      # 0xe5a0
je 0x4727
movl $0x2, 0x9ac1(%rip)      # 0xe170
cmpl $0x0, 0x9ee2(%rip)      # 0xe598
je 0x46c1
cmpl $0x0, 0xa3bd(%rip)      # 0xea7c
jne 0x46e3
movl (%r12), %eax
incl %eax
movl %eax, (%r12)
jmp 0x4664
movq 0x98f4(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x4a3e(%rip), %rsi      # 0x911c
callq 0x4872
xorl %eax, %eax
cmpl $0x0, 0xa390(%rip)      # 0xea7c
jne 0x46f4
movl 0x9a7c(%rip), %eax      # 0xe170
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x98c6(%rip), %rax      # 0xdfd0
movq (%rax), %rcx
leaq 0x4979(%rip), %rdi      # 0x908d
pushq $0x68
popq %rsi
pushq $0x1
popq %rdx
callq 0x42b0
pushq $0x2
popq %rdi
callq 0x41c0
movslq (%r12), %rax
movq (%rbx,%rax,8), %rsi
leaq 0x49f7(%rip), %rdi      # 0x912d
callq 0x4757
leaq 0x49bf(%rip), %rdi      # 0x9101
jmp 0x474b
leaq 0x49ab(%rip), %rdi      # 0x90f6
leaq 0x49a3(%rip), %rsi      # 0x90f5
callq 0x4757