// File: /workspace/github_c_makefile_star2_O0/ksherlock[P]nroff_man/read2.c
// Function: read_text
const unsigned char *read_text(void) {

	unsigned ff = 0;
	for(;;) {
		const unsigned char *cp = read_line();
		if (type == tkEOF) return NULL;

		switch(type) {
			case tkDT:
				continue;
			case tkUR:
			case tkUE:
			case tkMT:
			case tkME:
			case tkIX:
				continue;

			/* next-line fonts */
			case tkB:
			case tkSB:
				ff = FONT_B;
				if (argc) return font(ff);
				continue;
			case tkR:
			case tkSM:
				ff = FONT_R;
				if (argc) return font(ff);
				continue;
			case tkI:
				ff = FONT_I;
				if (argc) return font(ff);
				continue;
			case tkSY:
				/* bold up argv0 but retain the type */
				if (argc) {
					unsigned i;
					buffer[0] = FONT_B;
					i = xstrcpy(buffer+1, argv[0]);
					/* pre-increment to adjust for buffer+1 */
					buffer[++i] = FONT_R;
					buffer[++i] = 0;
					argv[0] = buffer;
					return "";
				}

			/* current-line fonts */
			case tkBI: return fonts(FONT_B, FONT_I);
			case tkBR: return fonts(FONT_B, FONT_R);
			case tkIB: return fonts(FONT_I, FONT_B);
			case tkIR: return fonts(FONT_I, FONT_R);
			case tkRI: return fonts(FONT_R, FONT_I);
			case tkRB: return fonts(FONT_R, FONT_B);

			/* plan-9 Manual Reference.  First word is italic */
			case tkMR: return font_first_word(FONT_I);

			case tkOP: {
				unsigned i;

				if (argc == 0) continue;
				buffer[0] = '[';
				buffer[1] = FONT_B;
				i = 2 + xstrcpy(buffer+2, argv[0]);
				buffer[i++] = FONT_R;
				if (argc > 1) {
					buffer[i++] = NBSPACE;
					buffer[i++] = FONT_I;
					i += xstrcpy(buffer + i, argv[1]);
					buffer[i++] = FONT_R;
				}
				buffer[i++] = ']'; 
				buffer[i] = 0; 
				type = tkTEXT;
				return buffer;
			}

			case tkTEXT:
				if (ff) {
					unsigned i;
					buffer[0] = ff;
					i = xstrcpy(buffer+1, cp);
					/* pre-increment to adjust for buffer+1 */
					buffer[++i] = FONT_R;
					buffer[++i] = 0;
					ff = 0;
					return buffer;
				}
			default:
				return cp;
		}

	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0xc(%rbp)
callq 0x4ba0
movq %rax, -0x18(%rbp)
leaq 0x7881(%rip), %rax      # 0xe310
cmpl $0x0, (%rax)
jne 0x6aa1
movq $0x0, -0x8(%rbp)
jmp 0x6dff
leaq 0x7868(%rip), %rax      # 0xe310
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x24, %eax
ja 0x6df7
movq -0x30(%rbp), %rax
leaq 0x517a(%rip), %rcx      # 0xbc40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x6a7f
jmp 0x6a7f
movl $0x84, -0xc(%rbp)
leaq 0x97df(%rip), %rax      # 0x102c0
cmpl $0x0, (%rax)
je 0x6af7
movl -0xc(%rbp), %edi
callq 0x6e10
movq %rax, -0x8(%rbp)
jmp 0x6dff
jmp 0x6a7f
movl $0x83, -0xc(%rbp)
leaq 0x97b9(%rip), %rax      # 0x102c0
cmpl $0x0, (%rax)
je 0x6b1d
movl -0xc(%rbp), %edi
callq 0x6e10
movq %rax, -0x8(%rbp)
jmp 0x6dff
jmp 0x6a7f
movl $0x85, -0xc(%rbp)
leaq 0x9790(%rip), %rax      # 0x102c0
cmpl $0x0, (%rax)
je 0x6b46
movl -0xc(%rbp), %edi
callq 0x6e10
movq %rax, -0x8(%rbp)
jmp 0x6dff
jmp 0x6a7f
leaq 0x976e(%rip), %rax      # 0x102c0
cmpl $0x0, (%rax)
je 0x6bcc
movb $-0x7c, 0xa872(%rip)    # 0x113d0
leaq 0xa7bb(%rip), %rax      # 0x11320
movq (%rax), %rsi
leaq 0xa861(%rip), %rdi      # 0x113d0
addq $0x1, %rdi
callq 0x6a30
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0xa841(%rip), %rax      # 0x113d0
movb $-0x7d, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0xa829(%rip), %rax      # 0x113d0
movb $0x0, (%rax,%rcx)
leaq 0xa76e(%rip), %rax      # 0x11320
leaq 0xa817(%rip), %rcx      # 0x113d0
movq %rcx, (%rax)
leaq 0x584f(%rip), %rax      # 0xc412
movq %rax, -0x8(%rbp)
jmp 0x6dff
jmp 0x6bce
movl $0x84, %edi
movl $0x85, %esi
callq 0x6f10
movq %rax, -0x8(%rbp)
jmp 0x6dff
movl $0x84, %edi
movl $0x83, %esi
callq 0x6f10
movq %rax, -0x8(%rbp)
jmp 0x6dff
movl $0x85, %edi
movl $0x84, %esi
callq 0x6f10
movq %rax, -0x8(%rbp)
jmp 0x6dff
movl $0x85, %edi
movl $0x83, %esi
callq 0x6f10
movq %rax, -0x8(%rbp)
jmp 0x6dff
movl $0x83, %edi
movl $0x85, %esi
callq 0x6f10
movq %rax, -0x8(%rbp)
jmp 0x6dff
movl $0x83, %edi
movl $0x84, %esi
callq 0x6f10
movq %rax, -0x8(%rbp)
jmp 0x6dff
movl $0x85, %edi
callq 0x7020
movq %rax, -0x8(%rbp)
jmp 0x6dff
leaq 0x9648(%rip), %rax      # 0x102c0
cmpl $0x0, (%rax)
jne 0x6c82
jmp 0x6a7f
movb $0x5b, 0xa747(%rip)     # 0x113d0
movb $-0x7c, 0xa741(%rip)    # 0x113d1
leaq 0xa689(%rip), %rax      # 0x11320
movq (%rax), %rsi
leaq 0xa72f(%rip), %rdi      # 0x113d0
addq $0x2, %rdi
callq 0x6a30
addl $0x2, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0xa70a(%rip), %rax      # 0x113d0
movb $-0x7d, (%rax,%rcx)
leaq 0x95ef(%rip), %rax      # 0x102c0
cmpl $0x1, (%rax)
jle 0x6d47
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0xa6e4(%rip), %rax      # 0x113d0
movb $-0x80, (%rax,%rcx)
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0xa6ca(%rip), %rax      # 0x113d0
movb $-0x7b, (%rax,%rcx)
movl -0x20(%rbp), %eax
leaq 0xa6bc(%rip), %rdi      # 0x113d0
addq %rax, %rdi
leaq 0xa602(%rip), %rax      # 0x11320
movq 0x8(%rax), %rsi
callq 0x6a30
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0xa68d(%rip), %rax      # 0x113d0
movb $-0x7d, (%rax,%rcx)
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0xa673(%rip), %rax      # 0x113d0
movb $0x5d, (%rax,%rcx)
movl -0x20(%rbp), %eax
movl %eax, %ecx
leaq 0xa663(%rip), %rax      # 0x113d0
movb $0x0, (%rax,%rcx)
leaq 0x7598(%rip), %rax      # 0xe310
movl $0x1, (%rax)
leaq 0xa64b(%rip), %rax      # 0x113d0
movq %rax, -0x8(%rbp)
jmp 0x6dff
cmpl $0x0, -0xc(%rbp)
je 0x6df5
movl -0xc(%rbp), %eax
movb %al, 0xa636(%rip)       # 0x113d0
movq -0x18(%rbp), %rsi
leaq 0xa62b(%rip), %rdi      # 0x113d0
addq $0x1, %rdi
callq 0x6a30
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0xa60b(%rip), %rax      # 0x113d0
movb $-0x7d, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0xa5f3(%rip), %rax      # 0x113d0
movb $0x0, (%rax,%rcx)
movl $0x0, -0xc(%rbp)
leaq 0xa5e1(%rip), %rax      # 0x113d0
movq %rax, -0x8(%rbp)
jmp 0x6dff
jmp 0x6df7
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)