// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x6dec(%rip), %rdx      # 0xb0f0
callq 0x4180
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
je 0x4478
movl -0x18(%rbp), %eax
addl $-0x3a, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x3a, %eax
ja 0x433c
movq -0x30(%rbp), %rax
leaq 0x6cd3(%rip), %rcx      # 0xb004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x433c
movl $0x1, %edi
callq 0x4550
xorl %edi, %edi
callq 0x4550
leaq 0xbf84(%rip), %rax      # 0x102d8
movl $0x1, 0x4(%rax)
jmp 0x4473
leaq 0xbf71(%rip), %rax      # 0x102d8
movl $0x1, 0x8(%rax)
jmp 0x4473
callq 0x41d0
movq (%rax), %rax
movq 0x9c56(%rip), %rcx      # 0xdfd8
movq (%rcx), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x43b4
movq 0x9c38(%rip), %rax      # 0xdfd8
movq (%rax), %rax
movsbl (%rax), %ecx
subl $0x30, %ecx
leaq 0xbf28(%rip), %rax      # 0x102d8
movl %ecx, (%rax)
jmp 0x43cc
movq 0x9c1d(%rip), %rax      # 0xdfd8
movq (%rax), %rsi
leaq 0x6d39(%rip), %rdi      # 0xb0fe
movb $0x0, %al
callq 0x40b0
jmp 0x4473
movq 0x9c00(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
leaq 0x6d30(%rip), %rsi      # 0xb112
movl $0x3, %edx
callq 0x4070
cmpl $0x0, %eax
jne 0x440c
movq 0x9be0(%rip), %rax      # 0xdfd8
movq (%rax), %rcx
addq $0x3, %rcx
leaq 0xbed2(%rip), %rax      # 0x102d8
movq %rcx, 0x10(%rax)
jmp 0x4424
movq 0x9bc5(%rip), %rax      # 0xdfd8
movq (%rax), %rsi
leaq 0x6cf9(%rip), %rdi      # 0xb116
movb $0x0, %al
callq 0x40b0
jmp 0x4473
jmp 0x4473
movq 0x9ba9(%rip), %rax      # 0xdfd8
movq (%rax), %rcx
leaq 0xbe9f(%rip), %rax      # 0x102d8
movq %rcx, 0x18(%rax)
jmp 0x4473
movq 0x9b92(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
callq 0x4580
movl %eax, %ecx
leaq 0xbe81(%rip), %rax      # 0x102d8
movl %ecx, 0x20(%rax)
leaq 0xbe77(%rip), %rax      # 0x102d8
cmpl $0x0, 0x20(%rax)
jge 0x4471
movl $0x1, %edi
callq 0x4550
jmp 0x4473
jmp 0x42f6
movq 0x9b51(%rip), %rax      # 0xdfd0
movl (%rax), %ecx
movl -0x8(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8(%rbp)
movq 0x9b40(%rip), %rax      # 0xdfd0
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
leaq 0xbe2d(%rip), %rax      # 0x102d8
cmpl $0x0, 0x20(%rax)
jne 0x44b6
callq 0x7130
cmpl $0x0, -0x8(%rbp)
jne 0x44d4
movq 0x9b05(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x6c5d(%rip), %rsi      # 0xb12a
callq 0x7840
jmp 0x4548
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x4546
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x7612(%rip), %rsi      # 0xbb10
callq 0x4170
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x4525
movq -0x20(%rbp), %rdx
movl $0x1, %edi
leaq 0x6c12(%rip), %rsi      # 0xb130
movb $0x0, %al
callq 0x4130
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x7840
movq -0x28(%rbp), %rdi
callq 0x4090
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x44db
jmp 0x4548
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq