#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setecho(int /*<<< orphan*/, int);
int /*<<< orphan*/ system(char *);
void cleanup_terminal_noncurses(void) {
  setecho(STDIN_FILENO, 1);
  printf("\033[0m\n");
  system("setfont  >/dev/null 2>&1");
  system(
      "setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz  >/dev/null 2>&1");
  system("setterm -cursor on");
  system("setterm -blank 10");
  system("clear");
}


x86 assembly (clang, -O0):
<cleanup_terminal_noncurses>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <setecho@plt>
lea    0xeb2(%rip),%rdi
call   1050 <printf@plt>
lea    0xeac(%rip),%rdi
call   1040 <system@plt>
lea    0xeb9(%rip),%rdi
call   1040 <system@plt>
lea    0xef2(%rip),%rdi
call   1040 <system@plt>
lea    0xef9(%rip),%rdi
call   1040 <system@plt>
lea    0xeff(%rip),%rdi
call   1040 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_terminal_noncurses>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <setecho@plt>
lea    0xf3e(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
call   1050 <system@plt>
lea    0xeb6(%rip),%rdi
call   1050 <system@plt>
lea    0xeef(%rip),%rdi
call   1050 <system@plt>
lea    0xef6(%rip),%rdi
call   1050 <system@plt>
lea    0xefc(%rip),%rdi
pop    %rax
jmp    1050 <system@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@.str = [6 x i8] c"\1B[0m\0A\00"
@.str.1 = [25 x i8] c"setfont >/dev/null 2>&1\00"
@.str.2 = [69 x i8] c"setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz >/dev/null 2>&1\00"
@.str.3 = [19 x i8] c"setterm -cursor on\00"
@.str.4 = [18 x i8] c"setterm -blank 10\00"
@.str.5 = [6 x i8] c"clear\00"
define void @cleanup_terminal_noncurses() {
%1 = load i32, i32* @STDIN_FILENO
%2 = call i32 @setecho(i32 %1, i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@.str.1 = [25 x i8] c"setfont >/dev/null 2>&1\00"
@.str.2 = [69 x i8] c"setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz >/dev/null 2>&1\00"
@.str.3 = [19 x i8] c"setterm -cursor on\00"
@.str.4 = [18 x i8] c"setterm -blank 10\00"
@.str.5 = [6 x i8] c"clear\00"
@str = [5 x i8] c"\1B[0m\00"
define void @cleanup_terminal_noncurses() {
%1 = load i32, i32* @STDIN_FILENO
%2 = tail call i32 @setecho(i32 %1, i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}