#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 */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
scalar_t__ strchr(char *, char);
int /*<<< orphan*/ strncmp(char *, char *, int);
int main() {
  char genbuf[256], *str, *buf;
  while (fgets(genbuf, 255, stdin)) {
    register int ansi;
    if (!strncmp(genbuf, "References", 10))
      break;
    str = genbuf;
    buf = genbuf;
    if (!strncmp(genbuf, "lynx: Can't access", 18)) {
      printf("®ð¶H³ø¾É¤p©j¥ð°²¤¤,½Ð¨ìRecordª©Â½¹L¥h¸ê®Æ.");
      break;
    }
    for (ansi = 0; *str; str++) {
      if (*str == '[' && strchr("0123456789", *(str + 1))) {
        ansi = 1;
      } else if (ansi) {
        if (!strchr("0123456789]", *str)) {
          ansi = 0;
          if (str)
            *buf++ = *str;
        }
      } else {
        if (str)
          *buf++ = *str;
      }
    }
    *buf = 0;
    printf(genbuf);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1325 <main+0x1e5>
lea    -0x110(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    119c <main+0x5c>
jmp    1325 <main+0x1e5>
lea    -0x110(%rbp),%rax
mov    %rax,-0x118(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x120(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xe45(%rip),%rsi
mov    $0x12,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11ea <main+0xaa>
lea    0xe3e(%rip),%rdi
call   1050 <printf@plt>
jmp    1325 <main+0x1e5>
movl   $0x0,-0x124(%rbp)
mov    -0x118(%rbp),%rax
cmpb   $0x0,(%rax)
je     130a <main+0x1ca>
mov    -0x118(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    1247 <main+0x107>
mov    -0x118(%rbp),%rax
lea    0xe41(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1247 <main+0x107>
movl   $0x1,-0x124(%rbp)
jmp    12ee <main+0x1ae>
cmpl   $0x0,-0x124(%rbp)
je     12b6 <main+0x176>
mov    -0x118(%rbp),%rax
lea    0xe0f(%rip),%rdi
movsbl (%rax),%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
jne    12b1 <main+0x171>
movl   $0x0,-0x124(%rbp)
cmpq   $0x0,-0x118(%rbp)
je     12ac <main+0x16c>
mov    -0x118(%rbp),%rax
mov    (%rax),%cl
mov    -0x120(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x120(%rbp)
mov    %cl,(%rax)
jmp    12b1 <main+0x171>
jmp    12e9 <main+0x1a9>
cmpq   $0x0,-0x118(%rbp)
je     12e4 <main+0x1a4>
mov    -0x118(%rbp),%rax
mov    (%rax),%cl
mov    -0x120(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x120(%rbp)
mov    %cl,(%rax)
jmp    12e9 <main+0x1a9>
jmp    12ee <main+0x1ae>
jmp    12f3 <main+0x1b3>
mov    -0x118(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x118(%rbp)
jmp    11f4 <main+0xb4>
mov    -0x120(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x110(%rbp),%rdi
call   1050 <printf@plt>
jmp    1152 <main+0x12>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xff,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     1276 <main+0x136>
lea    0xeec(%rip),%rbx
lea    0xef0(%rip),%r13
jmp    11bc <main+0x7c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movb   $0x0,(%r12)
mov    %r14,%rdi
call   1050 <printf@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    $0xff,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     1276 <main+0x136>
mov    %r14,%rdi
lea    0xe3a(%rip),%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1276 <main+0x136>
mov    %r14,%rdi
lea    0xe29(%rip),%rsi
mov    $0x12,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     126a <main+0x12a>
xor    %ebp,%ebp
mov    %r14,%r15
mov    %r14,%r12
jmp    1210 <main+0xd0>
nopw   0x0(%rax,%rax,1)
mov    %al,(%r12)
add    $0x1,%r12
xor    %ecx,%ecx
add    $0x1,%r15
mov    %ecx,%ebp
movzbl (%r15),%eax
cmp    $0x5b,%al
je     1230 <main+0xf0>
test   %al,%al
jne    1247 <main+0x107>
jmp    1190 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%r15),%esi
mov    %rbx,%rdi
call   1040 <strchr@plt>
mov    $0x1,%ecx
test   %rax,%rax
jne    120a <main+0xca>
movzbl (%r15),%eax
test   %ebp,%ebp
je     1200 <main+0xc0>
movsbl %al,%esi
mov    %r13,%rdi
call   1040 <strchr@plt>
mov    $0x1,%ecx
test   %rax,%rax
jne    120a <main+0xca>
movzbl (%r15),%eax
jmp    1200 <main+0xc0>
lea    0xdad(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [11 x i8] c"References\00"
@.str.1 = [19 x i8] c"lynx: Can't access\00"
@.str.2 = [72 x i8] c"\C2\AE\C3\B0\C2\B6H\C2\B3\C3\B8\C2\BE\C3\89\C2\A4p\C2\A9j\C2\A5\C3\B0\C2\B0\C2\B2\C2\A4\C2\A4,\C2\BD\C3\90\C2\A8\C3\ACRecord\C2\AA\C2\A9\C3\82\C2\BD\C2\B9L\C2\A5h\C2\B8\C3\AA\C2\AE\C3\86.\00"
@.str.3 = [11 x i8] c"0123456789\00"
@.str.4 = [12 x i8] c"0123456789]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %73, %0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i64 @fgets(i8* %7, i32 255, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %77
11: ; preds = %6
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%13 = call i32 @strncmp(i8* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %11
br label %77
16: ; preds = %11
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
store i8* %17, i8** %3
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
store i8* %18, i8** %4
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%20 = call i32 @strncmp(i8* %19, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 18)
%21 = icmp ne i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %16
%23 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
br label %77
24: ; preds = %16
store i32 0, i32* %5
br label %25
25: ; preds = %70, %24
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = icmp ne i8 %27, 0
br i1 %28, label %29, label %73
29: ; preds = %25
%30 = load i8*, i8** %3
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 91
br i1 %33, label %34, label %41
34: ; preds = %29
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i64 1
%37 = load i8, i8* %36
%38 = call i64 @strchr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8 signext %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %34
store i32 1, i32* %5
br label %69
41: ; preds = %34, %29
%42 = load i32, i32* %5
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %59
44: ; preds = %41
%45 = load i8*, i8** %3
%46 = load i8, i8* %45
%47 = call i64 @strchr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8 signext %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %58, label %49
49: ; preds = %44
store i32 0, i32* %5
%50 = load i8*, i8** %3
%51 = icmp ne i8* %50, null
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = load i8*, i8** %3
%54 = load i8, i8* %53
%55 = load i8*, i8** %4
%56 = getelementptr inbounds i8, i8* %55, i32 1
store i8* %56, i8** %4
store i8 %54, i8* %55
br label %57
57: ; preds = %52, %49
br label %58
58: ; preds = %57, %44
br label %68
59: ; preds = %41
%60 = load i8*, i8** %3
%61 = icmp ne i8* %60, null
br i1 %61, label %62, label %67
62: ; preds = %59
%63 = load i8*, i8** %3
%64 = load i8, i8* %63
%65 = load i8*, i8** %4
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %4
store i8 %64, i8* %65
br label %67
67: ; preds = %62, %59
br label %68
68: ; preds = %67, %58
br label %69
69: ; preds = %68, %40
br label %70
70: ; preds = %69
%71 = load i8*, i8** %3
%72 = getelementptr inbounds i8, i8* %71, i32 1
store i8* %72, i8** %3
br label %25
73: ; preds = %25
%74 = load i8*, i8** %4
store i8 0, i8* %74
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%76 = call i32 @printf(i8* %75)
br label %6
77: ; preds = %22, %15, %6
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [11 x i8] c"References\00"
@.str.1 = [19 x i8] c"lynx: Can't access\00"
@.str.2 = [72 x i8] c"\C2\AE\C3\B0\C2\B6H\C2\B3\C3\B8\C2\BE\C3\89\C2\A4p\C2\A9j\C2\A5\C3\B0\C2\B0\C2\B2\C2\A4\C2\A4,\C2\BD\C3\90\C2\A8\C3\ACRecord\C2\AA\C2\A9\C3\82\C2\BD\C2\B9L\C2\A5h\C2\B8\C3\AA\C2\AE\C3\86.\00"
@.str.3 = [11 x i8] c"0123456789\00"
@.str.4 = [12 x i8] c"0123456789]\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fgets(i8* %2, i32 255, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %44, label %6
6: ; preds = %0, %39
%7 = call i32 @strncmp(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%8 = icmp eq i32 %7, 0
br i1 %8, label %44, label %9
9: ; preds = %6
%10 = call i32 @strncmp(i8* %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 18)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
br label %44
14: ; preds = %9, %35
%15 = phi i8* [ %38, %35 ], [ %2, %9 ]
%16 = phi i8* [ %36, %35 ], [ %2, %9 ]
%17 = phi i32 [ %37, %35 ], [ 0, %9 ]
%18 = load i8, i8* %15
switch i8 %18, label %24 [
i8 0, label %39
i8 91, label %19
]
19: ; preds = %14
%20 = getelementptr inbounds i8, i8* %15, i64 1
%21 = load i8, i8* %20
%22 = call i64 @strchr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8 signext %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %35
24: ; preds = %14, %19
%25 = icmp eq i32 %17, 0
%26 = load i8, i8* %15
br i1 %25, label %32, label %27
27: ; preds = %24
%28 = call i64 @strchr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8 signext %26)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %27
%31 = load i8, i8* %15
br label %32
32: ; preds = %24, %30
%33 = phi i8 [ %31, %30 ], [ %26, %24 ]
%34 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %33, i8* %16
br label %35
35: ; preds = %32, %19, %27
%36 = phi i8* [ %16, %27 ], [ %16, %19 ], [ %34, %32 ]
%37 = phi i32 [ 1, %27 ], [ 1, %19 ], [ 0, %32 ]
%38 = getelementptr inbounds i8, i8* %15, i64 1
br label %14
39: ; preds = %14
store i8 0, i8* %16
%40 = call i32 @printf(i8* %2)
%41 = load i32, i32* @stdin
%42 = call i64 @fgets(i8* %2, i32 255, i32 %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %6
44: ; preds = %39, %6, %0, %12
ret i32 0
}