// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/termio.c
// Function: termio_init
void
termio_init(void)
{
#ifndef NCURSES
	struct termios term;
	struct target *t;
	int x, y;

	signal(SIGWINCH, sigwinch);
	x = getmaxx();
	y = getmaxy();
	if (x > 0 && y > 0) {
	scrbuffer = malloc(x * y);
	if (scrbuffer != NULL)
		setvbuf(stdout, scrbuffer, _IOFBF, x * y);
	else
		perror("malloc");
	} else {
		scrbuffer = NULL;
	}

	/* Reserve space on terminal */
	cursor_y = 0;
	DL_FOREACH(list, t) {
		cursor_y++;
		scrolldown(1);
	}
	scrollup(cursor_y);

	/* Establish reference point for move() */
	fprintf(stdout, "\r%c[s", 0x1b);
	cursor_y = 0;

	/* Avoid mangling output by disabling input echo and wrapping */
	fprintf(stdout, "%c[7l", 0x1b);
	if (isatty(STDOUT_FILENO) && tcgetattr(STDOUT_FILENO, &oterm) == 0) {
		memcpy(&term, &oterm, sizeof(term));
		term.c_lflag &= ~(ECHO | ECHONL);
		tcsetattr(STDOUT_FILENO, TCSAFLUSH, &term);
	}
#else /* NCURSES */
	initscr();
#endif /* !NCURSES */
	labelwidth = (w_width > 0 ? w_width + 1 : 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
leaq -0x2db(%rip), %rsi      # 0x365d
pushq $0x1c
popq %rdi
callq 0x2240
callq 0x3538
movl %eax, %ebp
callq 0x359a
movl %eax, %ebx
testl %ebp, %ebp
setg %al
testl %ebx, %ebx
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3993
imull %ebp, %ebx
movq %rbx, %rdi
callq 0x22c0
movq %rax, 0x498f(%rip)      # 0x8300
testq %rax, %rax
je 0x3ac5
movq 0x462f(%rip), %rcx      # 0x7fb0
movq (%rcx), %rdi
movq %rax, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x2030
jmp 0x399b
andq $0x0, 0x4965(%rip)      # 0x8300
andl $0x0, 0x4956(%rip)      # 0x82f8
leaq 0x48c7(%rip), %r12      # 0x8270
movq 0x4600(%rip), %r14      # 0x7fb0
leaq 0x19f1(%rip), %rbx      # 0x53a8
pushq $0x1b
popq %rbp
movq (%r12), %r12
movl 0x4933(%rip), %r15d     # 0x82f8
testq %r12, %r12
je 0x39ec
incl %r15d
movl %r15d, 0x4924(%rip)     # 0x82f8
movq (%r14), %rdi
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2310
addq $0x198, %r12            # imm = 0x198
jmp 0x39ba
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
leaq 0x19b0(%rip), %rbx      # 0x53ac
pushq $0x1b
popq %rbp
movq (%r14), %rdi
subl $0x1, %r15d
jb 0x3a16
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2310
jmp 0x39ff
leaq 0x1973(%rip), %rsi      # 0x5390
xorl %ebp, %ebp
pushq $0x1b
popq %rbx
movl %ebx, %edx
xorl %eax, %eax
callq 0x2310
andl $0x0, 0x48c6(%rip)      # 0x82f8
movq (%r14), %rdi
leaq 0x1961(%rip), %rsi      # 0x539d
movl %ebx, %edx
xorl %eax, %eax
callq 0x2310
pushq $0x1
popq %rdi
callq 0x23b0
testl %eax, %eax
je 0x3aa1
leaq 0x48b0(%rip), %rsi      # 0x8308
pushq $0x1
popq %rdi
callq 0x2200
testl %eax, %eax
jne 0x3aa1
movups 0x489d(%rip), %xmm0     # 0x8308
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movups 0x48bc(%rip), %xmm0     # 0x8334
movups %xmm0, 0x2c(%rdx)
movups 0x48a5(%rip), %xmm0     # 0x8328
movaps %xmm0, 0x20(%rdx)
movups 0x488a(%rip), %xmm0     # 0x8318
movaps %xmm0, 0x10(%rdx)
andb $-0x49, 0xc(%rdx)
pushq $0x1
popq %rdi
pushq $0x2
popq %rsi
callq 0x22b0
leaq 0x4774(%rip), %rax      # 0x821c
movl (%rax), %eax
leal 0x1(%rax), %ecx
testl %eax, %eax
cmovgl %ecx, %ebp
movl %ebp, 0x488c(%rip)      # 0x8344
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x161b(%rip), %rdi      # 0x50e7
callq 0x2170
jmp 0x399b