// File: /workspace/github_cpp_makefile_star2_O3/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 0x4a99(%rip), %r14      # 0x907c
leaq 0x4a1a(%rip), %r13      # 0x9004
leaq 0x4a33(%rip), %r15      # 0x9024
movq 0x99c0(%rip), %r12      # 0xdfb8
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4070
leal -0x63(%rax), %ecx
cmpl $0x15, %ecx
ja 0x4622
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
jmpq *%rax
movl $0x1, 0x9f70(%rip)      # 0xe590
jmp 0x45f8
addl $-0x3f, %eax
cmpl $0x7, %eax
ja 0x4746
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
orb $0x2, 0x9b36(%rip)      # 0xe175
jmp 0x45f8
movl $0x1, 0x9f59(%rip)      # 0xe5a4
jmp 0x45f8
orb $-0x80, 0x9b20(%rip)    # 0xe174
jmp 0x45f8
orb $0x2, 0x9b17(%rip)      # 0xe174
jmp 0x45f8
movl $0x1, 0x9f2f(%rip)      # 0xe598
jmp 0x45f8
movl $0x1, 0x9f27(%rip)      # 0xe59c
jmp 0x45f8
movl 0x9fe3(%rip), %esi      # 0xe660
cmpl %esi, 0x9f35(%rip)      # 0xe5b8
jg 0x4697
leaq 0x9f24(%rip), %rdi      # 0xe5b0
callq 0x4d72
movl 0x9fc9(%rip), %esi      # 0xe660
movq (%r12), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0x9fbc(%rip)      # 0xe660
movq 0x9f05(%rip), %rcx      # 0xe5b0
jmp 0x46f0
movl $0x1, 0x9edd(%rip)      # 0xe594
jmp 0x45f8
movl 0xa056(%rip), %esi      # 0xe718
cmpl %esi, 0x9fa8(%rip)      # 0xe670
jg 0x46dc
leaq 0x9f97(%rip), %rdi      # 0xe668
callq 0x4d72
movl 0xa03c(%rip), %esi      # 0xe718
movq (%r12), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0xa02f(%rip)      # 0xe718
movq 0x9f78(%rip), %rcx      # 0xe668
movslq %esi, %rdx
movq %rax, (%rcx,%rdx,8)
jmp 0x45f8
movl $0x1, 0x9ea2(%rip)      # 0xe5a8
jmp 0x45f8
movl $0x1, 0x9e8b(%rip)      # 0xe5a0
jmp 0x45f8
movl $0x1, 0x9e68(%rip)      # 0xe58c
orb $0x1, 0x9a4a(%rip)      # 0xe175
jmp 0x45f8
movl $0x1, 0x9e4e(%rip)      # 0xe588
orb $0x1, 0x9a33(%rip)      # 0xe174
jmp 0x45f8
movslq 0x9f13(%rip), %rax      # 0xe660
movl 0x9fc5(%rip), %ecx      # 0xe718
addl %eax, %ecx
jne 0x4786
movq 0x987a(%rip), %rcx      # 0xdfd8
movslq (%rcx), %rdx
cmpl %ebp, %edx
jge 0x487e
leal 0x1(%rdx), %esi
movl %esi, (%rcx)
movq (%rbx,%rdx,8), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x9ee5(%rip)      # 0xe660
movq 0x9e2e(%rip), %rdx      # 0xe5b0
movq %rcx, (%rdx,%rax,8)
movl 0x9dfc(%rip), %eax      # 0xe588
addl 0x9dfa(%rip), %eax      # 0xe58c
cmpl $0x2, %eax
jge 0x4875
callq 0x48ab
movq 0x9831(%rip), %r12      # 0xdfd8
movl (%r12), %eax
movl %ebp, %ecx
subl %eax, %ecx
movl %ecx, 0xa2cb(%rip)      # 0xea80
jle 0x4829
jle 0x483f
leaq 0x4fe6(%rip), %r14      # 0x97aa
cltq
movq (%rbx,%rax,8), %rdi
movq %r14, %rsi
callq 0x41b0
testq %rax, %rax
je 0x47f4
movq %rax, %r15
movslq (%r12), %rax
movq (%rbx,%rax,8), %rsi
movq %r15, %rdi
callq 0x49df
movq %r15, %rdi
callq 0x4160
jmp 0x4807
cmpl $0x0, 0x9da5(%rip)      # 0xe5a0
je 0x4864
movl $0x2, 0x9969(%rip)      # 0xe170
cmpl $0x0, 0x9d8a(%rip)      # 0xe598
je 0x4819
cmpl $0x0, 0xa265(%rip)      # 0xea7c
jne 0x483f
movl (%r12), %eax
incl %eax
movl %eax, (%r12)
cmpl %ebp, %eax
jl 0x47c4
jmp 0x483f
movq 0x9798(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x48e2(%rip), %rsi      # 0x911c
callq 0x49df
xorl %eax, %eax
cmpl $0x0, 0xa234(%rip)      # 0xea7c
jne 0x4850
movl 0x9920(%rip), %eax      # 0xe170
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x42ee
movslq (%r12), %rax
movq (%rbx,%rax,8), %rsi
leaq 0x48ba(%rip), %rdi      # 0x912d
jmp 0x488c
leaq 0x4885(%rip), %rdi      # 0x9101
jmp 0x4885
leaq 0x4871(%rip), %rdi      # 0x90f6
leaq 0x4869(%rip), %rsi      # 0x90f5
callq 0x42d0
movl $0x2, %edi
callq 0x41c0