#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 */
struct termios {
  int /*<<< orphan*/ c_lflag;
};

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ ISIG;
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
int main(void) {
  struct termios tc;
  tcgetattr(0, &tc);
  tc.c_lflag &= ~ISIG;
  tcsetattr(0, TCSANOW, &tc);
  printf("You can not stop me!\n");
  while (true) {
    sleep(1);
    printf("UCCU (´∀`)σ)Д`)\n");
  }
  tc.c_lflag |= ISIG;
  tcsetattr(0, TCSANOW, &tc);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1040 <tcgetattr@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1050 <tcsetattr@plt>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x4c>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <tcgetattr@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
not    %eax
and    %eax,0x8(%rsp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1050 <tcsetattr@plt>
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1190 <main+0x50>

LLVM IR (-O0):
%struct.termios = type { i32 }
@ISIG = global i32 0
@TCSANOW = global i32 0
@.str = [22 x i8] c"You can not stop me!\0A\00"
@.str.1 = [22 x i8] c"UCCU (\C2\B4\E2\88\80`)\CF\83)\D0\94`)\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.termios
store i32 0, i32* %1
%3 = call i32 @tcgetattr(i32 0, %struct.termios* %2)
%4 = load i32, i32* @ISIG
%5 = xor i32 %4, -1
%6 = getelementptr inbounds %struct.termios, %struct.termios* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, %5
store i32 %8, i32* %6
%9 = load i32, i32* @TCSANOW
%10 = call i32 @tcsetattr(i32 0, i32 %9, %struct.termios* %2)
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %0, %12
%13 = call i32 @sleep(i32 1)
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %12
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@ISIG = global i32 0
@TCSANOW = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [21 x i8] c"You can not stop me!\00"
@str.2 = [21 x i8] c"UCCU (\C2\B4\E2\88\80`)\CF\83)\D0\94`)\00"
define i32 @main() {
%1 = alloca %struct.termios
%2 = bitcast %struct.termios* %1 to i8*
%3 = call i32 @tcgetattr(i32 0, %struct.termios* %1)
%4 = load i32, i32* @ISIG
%5 = xor i32 %4, -1
%6 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, %5
store i32 %8, i32* %6
%9 = load i32, i32* @TCSANOW
%10 = call i32 @tcsetattr(i32 0, i32 %9, %struct.termios* %1)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %12, %0
%13 = call i32 @sleep(i32 1)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
br label %12
}