// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/options.c
// Function: get_str
int get_str(char *opt,WINDOW *awin)
{
	char *sp;
	int c, oy, ox;
	char buf[LINLEN];

	draw(awin);
	getyx(awin, oy, ox);
	/*
	 * loop reading in the string, and put it in a temporary buffer
	 */
	for (sp = buf; (c=wgetch(awin)) != '\n' && c != '\r' && c != ESCAPE;
	  wclrtoeol(awin), draw(awin)) {
		if (( (int)sp - (int)buf ) >= 50) {
			*sp = '\0';			/* line was too long */
			strucpy(opt,buf,strlen(buf));
			mvwaddstr(awin, 0, 0, "Name was truncated --More--");
			wclrtoeol(awin);
			draw(awin);
			wait_for(awin, ' ');
			mvwprintw(awin, 0, 0, "Called: %s",opt);
			draw(awin);
			return NORM;
		}
		if (c == -1)
			continue;
		else if(c == terminal.c_cc[VERASE])	{	/* process erase char */
			if (sp > buf) {
				int i;
	
				sp--;
				for (i = strlen(unctrl(*sp)); i; i--)
					waddch(awin, '\b');
			}
			continue;
		}
		else if (c == terminal.c_cc[VKILL]) {   /* process kill character */
			sp = buf;
			wmove(awin, oy, ox);
			continue;
		}
		else if (sp == buf) {
			if (c == CTRLB)			/* CTRL - B */
				break;
			if (c == '~') {
				strcpy(buf, home);
				waddstr(awin, home);
				sp += strlen(home);
				continue;
			}
		}
		*sp++ = c;
		waddstr(awin, unctrl(c));
	}
	*sp = '\0';
	if (sp > buf)	/* only change option if something was typed */
		strucpy(opt, buf, strlen(buf));
	wmove(awin, oy, ox);
	waddstr(awin, opt);
	waddstr(awin, "\n\r");
	draw(awin);
	if (awin == cw)
		mpos += sp - buf;
	if (c == CTRLB)
		return MINUS;
	if (c == ESCAPE)
		return QUIT;
	return NORM;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x61f0
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x13c43
movq -0x18(%rbp), %rax
movswl (%rax), %eax
movl %eax, -0x88(%rbp)
jmp 0x13c50
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x88(%rbp)
jmp 0x13c50
movl -0x88(%rbp), %eax
movl %eax, -0x28(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x13c71
movq -0x18(%rbp), %rax
movswl 0x2(%rax), %eax
movl %eax, -0x8c(%rbp)
jmp 0x13c7e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x8c(%rbp)
jmp 0x13c7e
movl -0x8c(%rbp), %eax
movl %eax, -0x2c(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6100
movl %eax, %ecx
movl %ecx, -0x24(%rbp)
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, -0x8d(%rbp)
je 0x13cc5
xorl %eax, %eax
cmpl $0xd, -0x24(%rbp)
movb %al, -0x8d(%rbp)
je 0x13cc5
cmpl $0x1b, -0x24(%rbp)
setne %al
movb %al, -0x8d(%rbp)
movb -0x8d(%rbp), %al
testb $0x1, %al
jne 0x13cd4
jmp 0x13efc
movq -0x20(%rbp), %rax
leaq -0x80(%rbp), %rcx
subl %ecx, %eax
cmpl $0x32, %eax
jl 0x13d9a
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x6160
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movl %eax, %edx
callq 0x13ff0
movq -0x18(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x6490
cmpl $-0x1, %eax
jne 0x13d36
jmp 0x13d4b
movq -0x18(%rbp), %rdi
leaq 0x17ccc(%rip), %rsi     # 0x2ba0d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6560
movq -0x18(%rbp), %rdi
callq 0x64a0
movq -0x18(%rbp), %rdi
callq 0x61f0
movq -0x18(%rbp), %rdi
movl $0x20, %esi
callq 0xdbc0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %r8
xorl %edx, %edx
leaq 0x17cad(%rip), %rcx     # 0x2ba29
movl %edx, %esi
movb $0x0, %al
callq 0x6200
movq -0x18(%rbp), %rdi
callq 0x61f0
movl $0x0, -0x4(%rbp)
jmp 0x13fdb
cmpl $-0x1, -0x24(%rbp)
jne 0x13da5
jmp 0x13ee5
movl -0x24(%rbp), %eax
leaq 0x28121(%rip), %rcx     # 0x3bed0
movzbl 0x13(%rcx), %ecx
cmpl %ecx, %eax
jne 0x13e19
movq -0x20(%rbp), %rax
leaq -0x80(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x13e14
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %edi
callq 0x6420
movq %rax, %rdi
callq 0x6160
movl %eax, -0x84(%rbp)
cmpl $0x0, -0x84(%rbp)
je 0x13e12
movq -0x18(%rbp), %rdi
movl $0x8, %esi
callq 0x64c0
movl -0x84(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x13dea
jmp 0x13e14
jmp 0x13ee5
movl -0x24(%rbp), %eax
leaq 0x280ad(%rip), %rcx     # 0x3bed0
movzbl 0x14(%rcx), %ecx
cmpl %ecx, %eax
jne 0x13e47
leaq -0x80(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x2c(%rbp), %edx
callq 0x6490
jmp 0x13ee5
movq -0x20(%rbp), %rax
leaq -0x80(%rbp), %rcx
cmpq %rcx, %rax
jne 0x13ea2
cmpl $0x2, -0x24(%rbp)
jne 0x13e5f
jmp 0x13efc
cmpl $0x7e, -0x24(%rbp)
jne 0x13ea0
leaq -0x80(%rbp), %rdi
leaq 0x23670(%rip), %rsi     # 0x374e0
callq 0x60d0
movq -0x18(%rbp), %rdi
leaq 0x23660(%rip), %rsi     # 0x374e0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6560
leaq 0x2364f(%rip), %rdi     # 0x374e0
callq 0x6160
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x13ee5
jmp 0x13ea2
jmp 0x13ea4
jmp 0x13ea6
jmp 0x13ea8
movl -0x24(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x24(%rbp), %edi
callq 0x6420
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6560
movq -0x18(%rbp), %rdi
callq 0x64a0
movq -0x18(%rbp), %rdi
callq 0x61f0
jmp 0x13c8f
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x20(%rbp), %rax
leaq -0x80(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x13f44
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x6160
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movl %eax, %edx
callq 0x13ff0
movq -0x18(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x2c(%rbp), %edx
callq 0x6490
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6560
movq -0x18(%rbp), %rdi
leaq 0x1a047(%rip), %rsi     # 0x2dfb7
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6560
movq -0x18(%rbp), %rdi
callq 0x61f0
movq -0x18(%rbp), %rax
leaq 0x25ec2(%rip), %rcx     # 0x39e50
cmpq (%rcx), %rax
jne 0x13fb6
movq -0x20(%rbp), %rcx
leaq -0x80(%rbp), %rax
subq %rax, %rcx
leaq 0x22d3b(%rip), %rax     # 0x36ce0
movslq (%rax), %rax
addq %rcx, %rax
movl %eax, %ecx
leaq 0x22d2c(%rip), %rax     # 0x36ce0
movl %ecx, (%rax)
cmpl $0x2, -0x24(%rbp)
jne 0x13fc5
movl $0x2, -0x4(%rbp)
jmp 0x13fdb
cmpl $0x1b, -0x24(%rbp)
jne 0x13fd4
movl $0x1, -0x4(%rbp)
jmp 0x13fdb
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)