// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_tview_html.c
// Function: text_drawaln
static int text_drawaln(struct AbstractTview* tv, int tid, int pos)
    {
    int y,x;
    html_tview_t* ptr=FROM_TV(tv);
    html_clear(tv);
    base_draw_aln(tv,  tid, pos); 
    int is_term= isatty(fileno(ptr->out));
    
    for(y=0;y< ptr->row_count;++y)
    	{
    	for(x=0;x< tv->mcol;++x)
	    	{
	    	if(is_term)
	    		{
	    		int css=0;
	    		while(css<32)
	    			{
	    			if(( (ptr->screen[y][x].attributes) & (1 << (css)))!=0)
	    				{
	    				break;
	    				}
	    			++css;
	    			}
    			switch(css)
    				{
    				//CSS(0, "black");
			    	case 1: fputs(ANSI_COLOR_BLUE,ptr->out); break;
				case 2: fputs(ANSI_COLOR_GREEN,ptr->out); break;
				case 3: fputs(ANSI_COLOR_YELLOW,ptr->out); break;
				//CSS(4, "black");
				case 5: fputs(ANSI_COLOR_GREEN,ptr->out); break;
				case 6: fputs(ANSI_COLOR_CYAN,ptr->out); break;
				case 7: fputs(ANSI_COLOR_YELLOW,ptr->out); break;
				case 8: fputs(ANSI_COLOR_RED,ptr->out); break;
				case 9: fputs(ANSI_COLOR_BLUE,ptr->out); break;
				default:break;
    				}
    			if(( (ptr->screen[y][x].attributes) & (1 << (UNDERLINE_FLAG)))!=0)
    				{
    				fputs(ANSI_UNDERLINE_SET,ptr->out);
    				}
    			
	    		}
	    	
	    	
	    	int ch=ptr->screen[y][x].ch;

	    	fputc(ch,ptr->out);
	    	if(is_term)
	    		{
	    		fputs(ANSI_COLOR_RESET,ptr->out);
	    		if(( (ptr->screen[y][x].attributes) & (1 << (UNDERLINE_FLAG)))!=0)
    				{
    				fputs(ANSI_UNDERLINE_UNSET,ptr->out);
    				}
	    		}
	    	}
    	fputc('\n',ptr->out);
    	}
    return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x1fcb6
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x70a4
movq 0xd8(%rbx), %rdi
callq 0x3030
movl %eax, %edi
callq 0x3140
cmpl $0x0, 0xc8(%rbx)
jle 0x202f6
movl %eax, %ebp
xorl %r12d, %r12d
leaq 0x23454(%rip), %r14     # 0x43623
leaq 0x23448(%rip), %r15     # 0x4361e
cmpl $0x0, 0x4(%rbx)
jle 0x202d2
xorl %r13d, %r13d
movq 0xd0(%rbx), %rax
movq (%rax,%r12,8), %rax
testl %ebp, %ebp
je 0x20210
movl 0x4(%rax,%r13,8), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leal 0x1(%rax), %edx
movzbl %dl, %edx
btl %edx, %ecx
jb 0x20225
incl %eax
cmpl $0x1f, %eax
jne 0x201fc
jmp 0x20250
movl (%rax,%r13,8), %edi
movq 0xd8(%rbx), %rsi
callq 0x3320
jmp 0x202c2
cmpl $0x8, %eax
ja 0x20250
movl $0x1f7, %ecx            # imm = 0x1F7
btl %eax, %ecx
jae 0x20250
movl %eax, %eax
leaq 0x233eb(%rip), %rcx     # 0x43628
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
movq 0xd8(%rbx), %rsi
callq 0x34a0
movq 0xd0(%rbx), %rax
movq (%rax,%r12,8), %rcx
testb $0x4, 0x5(%rcx,%r13,8)
je 0x20279
movq 0xd8(%rbx), %rsi
movq %r15, %rdi
callq 0x34a0
movq 0xd0(%rbx), %rax
movq (%rax,%r12,8), %rax
movl (%rax,%r13,8), %edi
movq 0xd8(%rbx), %rsi
callq 0x3320
testl %ebp, %ebp
je 0x202c2
movq 0xd8(%rbx), %rsi
movq %r14, %rdi
callq 0x34a0
movq 0xd0(%rbx), %rax
movq (%rax,%r12,8), %rax
testb $0x4, 0x5(%rax,%r13,8)
je 0x202c2
movq 0xd8(%rbx), %rsi
movq %r14, %rdi
callq 0x34a0
incq %r13
movslq 0x4(%rbx), %rax
cmpq %rax, %r13
jl 0x201e3
movq 0xd8(%rbx), %rsi
movl $0xa, %edi
callq 0x3320
incq %r12
movslq 0xc8(%rbx), %rax
cmpq %rax, %r12
jl 0x201d6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop