// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x48, %rsp
leaq -0x318(%rip), %rsi      # 0x391f
movl $0x1c, %edi
callq 0x2240
callq 0x37f0
movl %eax, %ebp
callq 0x3854
movl %eax, %ebx
testl %ebp, %ebp
setg %al
testl %ebx, %ebx
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3c94
imull %ebp, %ebx
movq %rbx, %rdi
callq 0x22c0
movq %rax, 0x368e(%rip)      # 0x7300
testq %rax, %rax
je 0x3dd6
movq 0x332e(%rip), %rcx      # 0x6fb0
movq (%rcx), %rdi
movq %rax, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x2030
jmp 0x3c9f
movq $0x0, 0x3661(%rip) # 0x7300
movl $0x0, 0x364f(%rip)      # 0x72f8
leaq 0x35c0(%rip), %rax      # 0x7270
movq (%rax), %r15
testq %r15, %r15
je 0x3d11
movq 0x32f1(%rip), %r14      # 0x6fb0
leaq 0x16e2(%rip), %rbx      # 0x53a8
incl 0x362c(%rip)            # 0x72f8
movq (%r14), %rdi
movq %rbx, %rsi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x2310
movq 0x198(%r15), %r15
testq %r15, %r15
jne 0x3cc6
movl 0x3608(%rip), %ebp      # 0x72f8
testl %ebp, %ebp
jle 0x3d11
leaq 0x16b1(%rip), %rbx      # 0x53ac
movq (%r14), %rdi
movq %rbx, %rsi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x2310
decl %ebp
jne 0x3cfb
movq 0x3298(%rip), %r14      # 0x6fb0
movq (%r14), %rdi
leaq 0x166e(%rip), %rsi      # 0x5390
xorl %ebx, %ebx
movl $0x1b, %edx
xorl %eax, %eax
callq 0x2310
movl $0x0, 0x35be(%rip)      # 0x72f8
movq (%r14), %rdi
leaq 0x1659(%rip), %rsi      # 0x539d
movl $0x1b, %edx
xorl %eax, %eax
callq 0x2310
movl $0x1, %edi
callq 0x23b0
testl %eax, %eax
je 0x3db4
leaq 0x35a3(%rip), %rsi      # 0x7308
movl $0x1, %edi
callq 0x2200
testl %eax, %eax
jne 0x3db4
movups 0x358e(%rip), %xmm0     # 0x7308
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movups 0x35ad(%rip), %xmm0     # 0x7334
movups %xmm0, 0x2c(%rdx)
movups 0x3596(%rip), %xmm0     # 0x7328
movaps %xmm0, 0x20(%rdx)
movups 0x357b(%rip), %xmm0     # 0x7318
movaps %xmm0, 0x10(%rdx)
andb $-0x49, 0xc(%rdx)
movl $0x1, %edi
movl $0x2, %esi
callq 0x22b0
leaq 0x3461(%rip), %rax      # 0x721c
movl (%rax), %eax
leal 0x1(%rax), %ecx
testl %eax, %eax
cmovgl %ecx, %ebx
movl %ebx, 0x3579(%rip)      # 0x7344
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x130a(%rip), %rdi      # 0x50e7
callq 0x2170
jmp 0x3c9f