// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_tview_curses.c
// Function: curses_tv_init
tview_t* curses_tv_init(const char *fn, const char *fn_fa, const char *samples)
	{
	curses_tview_t *tv = (curses_tview_t*)calloc(1, sizeof(curses_tview_t));
	tview_t* base=(tview_t*)tv;
	if(tv==0)
		{
		fprintf(stderr,"Calloc failed\n");
		return 0;
		}
	
	base_tv_init(base,fn,fn_fa,samples);
	/* initialize callbacks */
#define SET_CALLBACK(fun) base->my_##fun=curses_##fun;
	SET_CALLBACK(destroy);
	SET_CALLBACK(mvprintw);
	SET_CALLBACK(mvaddch);
	SET_CALLBACK(attron);
	SET_CALLBACK(attroff);
	SET_CALLBACK(clear);
	SET_CALLBACK(colorpair);
	SET_CALLBACK(drawaln);
	SET_CALLBACK(loop);
	SET_CALLBACK(underline);
#undef SET_CALLBACK

	initscr();
	keypad(stdscr, TRUE);
	clear();
	noecho();
	cbreak();
	
	getmaxyx(stdscr, base->mrow, base->mcol);
	tv->wgoto = newwin(3, TV_MAX_GOTO + 10, 10, 5);
	tv->whelp = newwin(29, 40, 5, 5);
	
	start_color();
	init_pair(1, COLOR_BLUE, COLOR_BLACK);
	init_pair(2, COLOR_GREEN, COLOR_BLACK);
	init_pair(3, COLOR_YELLOW, COLOR_BLACK);
	init_pair(4, COLOR_WHITE, COLOR_BLACK);
	init_pair(5, COLOR_GREEN, COLOR_BLACK);
	init_pair(6, COLOR_CYAN, COLOR_BLACK);
	init_pair(7, COLOR_YELLOW, COLOR_BLACK);
	init_pair(8, COLOR_RED, COLOR_BLACK);
	init_pair(9, COLOR_BLUE, COLOR_BLACK);
	return base;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0x1, %edi
movl $0xd8, %esi
callq 0x3610
testq %rax, %rax
je 0x1eb04
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x5bec
leaq 0x1c9(%rip), %rax       # 0x1eb0d
movq %rax, 0x78(%rbx)
leaq 0x1f0(%rip), %rax       # 0x1eb3f
movq %rax, 0x80(%rbx)
leaq 0x2b8(%rip), %rax       # 0x1ec15
movq %rax, 0x88(%rbx)
leaq 0x2dd(%rip), %rax       # 0x1ec48
movq %rax, 0x90(%rbx)
leaq 0x2e0(%rip), %rax       # 0x1ec59
movq %rax, 0x98(%rbx)
leaq 0x2e3(%rip), %rax       # 0x1ec6a
movq %rax, 0xa0(%rbx)
leaq 0x2e4(%rip), %rax       # 0x1ec79
movq %rax, 0xa8(%rbx)
leaq 0x2dd(%rip), %rax       # 0x1ec80
movq %rax, 0xb0(%rbx)
leaq 0x2d4(%rip), %rax       # 0x1ec85
movq %rax, 0xb8(%rbx)
leaq 0xa31(%rip), %rax       # 0x1f3f0
movq %rax, 0xc0(%rbx)
callq 0x36a0
movq 0x30606(%rip), %r14     # 0x4efd8
movq (%r14), %rdi
movl $0x1, %esi
callq 0x3200
movq (%r14), %rdi
callq 0x3090
callq 0x30a0
callq 0x3660
movq (%r14), %rax
testq %rax, %rax
je 0x1ea09
movswl 0x4(%rax), %ecx
incl %ecx
movl %ecx, (%rbx)
movswl 0x6(%rax), %eax
incl %eax
jmp 0x1ea14
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x4(%rbx)
movl $0x3, %edi
movl $0x32, %esi
movl $0xa, %edx
movl $0x5, %ecx
callq 0x3580
movq %rax, 0xc8(%rbx)
movl $0x1d, %edi
movl $0x28, %esi
movl $0x5, %edx
movl $0x5, %ecx
callq 0x3580
movq %rax, 0xd0(%rbx)
callq 0x36b0
movl $0x1, %edi
movl $0x4, %esi
xorl %edx, %edx
callq 0x32a0
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x32a0
movl $0x3, %edi
movl $0x3, %esi
xorl %edx, %edx
callq 0x32a0
movl $0x4, %edi
movl $0x7, %esi
xorl %edx, %edx
callq 0x32a0
movl $0x5, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x32a0
movl $0x6, %edi
movl $0x6, %esi
xorl %edx, %edx
callq 0x32a0
movl $0x7, %edi
movl $0x3, %esi
xorl %edx, %edx
callq 0x32a0
movl $0x8, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x32a0
movl $0x9, %edi
movl $0x4, %esi
xorl %edx, %edx
callq 0x32a0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x4786
xorl %ebx, %ebx
jmp 0x1eaf5