// File: /workspace/github_cpp_makefile_star2_O1/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 0x474c
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 0x4691
leaq 0x9f24(%rip), %rdi      # 0xe5b0
callq 0x4d54
movq (%r12), %rax
movslq 0x9fc4(%rip), %rcx      # 0xe660
leal 0x1(%rcx), %edx
movl %edx, 0x9fbb(%rip)      # 0xe660
movq 0x9f04(%rip), %rdx      # 0xe5b0
movq %rax, (%rdx,%rcx,8)
jmp 0x45f8
movl $0x1, 0x9ed5(%rip)      # 0xe594
jmp 0x45f8
movl 0xa04e(%rip), %esi      # 0xe718
cmpl %esi, 0x9fa0(%rip)      # 0xe670
jg 0x46de
leaq 0x9f8f(%rip), %rdi      # 0xe668
callq 0x4d54
movq (%r12), %rax
movslq 0xa02f(%rip), %rcx      # 0xe718
leal 0x1(%rcx), %edx
movl %edx, 0xa026(%rip)      # 0xe718
movq 0x9f6f(%rip), %rdx      # 0xe668
movq %rax, (%rdx,%rcx,8)
jmp 0x45f8
movl $0x1, 0x9e9c(%rip)      # 0xe5a8
jmp 0x45f8
movl $0x1, 0x9e85(%rip)      # 0xe5a0
jmp 0x45f8
movl $0x1, 0x9e62(%rip)      # 0xe58c
orb $0x1, 0x9a44(%rip)      # 0xe175
jmp 0x45f8
movl $0x1, 0x9e48(%rip)      # 0xe588
orb $0x1, 0x9a2d(%rip)      # 0xe174
jmp 0x45f8
movslq 0x9f0d(%rip), %rax      # 0xe660
movl 0x9fbf(%rip), %ecx      # 0xe718
addl %eax, %ecx
jne 0x478c
movq 0x9874(%rip), %rcx      # 0xdfd8
movslq (%rcx), %rdx
cmpl %ebp, %edx
jge 0x4888
leal 0x1(%rdx), %esi
movl %esi, (%rcx)
movq (%rbx,%rdx,8), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x9edf(%rip)      # 0xe660
movq 0x9e28(%rip), %rdx      # 0xe5b0
movq %rcx, (%rdx,%rax,8)
movl 0x9df6(%rip), %eax      # 0xe588
addl 0x9df4(%rip), %eax      # 0xe58c
cmpl $0x2, %eax
jge 0x487f
callq 0x48b5
movq 0x982b(%rip), %r12      # 0xdfd8
movl %ebp, %eax
subl (%r12), %eax
movl %eax, 0xa2c7(%rip)      # 0xea80
jle 0x4833
movl (%r12), %eax
cmpl %ebp, %eax
jge 0x4849
leaq 0x4fcc(%rip), %r14      # 0x979a
cltq
movq (%rbx,%rax,8), %rdi
movq %r14, %rsi
callq 0x41b0
testq %rax, %rax
je 0x47fe
movq %rax, %r15
movslq (%r12), %rax
movq (%rbx,%rax,8), %rsi
movq %r15, %rdi
callq 0x49cc
movq %r15, %rdi
callq 0x4160
jmp 0x4811
cmpl $0x0, 0x9d9b(%rip)      # 0xe5a0
je 0x486e
movl $0x2, 0x995f(%rip)      # 0xe170
cmpl $0x0, 0x9d80(%rip)      # 0xe598
je 0x4823
cmpl $0x0, 0xa25b(%rip)      # 0xea7c
jne 0x4849
movl (%r12), %eax
incl %eax
movl %eax, (%r12)
cmpl %ebp, %eax
jl 0x47ce
jmp 0x4849
movq 0x978e(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x48d8(%rip), %rsi      # 0x911c
callq 0x49cc
xorl %eax, %eax
cmpl $0x0, 0xa22a(%rip)      # 0xea7c
jne 0x485a
movl 0x9916(%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 0x48b0(%rip), %rdi      # 0x912d
jmp 0x4896
leaq 0x487b(%rip), %rdi      # 0x9101
jmp 0x488f
leaq 0x4867(%rip), %rdi      # 0x90f6
leaq 0x485f(%rip), %rsi      # 0x90f5
callq 0x42d0
movl $0x2, %edi
callq 0x41c0