// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/build.c
// Function: getnumber256
short getnumber256(char *namestart, short num, int maxnumber, char sign)
{
	char buffer[80], ch;
	int n, danum, oldnum;

	danum = (int)num;
	oldnum = danum;
	bflushchars();
	while (keystatus[0x1] == 0)
	{
		if (handleevents()) {
			if (quitevent) quitevent = 0;
		}

		drawrooms(posx,posy,posz,ang,horiz,cursectnum);
		ExtAnalyzeSprites();
		drawmasks();

		ch = bgetchar();

		snprintf(buffer, sizeof(buffer), "%s%d_ ",namestart,danum);
		printmessage256(buffer);
		showframe();

		if (ch >= '0' && ch <= '9') {
			if (sign && danum<0)
				n = (danum*10)-(ch-'0');
			else
				n = (danum*10)+(ch-'0');
			if (n < maxnumber) danum = n;
		} else if (ch == 8 || ch == 127) {	// backspace
			danum /= 10;
		} else if (ch == 13) {
			oldnum = danum;
			asksave = 1;
			break;
		} else if (ch == '-' && sign) {	// negate
			danum = -danum;
		}
	}
	clearkeys();

	lockclock = totalclock;  //Reset timing

	return((short)oldnum);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %cl, %al
movw %si, %cx
movq %rdi, -0x8(%rbp)
movw %cx, -0xa(%rbp)
movl %edx, -0x10(%rbp)
movb %al, -0x11(%rbp)
movswl -0xa(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0x80(%rbp)
callq 0x2dee0
leaq 0x196729(%rip), %rax    # 0x1badf0
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x24819
callq 0xa6ab0
cmpl $0x0, %eax
je 0x246f6
leaq 0x19651b(%rip), %rax    # 0x1bac00
cmpb $0x0, (%rax)
je 0x246f4
leaq 0x19650f(%rip), %rax    # 0x1bac00
movb $0x0, (%rax)
jmp 0x246f6
movl 0x145db4(%rip), %edi    # 0x16a4b0
movl 0x145db2(%rip), %esi    # 0x16a4b4
movl 0x145db0(%rip), %edx    # 0x16a4b8
movw 0x145dad(%rip), %ax     # 0x16a4bc
movl 0xbb85a(%rip), %r8d     # 0xdff70
movswl %ax, %ecx
movswl 0x145d9d(%rip), %r9d    # 0x16a4be
callq 0x38730
callq 0xc230
callq 0x3bb80
callq 0x2de70
movb %al, -0x71(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl -0x7c(%rbp), %r8d
movl $0x50, %esi
leaq 0x8c1d1(%rip), %rdx     # 0xb0921
movb $0x0, %al
callq 0x6490
leaq -0x70(%rbp), %rdi
callq 0x19f30
callq 0xa67c0
movsbl -0x71(%rbp), %eax
cmpl $0x30, %eax
jl 0x247b8
movsbl -0x71(%rbp), %eax
cmpl $0x39, %eax
jg 0x247b8
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
je 0x24798
cmpl $0x0, -0x7c(%rbp)
jge 0x24798
imull $0xa, -0x7c(%rbp), %eax
movsbl -0x71(%rbp), %ecx
subl $0x30, %ecx
subl %ecx, %eax
movl %eax, -0x78(%rbp)
jmp 0x247a8
imull $0xa, -0x7c(%rbp), %eax
movsbl -0x71(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x247b6
movl -0x78(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x24814
movsbl -0x71(%rbp), %eax
cmpl $0x8, %eax
je 0x247ca
movsbl -0x71(%rbp), %eax
cmpl $0x7f, %eax
jne 0x247da
movl -0x7c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0x7c(%rbp)
jmp 0x24812
movsbl -0x71(%rbp), %eax
cmpl $0xd, %eax
jne 0x247f4
movl -0x7c(%rbp), %eax
movl %eax, -0x80(%rbp)
movw $0x1, 0x145894(%rip)    # 0x16a086
jmp 0x24819
movsbl -0x71(%rbp), %eax
cmpl $0x2d, %eax
jne 0x2480e
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
je 0x2480e
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x24810
jmp 0x24812
jmp 0x24814
jmp 0x246c0
callq 0xc2a0
leaq 0x3c4823(%rip), %rax    # 0x3e9048
movl (%rax), %eax
movl %eax, 0x145c93(%rip)    # 0x16a4c0
movl -0x80(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)