// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_tview_curses.c
// Function: curses_loop
static int curses_loop(tview_t* tv)
	{
	int tid, pos;
	curses_tview_t *CTV=(curses_tview_t *)tv;
	tid = tv->curr_tid; pos = tv->left_pos;
	while (1) {
		int c = getch();
		switch (c) {
			case '?': tv_win_help(CTV); break;
			case '\033':
			case 'q': goto end_loop;
			case '/': 
			case 'g': tv_win_goto(CTV, &tid, &pos); break;
			case 'm': tv->color_for = TV_COLOR_MAPQ; break;
			case 'b': tv->color_for = TV_COLOR_BASEQ; break;
			case 'n': tv->color_for = TV_COLOR_NUCL; break;
			case 'c': tv->color_for = TV_COLOR_COL; break;
			case 'z': tv->color_for = TV_COLOR_COLQ; break;
			case 's': tv->no_skip = !tv->no_skip; break;
			case 'r': tv->show_name = !tv->show_name; break;
			case KEY_LEFT:
			case 'h': --pos; break;
			case KEY_RIGHT:
			case 'l': ++pos; break;
			case KEY_SLEFT:
			case 'H': pos -= 20; break;
			case KEY_SRIGHT:
			case 'L': pos += 20; break;
			case '.': tv->is_dot = !tv->is_dot; break;
			case 'N': tv->base_for = TV_BASE_NUCL; break;
			case 'C': tv->base_for = TV_BASE_COLOR_SPACE; break;
			case 'i': tv->ins = !tv->ins; break;
			case '\010': pos -= 1000; break;
			case '\014': pos += 1000; break;
			case ' ': pos += tv->mcol; break;
			case KEY_UP:
			case 'j': --tv->row_shift; break;
			case KEY_DOWN:
			case 'k': ++tv->row_shift; break;
			case KEY_BACKSPACE:
			case '\177': pos -= tv->mcol; break;
			case KEY_RESIZE: getmaxyx(stdscr, tv->mrow, tv->mcol); break;
			default: continue;
		}
		if (pos < 0) pos = 0;
		if (tv->row_shift < 0) tv->row_shift = 0;
		tv->my_drawaln(tv, tid, pos);
	}
end_loop:
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
movl 0x28(%rdi), %ebp
movl 0x2c(%rdi), %r13d
movq 0x30331(%rip), %r12     # 0x4efd8
leaq 0x20(%rsp), %r15
movq (%r12), %rdi
callq 0x37b0
cmpl $0x61, %eax
jle 0x1ece9
cmpl $0x101, %eax            # imm = 0x101
jg 0x1ed1e
addl $-0x62, %eax
cmpl $0x1d, %eax
ja 0x1f396
leaq 0x23348(%rip), %rcx     # 0x4201c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, 0x50(%rbx)
jmp 0x1f3ab
cmpl $0x2e, %eax
jle 0x1ed4f
cmpl $0x47, %eax
jg 0x1ed84
cmpl $0x2f, %eax
je 0x1ee35
cmpl $0x3f, %eax
je 0x1f0a7
cmpl $0x43, %eax
jne 0x1f396
movl $0x1, 0x4c(%rbx)
jmp 0x1f3ab
cmpl $0x188, %eax            # imm = 0x188
jg 0x1edab
addl $0xfffffefe, %eax       # imm = 0xFFFFFEFE
cmpl $0x5, %eax
ja 0x1f396
leaq 0x23356(%rip), %rcx     # 0x42094
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
incl 0x48(%rbx)
jmp 0x1f3ab
cmpl $0x1a, %eax
jle 0x1edec
cmpl $0x1b, %eax
je 0x1ee2b
cmpl $0x20, %eax
je 0x1f092
cmpl $0x2e, %eax
jne 0x1f396
xorl %eax, %eax
cmpl $0x0, 0x54(%rbx)
sete %al
movl %eax, 0x54(%rbx)
jmp 0x1f3ab
cmpl $0x48, %eax
je 0x1f026
cmpl $0x4c, %eax
je 0x1f01d
cmpl $0x4e, %eax
jne 0x1f396
movl $0x0, 0x4c(%rbx)
jmp 0x1f3ab
cmpl $0x189, %eax            # imm = 0x189
je 0x1f026
cmpl $0x192, %eax            # imm = 0x192
je 0x1f01d
cmpl $0x19a, %eax            # imm = 0x19A
jne 0x1f396
movq (%r12), %rax
testq %rax, %rax
je 0x1f39d
movswl 0x4(%rax), %ecx
incl %ecx
movl %ecx, (%rbx)
movswl 0x6(%rax), %eax
incl %eax
jmp 0x1f3a8
cmpl $0x8, %eax
je 0x1f09b
cmpl $0xc, %eax
jne 0x1f396
addl $0x3e8, %r13d           # imm = 0x3E8
jmp 0x1f3ab
subl 0x4(%rbx), %r13d
jmp 0x1f3ab
decl 0x48(%rbx)
jmp 0x1f3ab
incl %r13d
jmp 0x1f3ab
decl %r13d
jmp 0x1f3ab
movl $0x5, %eax
jmp 0x1f3d4
movq 0xc8(%rbx), %rdi
subq $0x8, %rsp
movl $0x7c, %esi
movl $0x7c, %edx
movl $0x2d, %ecx
movl $0x2d, %r8d
movl $0x2b, %r9d
movl $0x2b, %eax
pushq %rax
pushq %rax
pushq %rax
callq 0x3470
addq $0x20, %rsp
movq 0xc8(%rbx), %rdi
xorl %r12d, %r12d
movl $0x1, %esi
movl $0x2, %edx
leaq 0x23525(%rip), %rcx     # 0x423ac
xorl %eax, %eax
callq 0x3190
movq 0xc8(%rbx), %rdi
callq 0x37b0
movl %eax, %r14d
movq 0xc8(%rbx), %rdi
callq 0x33f0
cmpl $0x7e, %r14d
jg 0x1eece
cmpl $0x8, %r14d
je 0x1eeea
cmpl $0xa, %r14d
je 0x1ef5c
cmpl $0xd, %r14d
je 0x1ef5c
jmp 0x1efca
cmpl $0x7f, %r14d
je 0x1eeea
cmpl $0x157, %r14d           # imm = 0x157
je 0x1ef5c
cmpl $0x107, %r14d           # imm = 0x107
jne 0x1efca
xorl %eax, %eax
testl %r12d, %r12d
setg %al
subl %eax, %r12d
movslq %r12d, %rax
movb $0x0, 0x20(%rsp,%rax)
movl $0x8, %r14d
movq 0xc8(%rbx), %rdi
movl $0x1, %esi
movl %r14d, %edx
callq 0x3550
cmpl $-0x1, %eax
je 0x1ef2d
movq 0xc8(%rbx), %rdi
movl $0x20, %esi
callq 0x33b0
incl %r14d
cmpl $0x30, %r14d
jne 0x1ef03
movq 0xc8(%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
leaq 0x257e3(%rip), %rcx     # 0x44731
movq %r15, %r8
xorl %eax, %eax
callq 0x3190
movb $0x1, %cl
jmp 0x1efc0
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
cmpb $0x3d, 0x20(%rsp)
jne 0x1ef8e
leaq 0x21(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movl $0xa, %edx
callq 0x34b0
decl %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
jg 0x1efbb
jmp 0x1eef5
movq 0x18(%rbx), %rdi
movq %r15, %rsi
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x14(%rsp), %r8
callq 0x22482
movl 0x10(%rsp), %ecx
testl %ecx, %ecx
js 0x1eef5
movl 0xc(%rsp), %eax
movl %ecx, %ebp
xorl %ecx, %ecx
movl %eax, %r13d
testb %cl, %cl
jne 0x1ee8e
jmp 0x1f011
callq 0x33c0
movq (%rax), %rax
movslq %r14d, %rcx
cmpw $0x0, (%rax,%rcx,2)
js 0x1efef
xorl %ecx, %ecx
cmpl $0x17, %r14d
je 0x1f009
cmpl $0x1b, %r14d
je 0x1efc0
jmp 0x1eef5
cmpl $0x27, %r12d
jg 0x1eef5
movslq %r12d, %rax
incl %r12d
movb %r14b, 0x20(%rsp,%rax)
jmp 0x1eef5
xorl %r12d, %r12d
jmp 0x1eef5
movq 0x2ffc0(%rip), %r12     # 0x4efd8
jmp 0x1f3ab
addl $0x14, %r13d
jmp 0x1f3ab
addl $-0x14, %r13d
jmp 0x1f3ab
movl $0x4, 0x50(%rbx)
jmp 0x1f3ab
movl $0x0, 0x50(%rbx)
jmp 0x1f3ab
xorl %eax, %eax
cmpl $0x0, 0x5c(%rbx)
sete %al
movl %eax, 0x5c(%rbx)
jmp 0x1f3ab
movl $0x3, 0x50(%rbx)
jmp 0x1f3ab
xorl %eax, %eax
cmpl $0x0, 0x60(%rbx)
sete %al
movl %eax, 0x60(%rbx)
jmp 0x1f3ab
movl $0x2, 0x50(%rbx)
jmp 0x1f3ab
xorl %eax, %eax
cmpl $0x0, 0x64(%rbx)
sete %al
movl %eax, 0x64(%rbx)
jmp 0x1f3ab
addl 0x4(%rbx), %r13d
jmp 0x1f3ab
addl $0xfffffc18, %r13d      # imm = 0xFFFFFC18
jmp 0x1f3ab
movq 0xd0(%rbx), %r14
subq $0x8, %rsp
movq %r14, %rdi
movl $0x7c, %esi
movl $0x7c, %edx
movl $0x2d, %ecx
movl $0x2d, %r8d
movl $0x2b, %r9d
movl $0x2b, %eax
pushq %rax
pushq %rax
pushq %rax
callq 0x3470
addq $0x20, %rsp
movq %r14, %rdi
movl $0x1, %esi
movl $0x2, %edx
leaq 0x22fc6(%rip), %rcx     # 0x420bb
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x3, %esi
movl $0x2, %edx
leaq 0x22fc7(%rip), %rcx     # 0x420d7
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x4, %esi
movl $0x2, %edx
leaq 0x22fc3(%rip), %rcx     # 0x420ee
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x5, %esi
movl $0x2, %edx
leaq 0x22fc9(%rip), %rcx     # 0x4210f
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x6, %esi
movl $0x2, %edx
leaq 0x22fcf(%rip), %rcx     # 0x42130
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x7, %esi
movl $0x2, %edx
leaq 0x22fd5(%rip), %rcx     # 0x42151
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x8, %esi
movl $0x2, %edx
leaq 0x22fd4(%rip), %rcx     # 0x4216b
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x9, %esi
movl $0x2, %edx
leaq 0x22fd4(%rip), %rcx     # 0x42186
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0xa, %esi
movl $0x2, %edx
leaq 0x22fd6(%rip), %rcx     # 0x421a3
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0xb, %esi
movl $0x2, %edx
leaq 0x22fdd(%rip), %rcx     # 0x421c5
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0xc, %esi
movl $0x2, %edx
leaq 0x22fe5(%rip), %rcx     # 0x421e8
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0xd, %esi
movl $0x2, %edx
leaq 0x22fec(%rip), %rcx     # 0x4220a
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0xe, %esi
movl $0x2, %edx
leaq 0x22ff1(%rip), %rcx     # 0x4222a
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0xf, %esi
movl $0x2, %edx
leaq 0x22ff8(%rip), %rcx     # 0x4224c
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x10, %esi
movl $0x2, %edx
leaq 0x22ffb(%rip), %rcx     # 0x4226a
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x11, %esi
movl $0x2, %edx
leaq 0x22ffd(%rip), %rcx     # 0x42287
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x12, %esi
movl $0x2, %edx
leaq 0x23004(%rip), %rcx     # 0x422a9
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x13, %esi
movl $0x2, %edx
leaq 0x2300b(%rip), %rcx     # 0x422cb
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x14, %esi
movl $0x2, %edx
leaq 0x23011(%rip), %rcx     # 0x422ec
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x15, %esi
movl $0x2, %edx
leaq 0x23011(%rip), %rcx     # 0x42307
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x16, %esi
movl $0x2, %edx
leaq 0x23011(%rip), %rcx     # 0x42322
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x17, %esi
movl $0x2, %edx
leaq 0x23013(%rip), %rcx     # 0x4233f
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x19, %esi
movl $0x2, %edx
leaq 0x23008(%rip), %rcx     # 0x4234f
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x1a, %esi
movl $0x2, %edx
leaq 0x23011(%rip), %rcx     # 0x42373
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
movl $0x1b, %esi
movl $0x2, %edx
leaq 0x23013(%rip), %rcx     # 0x42390
xorl %eax, %eax
callq 0x3190
movq %r14, %rdi
callq 0x33f0
movq %r14, %rdi
callq 0x37b0
jmp 0x1f3ab
movl $0x2, %eax
jmp 0x1f3d4
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x4(%rbx)
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
cmpl $0x0, 0x48(%rbx)
jns 0x1f3c4
movl $0x0, 0x48(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
movl %r13d, %edx
callq *0xb0(%rbx)
xorl %eax, %eax
testb $0x5, %al
je 0x1ecac
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq