// File: /workspace/github_c_makefile_star2_O1/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 0x1f769
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x6c83
movq 0xd8(%rbx), %rdi
callq 0x3030
movl %eax, %edi
callq 0x3140
cmpl $0x0, 0xc8(%rbx)
jle 0x1fda5
movl %eax, %ebp
xorl %r12d, %r12d
leaq 0x2295d(%rip), %r14     # 0x425d3
leaq 0x22951(%rip), %r15     # 0x425ce
cmpl $0x0, 0x4(%rbx)
jle 0x1fd81
xorl %r13d, %r13d
testl %ebp, %ebp
je 0x1fd56
movq 0xd0(%rbx), %rax
movq (%rax,%r12,8), %rax
movl 0x4(%rax,%r13,8), %ecx
xorl %eax, %eax
btl %eax, %ecx
jb 0x1fcb5
incl %eax
cmpl $0x20, %eax
jne 0x1fca4
movl $0x20, %eax
decl %eax
cmpl $0x8, %eax
ja 0x1fce2
movl $0x1f7, %ecx            # imm = 0x1F7
btl %eax, %ecx
jae 0x1fce2
movl %eax, %eax
leaq 0x22909(%rip), %rcx     # 0x425d8
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
movq 0xd8(%rbx), %rsi
callq 0x34a0
movq 0xd0(%rbx), %rax
movq (%rax,%r12,8), %rax
testb $0x4, 0x5(%rax,%r13,8)
je 0x1fd04
movq 0xd8(%rbx), %rsi
movq %r15, %rdi
callq 0x34a0
movq 0xd0(%rbx), %rax
movq 0xd8(%rbx), %rsi
movq (%rax,%r12,8), %rax
movl (%rax,%r13,8), %edi
callq 0x3320
testl %ebp, %ebp
je 0x1fd71
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 0x1fd71
movq 0xd8(%rbx), %rsi
movq %r14, %rdi
callq 0x34a0
jmp 0x1fd71
movq 0xd0(%rbx), %rax
movq 0xd8(%rbx), %rsi
movq (%rax,%r12,8), %rax
movl (%rax,%r13,8), %edi
callq 0x3320
incq %r13
movslq 0x4(%rbx), %rax
cmpq %rax, %r13
jl 0x1fc8a
movq 0xd8(%rbx), %rsi
movl $0xa, %edi
callq 0x3320
incq %r12
movslq 0xc8(%rbx), %rax
cmpq %rax, %r12
jl 0x1fc7d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop