// File: /workspace/github_c_makefile_star2_O3/ksherlock[P]nroff_man/main.c
// Function: main
int main(int argc, char **argv) {

	int i;
	int ch;

#ifdef __STACK_CHECK__
    _beginStackCheck();
    atexit(printStack);
#endif

	while (( ch = getopt(argc, argv, "m:hW:I:ibt:T:")) != -1) {
		switch(ch) {
			case '?': case ':':
			default: usage(1);
			case 'h': usage(0);
			case 'i': flags.i = 1; break;
			case 'b': flags.b = 1; break;
			case 'W':
				if (isdigit(*optarg))
					flags.W = *optarg - '0';
				else
					warnx("-W %s: Bad argument", optarg);
				break;
			case 'I':
				if (strncmp(optarg, "os=", 3) == 0)
					flags.os = optarg + 3;
				else
					warnx("-I %s: Bad argument", optarg);
				break;
			case 'm': /* silently accept -man */
				break;

			case 't':
				flags.t = optarg;
				break;
			case 'T':
				flags.T = parseT(optarg);
				if (flags.T < 0) usage(1);

				break;
		}
	}

	argc -= optind;
	argv += optind;


	if (flags.T == FMT_TERMCAP)
		tc_init();

	if (argc == 0) {
		man(stdin, "stdin");
	} else {
		for (i = 0; i < argc; ++i) {
			char *cp = argv[i];
			FILE *fp = fopen(cp, "r");
			if (!fp) err(1, "Unable to open %s", cp);
			man(fp, cp);
			fclose(fp);
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
leaq 0x4aa1(%rip), %r15      # 0x9004
movq 0x9a6e(%rip), %rbp      # 0xdfd8
leaq 0x9e07(%rip), %r13      # 0xe378
leaq 0x4aae(%rip), %r12      # 0x9026
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4170
cmpl $0x61, %eax
jle 0x45ab
cmpl $0x6c, %eax
jg 0x45e9
cmpl $0x62, %eax
je 0x462f
cmpl $0x69, %eax
jne 0x477d
movl $0x1, 0x4(%r13)
jmp 0x4578
cmpl $0x53, %eax
jle 0x4604
cmpl $0x54, %eax
je 0x463c
cmpl $0x57, %eax
jne 0x475d
callq 0x41c0
movq (%rax), %rcx
movq (%rbp), %rsi
movsbq (%rsi), %rax
testb $0x8, 0x1(%rcx,%rax,2)
jne 0x467e
leaq 0x4a2e(%rip), %rdi      # 0x9012
jmp 0x4672
cmpl $0x6d, %eax
je 0x4578
cmpl $0x74, %eax
jne 0x475d
movq (%rbp), %rax
movq %rax, 0x18(%r13)
jmp 0x4578
cmpl $0x49, %eax
jne 0x46bf
movq (%rbp), %rsi
cmpb $0x6f, (%rsi)
jne 0x466f
cmpb $0x73, 0x1(%rsi)
jne 0x466f
cmpb $0x3d, 0x2(%rsi)
jne 0x466f
addq $0x3, %rsi
movq %rsi, 0x10(%r13)
jmp 0x4578
movl $0x1, 0x8(%r13)
jmp 0x4578
movq (%rbp), %rdi
testq %rdi, %rdi
je 0x4755
movzbl (%rdi), %eax
cmpl $0x61, %eax
je 0x469d
cmpl $0x70, %eax
je 0x468a
cmpl $0x74, %eax
jne 0x4755
leaq 0x4aa7(%rip), %rsi      # 0x910d
callq 0x40f0
xorl %ecx, %ecx
jmp 0x46ae
movq %r12, %rdi
xorl %eax, %eax
callq 0x40a0
jmp 0x4578
addl $-0x30, %eax
movl %eax, (%r13)
jmp 0x4578
leaq 0x4a8a(%rip), %rsi      # 0x911b
callq 0x40f0
movl $0x2, %ecx
jmp 0x46ae
leaq 0x4a71(%rip), %rsi      # 0x9115
callq 0x40f0
movl $0x1, %ecx
testl %eax, %eax
jne 0x4755
movl %ecx, 0x20(%r13)
jmp 0x4578
cmpl $-0x1, %eax
jne 0x475d
movq 0x9901(%rip), %rax      # 0xdfd0
movslq (%rax), %r15
cmpl $0x0, 0x20(%r13)
jne 0x46de
callq 0x62fc
cmpl %r15d, %ebx
jne 0x46fb
movq 0x98de(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x4946(%rip), %rsi      # 0x903a
callq 0x67e9
jmp 0x4744
subl %r15d, %ebx
testl %ebx, %ebx
jle 0x4744
leaq (%r14,%r15,8), %r12
movl %ebx, %r13d
xorl %ebp, %ebp
leaq 0x4eb6(%rip), %rbx      # 0x95c8
movq (%r12,%rbp,8), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4160
testq %rax, %rax
je 0x479f
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x67e9
movq %r15, %rdi
callq 0x4080
incq %rbp
cmpq %rbp, %r13
jne 0x4712
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, 0x20(%r13) # imm = 0xFFFFFFFF
movq 0x985c(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
leaq 0x48e4(%rip), %rdi      # 0x9052
callq 0x40b0
movl $0x1, %edi
callq 0x4180
cmpl $0x68, %eax
jne 0x475d
movq 0x9837(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
leaq 0x48bf(%rip), %rdi      # 0x9052
callq 0x40b0
xorl %edi, %edi
callq 0x4180
leaq 0x489a(%rip), %rsi      # 0x9040
movl $0x1, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x4120
nopl (%rax)