// File: /workspace/github_c_makefile_star2_O0/ksherlock[P]nroff_man/read3.c
// Function: tc_init
void tc_init(void) {
	static char buffer[1024];
	static char buffer2[1024];
	const char *term;
	char *cp;
	char *pcap;
	int ok;

	term = flags.t ? flags.t : getenv("TERM");
	if (!term || !*term) {
		warnx("TERM undefined."); return;
	}

	ok = tgetent(buffer, term);
	if (ok < 0) {
		warnx("No termcap for %s", term);
		return;
	}

	tcap_buffer_offset = 0;

	pcap = buffer2;
	if (!flags.i) {
		/* ZH/ZR are italic begin/end.  Not usually supported. */

		cp = tgetstr("ZH", &pcap);
		if (cp) {
			italic_begin = tcap_buffer + tcap_buffer_offset;
			tputs(cp, 0, tputs_helper);
			tcap_buffer[tcap_buffer_offset++] = 0;
		}
		cp = tgetstr("ZR", &pcap);
		if (cp) {
			italic_end = tcap_buffer + tcap_buffer_offset;
			tputs(cp, 0, tputs_helper);
			tcap_buffer[tcap_buffer_offset++] = 0;
		}

		if (!italic_begin) {
			cp = tgetstr("us", &pcap);
			if (cp) {
				italic_begin = tcap_buffer + tcap_buffer_offset;
				tputs(cp, 0, tputs_helper);
				tcap_buffer[tcap_buffer_offset++] = 0;
			}
			cp = tgetstr("ue", &pcap);
			if (cp) {
				italic_end = tcap_buffer + tcap_buffer_offset;
				tputs(cp, 0, tputs_helper);
				tcap_buffer[tcap_buffer_offset++] = 0;
			}
		}
	}

	if (!flags.b) {
		cp = tgetstr("md", &pcap);
		if (cp) {
			bold_begin = tcap_buffer + tcap_buffer_offset;
			tputs(cp, 0, tputs_helper);
			tcap_buffer[tcap_buffer_offset++] = 0;
		}
		cp = tgetstr("me", &pcap);
		if (cp) {
			bold_end = tcap_buffer + tcap_buffer_offset;
			tputs(cp, 0, tputs_helper);
			tcap_buffer[tcap_buffer_offset++] = 0;
		}

		if (!bold_begin) {
			cp = tgetstr("so", &pcap);
			if (cp) {
				bold_begin = tcap_buffer + tcap_buffer_offset;
				tputs(cp, 0, tputs_helper);
				tcap_buffer[tcap_buffer_offset++] = 0;
			}
			cp = tgetstr("se", &pcap);
			if (cp) {
				bold_end = tcap_buffer + tcap_buffer_offset;
				tputs(cp, 0, tputs_helper);
				tcap_buffer[tcap_buffer_offset++] = 0;
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x9199(%rip), %rax      # 0x102d8
cmpq $0x0, 0x18(%rax)
je 0x7157
leaq 0x918b(%rip), %rax      # 0x102d8
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x7167
leaq 0x4d2e(%rip), %rdi      # 0xbe8c
callq 0x4030
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x717f
movq -0x8(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x7192
leaq 0x4d0b(%rip), %rdi      # 0xbe91
movb $0x0, %al
callq 0x40b0
jmp 0x754d
movq -0x8(%rbp), %rsi
leaq 0xaa73(%rip), %rdi      # 0x11c10
callq 0x41c0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x71c2
movq -0x8(%rbp), %rsi
leaq 0x4ceb(%rip), %rdi      # 0xbea1
movb $0x0, %al
callq 0x40b0
jmp 0x754d
movl $0x0, 0xb244(%rip)      # 0x12410
leaq 0xae3d(%rip), %rax      # 0x12010
movq %rax, -0x18(%rbp)
leaq 0x90fa(%rip), %rax      # 0x102d8
cmpl $0x0, 0x4(%rax)
jne 0x7392
leaq 0x4cc4(%rip), %rdi      # 0xbeb3
leaq -0x18(%rbp), %rsi
callq 0x4150
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x724e
movl 0xb207(%rip), %eax      # 0x12410
movl %eax, %ecx
leaq 0xb20e(%rip), %rax      # 0x12420
addq %rcx, %rax
movq %rax, 0xa9e4(%rip)      # 0x11c00
movq -0x10(%rbp), %rdi
xorl %esi, %esi
leaq 0x337(%rip), %rdx       # 0x7560
callq 0x4050
movl 0xb1dc(%rip), %eax      # 0x12410
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xb1d1(%rip)      # 0x12410
movl %eax, %eax
movl %eax, %ecx
leaq 0xb1d6(%rip), %rax      # 0x12420
movb $0x0, (%rax,%rcx)
leaq 0x4c61(%rip), %rdi      # 0xbeb6
leaq -0x18(%rbp), %rsi
callq 0x4150
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x72b4
movl 0xb1a1(%rip), %eax      # 0x12410
movl %eax, %ecx
leaq 0xb1a8(%rip), %rax      # 0x12420
addq %rcx, %rax
movq %rax, 0xa986(%rip)      # 0x11c08
movq -0x10(%rbp), %rdi
xorl %esi, %esi
leaq 0x2d1(%rip), %rdx       # 0x7560
callq 0x4050
movl 0xb176(%rip), %eax      # 0x12410
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xb16b(%rip)      # 0x12410
movl %eax, %eax
movl %eax, %ecx
leaq 0xb170(%rip), %rax      # 0x12420
movb $0x0, (%rax,%rcx)
cmpq $0x0, 0xa944(%rip)      # 0x11c00
jne 0x7390
leaq 0x4bf0(%rip), %rdi      # 0xbeb9
leaq -0x18(%rbp), %rsi
callq 0x4150
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7328
movl 0xb12d(%rip), %eax      # 0x12410
movl %eax, %ecx
leaq 0xb134(%rip), %rax      # 0x12420
addq %rcx, %rax
movq %rax, 0xa90a(%rip)      # 0x11c00
movq -0x10(%rbp), %rdi
xorl %esi, %esi
leaq 0x25d(%rip), %rdx       # 0x7560
callq 0x4050
movl 0xb102(%rip), %eax      # 0x12410
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xb0f7(%rip)      # 0x12410
movl %eax, %eax
movl %eax, %ecx
leaq 0xb0fc(%rip), %rax      # 0x12420
movb $0x0, (%rax,%rcx)
leaq 0x4b8d(%rip), %rdi      # 0xbebc
leaq -0x18(%rbp), %rsi
callq 0x4150
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x738e
movl 0xb0c7(%rip), %eax      # 0x12410
movl %eax, %ecx
leaq 0xb0ce(%rip), %rax      # 0x12420
addq %rcx, %rax
movq %rax, 0xa8ac(%rip)      # 0x11c08
movq -0x10(%rbp), %rdi
xorl %esi, %esi
leaq 0x1f7(%rip), %rdx       # 0x7560
callq 0x4050
movl 0xb09c(%rip), %eax      # 0x12410
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xb091(%rip)      # 0x12410
movl %eax, %eax
movl %eax, %ecx
leaq 0xb096(%rip), %rax      # 0x12420
movb $0x0, (%rax,%rcx)
jmp 0x7390
jmp 0x7392
leaq 0x8f3f(%rip), %rax      # 0x102d8
cmpl $0x0, 0x8(%rax)
jne 0x754d
leaq 0x4b15(%rip), %rdi      # 0xbebf
leaq -0x18(%rbp), %rsi
callq 0x4150
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7409
movl 0xb04c(%rip), %eax      # 0x12410
movl %eax, %ecx
leaq 0xb053(%rip), %rax      # 0x12420
addq %rcx, %rax
movq %rax, 0xa819(%rip)      # 0x11bf0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
leaq 0x17c(%rip), %rdx       # 0x7560
callq 0x4050
movl 0xb021(%rip), %eax      # 0x12410
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xb016(%rip)      # 0x12410
movl %eax, %eax
movl %eax, %ecx
leaq 0xb01b(%rip), %rax      # 0x12420
movb $0x0, (%rax,%rcx)
leaq 0x4ab2(%rip), %rdi      # 0xbec2
leaq -0x18(%rbp), %rsi
callq 0x4150
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x746f
movl 0xafe6(%rip), %eax      # 0x12410
movl %eax, %ecx
leaq 0xafed(%rip), %rax      # 0x12420
addq %rcx, %rax
movq %rax, 0xa7bb(%rip)      # 0x11bf8
movq -0x10(%rbp), %rdi
xorl %esi, %esi
leaq 0x116(%rip), %rdx       # 0x7560
callq 0x4050
movl 0xafbb(%rip), %eax      # 0x12410
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xafb0(%rip)      # 0x12410
movl %eax, %eax
movl %eax, %ecx
leaq 0xafb5(%rip), %rax      # 0x12420
movb $0x0, (%rax,%rcx)
cmpq $0x0, 0xa779(%rip)      # 0x11bf0
jne 0x754b
leaq 0x46b2(%rip), %rdi      # 0xbb36
leaq -0x18(%rbp), %rsi
callq 0x4150
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x74e3
movl 0xaf72(%rip), %eax      # 0x12410
movl %eax, %ecx
leaq 0xaf79(%rip), %rax      # 0x12420
addq %rcx, %rax
movq %rax, 0xa73f(%rip)      # 0x11bf0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
leaq 0xa2(%rip), %rdx        # 0x7560
callq 0x4050
movl 0xaf47(%rip), %eax      # 0x12410
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xaf3c(%rip)      # 0x12410
movl %eax, %eax
movl %eax, %ecx
leaq 0xaf41(%rip), %rax      # 0x12420
movb $0x0, (%rax,%rcx)
leaq 0x4a3e(%rip), %rdi      # 0xbf28
leaq -0x18(%rbp), %rsi
callq 0x4150
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7549
movl 0xaf0c(%rip), %eax      # 0x12410
movl %eax, %ecx
leaq 0xaf13(%rip), %rax      # 0x12420
addq %rcx, %rax
movq %rax, 0xa6e1(%rip)      # 0x11bf8
movq -0x10(%rbp), %rdi
xorl %esi, %esi
leaq 0x3c(%rip), %rdx        # 0x7560
callq 0x4050
movl 0xaee1(%rip), %eax      # 0x12410
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xaed6(%rip)      # 0x12410
movl %eax, %eax
movl %eax, %ecx
leaq 0xaedb(%rip), %rax      # 0x12420
movb $0x0, (%rax,%rcx)
jmp 0x754b
jmp 0x754d
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)