// File: /workspace/github_c_makefile_star2_O0/ksherlock[P]nroff_man/read3.c
// Function: man
void man(FILE *fp, const char *filename) {


	unsigned trap = 0;

	PD = 1;
	IP = PP_INDENT;
	RM = 78;
	LM = PP_INDENT;

	th_source = NULL;
	header[0] = 0;
	footer[0] = 0;


	rs_count = 0;
	read_init(fp, filename);


	for(;;) {
		int x;
		const unsigned char *cp = read_text();
		if (type == tkEOF) {
			break;
		}

		switch(type) {
			case tkAT: at(); break;
			case tkUC: uc(); break;
			case tkTH: th(); break;

			case tkLP:
			case tkPP:
			case tkP:
				trap = 0;
				flush(0);
				set_font(FONT_R);
				set_in_ti(LM, -1);
				br_PD();
				break;

			case tkIP:
				/* indented paragraph */
				/* IP [tag [width]] */
				trap = 0;
				flush(0);
				set_font(FONT_R);
				br_PD();
				if (argc >= 2) {
					/* set IP width... */
					IP = get_unit(argv[1], PP_INDENT, -1);
				}

				if (argc >= 1) {
					set_in_ti(LM + IP, LM);
					set_tag(argv[0], IP);
				} else {
					set_in_ti(LM + IP, -1);
				}
				break;

			case tkHP:
				/* hanging paragraph */
				/* .HP [indent] */
				trap = 0;
				flush(0);
				set_font(FONT_R);
				if (argc >= 1) {
					/* set IP width... */
					IP = get_unit(argv[0], PP_INDENT, -1);
				}
				set_in_ti(LM + IP, LM);
				br_PD();
				break;

			case tkTQ:
			case tkTP:
				/* tagged paragraph */
				/*
					.TP [indent]
					tag text
					...

					.TQ is a GNU extension; it is essentially .TP
					without the PD padding.
				*/
				trap = 0;
				flush(0);
				set_font(FONT_R);
				if (argc >= 1) {
					/* set IP width... */
					IP = get_unit(argv[0], PP_INDENT, -1);
				}
				set_in_ti(LM + IP, LM);
				if (type == tkTP) { br_PD(); }
				trap = tkTP;
				break;

			case tkSY:
				/*
					GNU extension
					.SY xxx -> .HP width(xxx) \ \fBxxx\fR
				*/
				/* warned in read2.c */
				trap = 0;
				flush(0);
				if (argc) {
					IP = xstrlen(argv[0]) + 1;					
				}
				set_in_ti(LM + IP, LM);
				br_PD();
				set_tag(argv[0], IP);
				break;
			case tkYS:
				flush(0);
				break;

			case tkEX:
				trap = 0;
				flush(0);
				fi = 0;
				break;
			case tkEE:
				trap = 0;
				fi = 1;
				break;


			case tkPD:
				PD = get_unit(argv[0], 1, -1);
				break;
			case tkRS:
				/* RS [width] */
				flush(0);
				rs_stack[rs_count++] = LM;
				if (argc >= 1) IP = get_unit(argv[0], PP_INDENT, -1);
				LM += IP;
				set_in(LM);
				break;
			case tkRE:
				/* RE [level] */
				/* RE - pop last RS */
				/* RE 1 - pop all RS */
				/* RE 2 - pop all but 1 RS */
				/* etc. */
				flush(0);
				if (argc) {
					int n = get_int(argv[0]);
					if (n < 1) n = 1;
					--n;
					if (n < rs_count) {
						LM = rs_stack[n];
						rs_count = n;
					} else {
						/*warnx("Invalid RS count (%d / %d)", n + 1, rs_count);*/
						man_warnx1s("Invalid RS count %s", argv[0]);
					}

				} else {
					if (rs_count)
						LM = rs_stack[--rs_count];
					else LM = 0;
				}

				set_in(LM);
				break;

			case tkSH:
			case tkSS:
				/* next-line scoped */
				trap = 0;
				flush(0);
				set_font(FONT_R);

				na = 0;
				ad = 'b';
				hy = 1;
				fi = 1;

				LM = PP_INDENT;
				IP = PP_INDENT;
				if (type == tkSH && argc == 1 && !strcmp(argv[0], "SYNOPSIS")) {
					na = 1;
					hy = 0;
				}
				set_in_ti(PP_INDENT, type == tkSS ? SS_INDENT : SH_INDENT);
				br_PD();
				if (argc) {
					int i;
					for (i = 0; i < argc; ++i) append(argv[i]);
					flush(0);
				} else {
					trap = type;
				}
				break;

			case tkTE:
				/* end tbl */
				man_warnx("TE without TS");
				break;
			case tkTS:
				/* start tbl */
				flush(0);
				tbl();
				break;


			case tkTEXT:
				if (!fi) {
					print(cp, 0);
					fputc('\n', stdout); ++line;
					break;
				}
				if (trap == tkTP) {
					trap = 0;
					set_tag(cp, IP);
					cp = NULL;
				}
				if (!cp || !cp[0]) continue;
				append(cp);
				switch(trap) {
					case tkSS:
					case tkSH:
						flush(0);
						/* set_font(FONT_R); */
						/* set_in_ti(PP_INDENT, -1); */
						break;
				}
				trap = 0;
				break;
		}
	}
	flush(0);
	set_font(FONT_R);
	print_footer();
	read_init(NULL, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x1, 0xafbf(%rip)      # 0x12820
movl $0x7, 0xafb9(%rip)      # 0x12824
movl $0x4e, 0xafb3(%rip)     # 0x12828
movl $0x7, 0xafad(%rip)      # 0x1282c
movq $0x0, 0xafa6(%rip) # 0x12830
movb $0x0, 0xafaf(%rip)      # 0x12840
movb $0x0, 0xaff8(%rip)      # 0x12890
movl $0x0, 0xb03e(%rip)      # 0x128e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x47f0
callq 0x6a70
movq %rax, -0x20(%rbp)
leaq 0x6a51(%rip), %rax      # 0xe310
cmpl $0x0, (%rax)
jne 0x78c9
jmp 0x80e9
leaq 0x6a40(%rip), %rax      # 0xe310
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x28, %eax
ja 0x80e4
movq -0x30(%rbp), %rax
leaq 0x44c2(%rip), %rcx      # 0xbdb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x8120
jmp 0x80e4
callq 0x81f0
jmp 0x80e4
callq 0x82a0
jmp 0x80e4
movl $0x0, -0x14(%rbp)
xorl %edi, %edi
callq 0x9650
movl $0x83, %edi
callq 0x8a00
movl 0xaef9(%rip), %edi      # 0x1282c
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x8d00
cmpl $0x0, 0xaedc(%rip)      # 0x12820
je 0x799d
leaq 0x897b(%rip), %rax      # 0x102c8
cmpl $0x0, (%rax)
jne 0x799d
movl 0xaec8(%rip), %ecx      # 0x12820
leaq 0x69d9(%rip), %rax      # 0xe338
addl (%rax), %ecx
leaq 0x69d0(%rip), %rax      # 0xe338
movl %ecx, (%rax)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0xaea6(%rip), %eax      # 0x12820
jge 0x799b
movq 0x663d(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x40e0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7971
jmp 0x799d
jmp 0x80e4
movl $0x0, -0x14(%rbp)
xorl %edi, %edi
callq 0x9650
movl $0x83, %edi
callq 0x8a00
cmpl $0x0, 0xae5f(%rip)      # 0x12820
je 0x7a1a
leaq 0x88fe(%rip), %rax      # 0x102c8
cmpl $0x0, (%rax)
jne 0x7a1a
movl 0xae4b(%rip), %ecx      # 0x12820
leaq 0x695c(%rip), %rax      # 0xe338
addl (%rax), %ecx
leaq 0x6953(%rip), %rax      # 0xe338
movl %ecx, (%rax)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0xae29(%rip), %eax      # 0x12820
jge 0x7a18
movq 0x65c0(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x40e0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x79ee
jmp 0x7a1a
leaq 0x889f(%rip), %rax      # 0x102c0
cmpl $0x2, (%rax)
jl 0x7a46
leaq 0x98f3(%rip), %rax      # 0x11320
movq 0x8(%rax), %rdi
movl $0x7, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7610
movl %eax, 0xadde(%rip)      # 0x12824
leaq 0x8873(%rip), %rax      # 0x102c0
cmpl $0x1, (%rax)
jl 0x7a80
movl 0xadd4(%rip), %edi      # 0x1282c
addl 0xadc6(%rip), %edi      # 0x12824
movl 0xadc8(%rip), %esi      # 0x1282c
callq 0x8d00
leaq 0x98b0(%rip), %rax      # 0x11320
movq (%rax), %rdi
movl 0xadab(%rip), %esi      # 0x12824
callq 0x9bc0
jmp 0x7a96
movl 0xada6(%rip), %edi      # 0x1282c
addl 0xad98(%rip), %edi      # 0x12824
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x8d00
jmp 0x80e4
movl $0x0, -0x14(%rbp)
xorl %edi, %edi
callq 0x9650
movl $0x83, %edi
callq 0x8a00
leaq 0x8806(%rip), %rax      # 0x102c0
cmpl $0x1, (%rax)
jl 0x7ade
leaq 0x985a(%rip), %rax      # 0x11320
movq (%rax), %rdi
movl $0x7, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7610
movl %eax, 0xad46(%rip)      # 0x12824
movl 0xad48(%rip), %edi      # 0x1282c
addl 0xad3a(%rip), %edi      # 0x12824
movl 0xad3c(%rip), %esi      # 0x1282c
callq 0x8d00
cmpl $0x0, 0xad24(%rip)      # 0x12820
je 0x7b55
leaq 0x87c3(%rip), %rax      # 0x102c8
cmpl $0x0, (%rax)
jne 0x7b55
movl 0xad10(%rip), %ecx      # 0x12820
leaq 0x6821(%rip), %rax      # 0xe338
addl (%rax), %ecx
leaq 0x6818(%rip), %rax      # 0xe338
movl %ecx, (%rax)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0xacee(%rip), %eax      # 0x12820
jge 0x7b53
movq 0x6485(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x40e0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7b29
jmp 0x7b55
jmp 0x80e4
movl $0x0, -0x14(%rbp)
xorl %edi, %edi
callq 0x9650
movl $0x83, %edi
callq 0x8a00
leaq 0x8747(%rip), %rax      # 0x102c0
cmpl $0x1, (%rax)
jl 0x7b9d
leaq 0x979b(%rip), %rax      # 0x11320
movq (%rax), %rdi
movl $0x7, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7610
movl %eax, 0xac87(%rip)      # 0x12824
movl 0xac89(%rip), %edi      # 0x1282c
addl 0xac7b(%rip), %edi      # 0x12824
movl 0xac7d(%rip), %esi      # 0x1282c
callq 0x8d00
leaq 0x6755(%rip), %rax      # 0xe310
cmpl $0x21, (%rax)
jne 0x7c22
cmpl $0x0, 0xac59(%rip)      # 0x12820
je 0x7c20
leaq 0x86f8(%rip), %rax      # 0x102c8
cmpl $0x0, (%rax)
jne 0x7c20
movl 0xac45(%rip), %ecx      # 0x12820
leaq 0x6756(%rip), %rax      # 0xe338
addl (%rax), %ecx
leaq 0x674d(%rip), %rax      # 0xe338
movl %ecx, (%rax)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0xac23(%rip), %eax      # 0x12820
jge 0x7c1e
movq 0x63ba(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x40e0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7bf4
jmp 0x7c20
jmp 0x7c22
movl $0x21, -0x14(%rbp)
jmp 0x80e4
movl $0x0, -0x14(%rbp)
xorl %edi, %edi
callq 0x9650
leaq 0x867d(%rip), %rax      # 0x102c0
cmpl $0x0, (%rax)
je 0x7c60
leaq 0x96d1(%rip), %rax      # 0x11320
movq (%rax), %rdi
callq 0x9150
addl $0x1, %eax
movl %eax, 0xabc4(%rip)      # 0x12824
movl 0xabc6(%rip), %edi      # 0x1282c
addl 0xabb8(%rip), %edi      # 0x12824
movl 0xabba(%rip), %esi      # 0x1282c
callq 0x8d00
cmpl $0x0, 0xaba2(%rip)      # 0x12820
je 0x7cd7
leaq 0x8641(%rip), %rax      # 0x102c8
cmpl $0x0, (%rax)
jne 0x7cd7
movl 0xab8e(%rip), %ecx      # 0x12820
leaq 0x669f(%rip), %rax      # 0xe338
addl (%rax), %ecx
leaq 0x6696(%rip), %rax      # 0xe338
movl %ecx, (%rax)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0xab6c(%rip), %eax      # 0x12820
jge 0x7cd5
movq 0x6303(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x40e0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7cab
jmp 0x7cd7
leaq 0x9642(%rip), %rax      # 0x11320
movq (%rax), %rdi
movl 0xab3d(%rip), %esi      # 0x12824
callq 0x9bc0
jmp 0x80e4
xorl %edi, %edi
callq 0x9650
jmp 0x80e4
movl $0x0, -0x14(%rbp)
xorl %edi, %edi
callq 0x9650
leaq 0x6606(%rip), %rax      # 0xe318
movl $0x0, (%rax)
jmp 0x80e4
movl $0x0, -0x14(%rbp)
leaq 0x65ed(%rip), %rax      # 0xe318
movl $0x1, (%rax)
jmp 0x80e4
leaq 0x95e3(%rip), %rax      # 0x11320
movq (%rax), %rdi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7610
movl %eax, 0xaacb(%rip)      # 0x12820
jmp 0x80e4
xorl %edi, %edi
callq 0x9650
movl 0xaac5(%rip), %edx      # 0x1282c
movl 0xab73(%rip), %eax      # 0x128e0
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xab68(%rip)      # 0x128e0
movslq %eax, %rcx
leaq 0xab6e(%rip), %rax      # 0x128f0
movl %edx, (%rax,%rcx,4)
leaq 0x8534(%rip), %rax      # 0x102c0
cmpl $0x1, (%rax)
jl 0x7db0
leaq 0x9588(%rip), %rax      # 0x11320
movq (%rax), %rdi
movl $0x7, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7610
movl %eax, 0xaa74(%rip)      # 0x12824
movl 0xaa6e(%rip), %eax      # 0x12824
addl 0xaa70(%rip), %eax      # 0x1282c
movl %eax, 0xaa6a(%rip)      # 0x1282c
movl 0xaa64(%rip), %edi      # 0x1282c
callq 0x8cb0
jmp 0x80e4
xorl %edi, %edi
callq 0x9650
leaq 0x84e0(%rip), %rax      # 0x102c0
cmpl $0x0, (%rax)
je 0x7e51
leaq 0x9534(%rip), %rax      # 0x11320
movq (%rax), %rdi
callq 0x75a0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
jge 0x7e04
movl $0x1, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl 0xaaca(%rip), %eax      # 0x128e0
jge 0x7e37
movslq -0x24(%rbp), %rcx
leaq 0xaacd(%rip), %rax      # 0x128f0
movl (%rax,%rcx,4), %eax
movl %eax, 0xaa00(%rip)      # 0x1282c
movl -0x24(%rbp), %eax
movl %eax, 0xaaab(%rip)      # 0x128e0
jmp 0x7e4f
leaq 0x94e2(%rip), %rax      # 0x11320
movq (%rax), %rdx
xorl %edi, %edi
leaq 0x407b(%rip), %rsi      # 0xbec5
callq 0x4ad0
jmp 0x7e8a
cmpl $0x0, 0xaa88(%rip)      # 0x128e0
je 0x7e7e
movl 0xaa80(%rip), %eax      # 0x128e0
addl $-0x1, %eax
movl %eax, 0xaa77(%rip)      # 0x128e0
movslq %eax, %rcx
leaq 0xaa7d(%rip), %rax      # 0x128f0
movl (%rax,%rcx,4), %eax
movl %eax, 0xa9b0(%rip)      # 0x1282c
jmp 0x7e88
movl $0x0, 0xa9a4(%rip)      # 0x1282c
jmp 0x7e8a
movl 0xa99c(%rip), %edi      # 0x1282c
callq 0x8cb0
jmp 0x80e4
movl $0x0, -0x14(%rbp)
xorl %edi, %edi
callq 0x9650
movl $0x83, %edi
callq 0x8a00
leaq 0x840b(%rip), %rax      # 0x102c4
movl $0x0, (%rax)
leaq 0x644e(%rip), %rax      # 0xe314
movl $0x62, (%rax)
leaq 0x6449(%rip), %rax      # 0xe31c
movl $0x1, (%rax)
leaq 0x6438(%rip), %rax      # 0xe318
movl $0x1, (%rax)
movl $0x7, 0xa93c(%rip)      # 0x1282c
movl $0x7, 0xa92a(%rip)      # 0x12824
leaq 0x640f(%rip), %rax      # 0xe310
cmpl $0x1d, (%rax)
jne 0x7f47
leaq 0x83b3(%rip), %rax      # 0x102c0
cmpl $0x1, (%rax)
jne 0x7f47
leaq 0x9407(%rip), %rax      # 0x11320
movq (%rax), %rdi
leaq 0x3fb6(%rip), %rsi      # 0xbed9
callq 0x4100
cmpl $0x0, %eax
jne 0x7f47
leaq 0x8390(%rip), %rax      # 0x102c4
movl $0x1, (%rax)
leaq 0x63db(%rip), %rax      # 0xe31c
movl $0x0, (%rax)
leaq 0x63c2(%rip), %rax      # 0xe310
movl (%rax), %ecx
xorl %esi, %esi
movl $0x3, %eax
cmpl $0x1f, %ecx
cmovel %eax, %esi
movl $0x7, %edi
callq 0x8d00
cmpl $0x0, 0xa8b2(%rip)      # 0x12820
je 0x7fc7
leaq 0x8351(%rip), %rax      # 0x102c8
cmpl $0x0, (%rax)
jne 0x7fc7
movl 0xa89e(%rip), %ecx      # 0x12820
leaq 0x63af(%rip), %rax      # 0xe338
addl (%rax), %ecx
leaq 0x63a6(%rip), %rax      # 0xe338
movl %ecx, (%rax)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0xa87c(%rip), %eax      # 0x12820
jge 0x7fc5
movq 0x6013(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x40e0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7f9b
jmp 0x7fc7
leaq 0x82f2(%rip), %rax      # 0x102c0
cmpl $0x0, (%rax)
je 0x8010
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
leaq 0x82dc(%rip), %rcx      # 0x102c0
cmpl (%rcx), %eax
jge 0x8007
movslq -0x28(%rbp), %rcx
leaq 0x932d(%rip), %rax      # 0x11320
movq (%rax,%rcx,8), %rdi
callq 0x9300
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x7fda
xorl %edi, %edi
callq 0x9650
jmp 0x801c
leaq 0x62f9(%rip), %rax      # 0xe310
movl (%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x80e4
xorl %edi, %edi
leaq 0x3eb8(%rip), %rsi      # 0xbee2
callq 0x49d0
jmp 0x80e4
xorl %edi, %edi
callq 0x9650
callq 0x9e20
jmp 0x80e4
leaq 0x62cc(%rip), %rax      # 0xe318
cmpl $0x0, (%rax)
jne 0x8087
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x8de0
movq 0x5f5d(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x40e0
leaq 0x62c1(%rip), %rax      # 0xe338
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x62b5(%rip), %rax      # 0xe338
movl %ecx, (%rax)
jmp 0x80e4
cmpl $0x21, -0x14(%rbp)
jne 0x80ab
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rdi
movl 0xa786(%rip), %esi      # 0x12824
callq 0x9bc0
movq $0x0, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x80bb
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x80c0
jmp 0x78af
movq -0x20(%rbp), %rdi
callq 0x9300
movl -0x14(%rbp), %eax
orl $0x2, %eax
subl $0x1f, %eax
je 0x80d6
jmp 0x80dd
xorl %edi, %edi
callq 0x9650
movl $0x0, -0x14(%rbp)
jmp 0x78af
xorl %edi, %edi
callq 0x9650
movl $0x83, %edi
callq 0x8a00
callq 0x8700
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x47f0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)