#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 EOF;
int Getc();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ isupper(int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int tolower(int);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
int Get_Char() {
  int c;
  fflush(stdout);
  if ((c = Getc()) == EOF)
    return (EOF);
  c &= 0x7f;
  if (isupper(c))
    return (tolower(c));
  if (c == '\033')
    if ((c = Getc()) != '[') {
      ungetc(c, stdin);
      return ('\033');
    } else {
      c = Getc() | 0x80;
      if (c == 'H' + 0x80 || c == 'A' + 0x80 || c == 'V' + 0x80 ||
          c == 'D' + 0x80 || c == 'G' + 0x80 || c == 'C' + 0x80 ||
          c == 'Y' + 0x80 || c == 'B' + 0x80 || c == 'U' + 0x80 ||
          c == 'T' + 0x80 || c == 'S' + 0x80)
        return (c);
      else
        return ('\033');
    }
  return (c);
}


x86 assembly (clang, -O0):
<Get_Char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <Getc@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e69(%rip),%rcx
cmp    (%rcx),%eax
jne    1190 <Get_Char+0x40>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12b0 <Get_Char+0x160>
mov    -0x8(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1070 <isupper@plt>
cmp    $0x0,%rax
je     11bb <Get_Char+0x6b>
mov    -0x8(%rbp),%edi
call   1040 <tolower@plt>
mov    %eax,-0x4(%rbp)
jmp    12b0 <Get_Char+0x160>
cmpl   $0x1b,-0x8(%rbp)
jne    12aa <Get_Char+0x15a>
mov    $0x0,%al
call   1030 <Getc@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x5b,%eax
je     11f5 <Get_Char+0xa5>
mov    -0x8(%rbp),%edi
mov    0x2e06(%rip),%rax
mov    (%rax),%esi
call   1060 <ungetc@plt>
movl   $0x1b,-0x4(%rbp)
jmp    12b0 <Get_Char+0x160>
mov    $0x0,%al
call   1030 <Getc@plt>
or     $0x80,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
je     1293 <Get_Char+0x143>
cmpl   $0xc1,-0x8(%rbp)
je     1293 <Get_Char+0x143>
cmpl   $0xd6,-0x8(%rbp)
je     1293 <Get_Char+0x143>
cmpl   $0xc4,-0x8(%rbp)
je     1293 <Get_Char+0x143>
cmpl   $0xc7,-0x8(%rbp)
je     1293 <Get_Char+0x143>
cmpl   $0xc3,-0x8(%rbp)
je     1293 <Get_Char+0x143>
cmpl   $0xd9,-0x8(%rbp)
je     1293 <Get_Char+0x143>
cmpl   $0xc2,-0x8(%rbp)
je     1293 <Get_Char+0x143>
cmpl   $0xd5,-0x8(%rbp)
je     1293 <Get_Char+0x143>
cmpl   $0xd4,-0x8(%rbp)
je     1293 <Get_Char+0x143>
cmpl   $0xd3,-0x8(%rbp)
jne    129e <Get_Char+0x14e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    12b0 <Get_Char+0x160>
movl   $0x1b,-0x4(%rbp)
jmp    12b0 <Get_Char+0x160>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Char>:
push   %rbx
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <Getc@plt>
mov    %eax,%ebx
mov    0x2e71(%rip),%rax
cmp    (%rax),%ebx
jne    1177 <Get_Char+0x27>
mov    %ebx,%eax
pop    %rbx
ret
and    $0x7f,%ebx
mov    %ebx,%edi
call   1070 <isupper@plt>
test   %rax,%rax
je     118e <Get_Char+0x3e>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <tolower@plt>
cmp    $0x1b,%ebx
jne    1173 <Get_Char+0x23>
xor    %eax,%eax
call   1030 <Getc@plt>
cmp    $0x5b,%eax
jne    1226 <Get_Char+0xd6>
xor    %eax,%eax
call   1030 <Getc@plt>
movd   %eax,%xmm0
pshufd $0x50,%xmm0,%xmm1
mov    $0xffffff7b,%eax
movd   %eax,%xmm2
pand   %xmm0,%xmm2
por    0xe38(%rip),%xmm1
movdqa %xmm1,%xmm0
punpckldq %xmm2,%xmm0
pshufd $0xa9,%xmm0,%xmm0
pcmpeqd 0xe33(%rip),%xmm0
pshufd $0x55,%xmm1,%xmm1
movdqa 0xe36(%rip),%xmm2
pcmpeqd %xmm1,%xmm2
movd   %xmm1,%eax
pcmpeqd 0xe36(%rip),%xmm1
pshufd $0x50,%xmm1,%xmm1
movmskpd %xmm1,%ecx
test   $0x1,%cl
mov    $0x1b,%ebx
cmovne %eax,%ebx
packssdw %xmm2,%xmm0
test   $0x2,%cl
cmovne %eax,%ebx
pmovmskb %xmm0,%ecx
test   %ecx,%ecx
cmovne %eax,%ebx
jmp    1173 <Get_Char+0x23>
mov    0x2dbb(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1060 <ungetc@plt>
mov    $0x1b,%ebx
jmp    1173 <Get_Char+0x23>

LLVM IR (-O0):
@stdout = global i32 0
@EOF = global i32 0
@stdin = global i32 0
define i32 @Get_Char() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = call i32 (...) @Getc()
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i32, i32* @EOF
store i32 %9, i32* %1
br label %69
10: ; preds = %0
%11 = load i32, i32* %2
%12 = and i32 %11, 127
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = call i64 @isupper(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load i32, i32* %2
%18 = call i32 @tolower(i32 %17)
store i32 %18, i32* %1
br label %69
19: ; preds = %10
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 27
br i1 %21, label %22, label %67
22: ; preds = %19
%23 = call i32 (...) @Getc()
store i32 %23, i32* %2
%24 = icmp ne i32 %23, 91
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load i32, i32* %2
%27 = load i32, i32* @stdin
%28 = call i32 @ungetc(i32 %26, i32 %27)
store i32 27, i32* %1
br label %69
29: ; preds = %22
%30 = call i32 (...) @Getc()
%31 = or i32 %30, 128
store i32 %31, i32* %2
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 200
br i1 %33, label %64, label %34
34: ; preds = %29
%35 = load i32, i32* %2
%36 = icmp eq i32 %35, 193
br i1 %36, label %64, label %37
37: ; preds = %34
%38 = load i32, i32* %2
%39 = icmp eq i32 %38, 214
br i1 %39, label %64, label %40
40: ; preds = %37
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 196
br i1 %42, label %64, label %43
43: ; preds = %40
%44 = load i32, i32* %2
%45 = icmp eq i32 %44, 199
br i1 %45, label %64, label %46
46: ; preds = %43
%47 = load i32, i32* %2
%48 = icmp eq i32 %47, 195
br i1 %48, label %64, label %49
49: ; preds = %46
%50 = load i32, i32* %2
%51 = icmp eq i32 %50, 217
br i1 %51, label %64, label %52
52: ; preds = %49
%53 = load i32, i32* %2
%54 = icmp eq i32 %53, 194
br i1 %54, label %64, label %55
55: ; preds = %52
%56 = load i32, i32* %2
%57 = icmp eq i32 %56, 213
br i1 %57, label %64, label %58
58: ; preds = %55
%59 = load i32, i32* %2
%60 = icmp eq i32 %59, 212
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = load i32, i32* %2
%63 = icmp eq i32 %62, 211
br i1 %63, label %64, label %66
64: ; preds = %61, %58, %55, %52, %49, %46, %43, %40, %37, %34, %29
%65 = load i32, i32* %2
store i32 %65, i32* %1
br label %69
66: ; preds = %61
store i32 27, i32* %1
br label %69
67: ; preds = %19
%68 = load i32, i32* %2
store i32 %68, i32* %1
br label %69
69: ; preds = %67, %66, %64, %25, %16, %8
%70 = load i32, i32* %1
ret i32 %70
}

LLVM IR (-O2):
@stdout = global i32 0
@EOF = global i32 0
@stdin = global i32 0
define i32 @Get_Char() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = tail call i32 (...) @Getc()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %39, label %6
6: ; preds = %0
%7 = and i32 %3, 127
%8 = tail call i64 @isupper(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 @tolower(i32 %7)
br label %39
12: ; preds = %6
%13 = icmp eq i32 %7, 27
br i1 %13, label %14, label %39
14: ; preds = %12
%15 = tail call i32 (...) @Getc()
%16 = icmp eq i32 %15, 91
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* @stdin
%19 = tail call i32 @ungetc(i32 %15, i32 %18)
br label %39
20: ; preds = %14
%21 = tail call i32 (...) @Getc()
%22 = insertelement <2 x i32> poison, i32 %21, i64 0
%23 = shufflevector <2 x i32> %22, <2 x i32> poison, <2 x i32> zeroinitializer
%24 = and <2 x i32> %23, <i32 -133, i32 poison>
%25 = or <2 x i32> %23, <i32 poison, i32 128>
%26 = shufflevector <2 x i32> %24, <2 x i32> %25, <8 x i32> <i32 0, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%27 = freeze <8 x i32> %26
%28 = icmp eq <8 x i32> %27, <i32 67, i32 196, i32 214, i32 200, i32 193, i32 217, i32 194, i32 213>
%29 = bitcast <8 x i1> %28 to i8
%30 = icmp ne i8 %29, 0
%31 = extractelement <2 x i32> %25, i64 1
%32 = shufflevector <2 x i32> %25, <2 x i32> undef, <2 x i32> <i32 1, i32 1>
%33 = icmp eq <2 x i32> %32, <i32 211, i32 212>
%34 = extractelement <2 x i1> %33, i64 1
%35 = select i1 %30, i1 true, i1 %34
%36 = extractelement <2 x i1> %33, i64 0
%37 = select i1 %35, i1 true, i1 %36
%38 = select i1 %37, i32 %31, i32 27
br label %39
39: ; preds = %12, %20, %0, %17, %10
%40 = phi i32 [ %11, %10 ], [ 27, %17 ], [ %3, %0 ], [ %38, %20 ], [ %7, %12 ]
ret i32 %40
}