#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 fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strchr(char *, int /*<<< orphan*/);
int /*<<< orphan*/ toupper(int);
int GetBase(void) {
  int base;
  char *alphabet = "ACGT";
  while ((base = fgetc(stdin)) != EOF) {
    if (base == '>') {
      while ((base = fgetc(stdin)) != EOF && base != '\n')
        ;
      continue;
    }
    if (base == '\n')
      continue;
    if (!(strchr(alphabet, toupper(base))))
      return 1;
    else
      return !1;
  }
  return EOF;
}


x86 assembly (clang, -O0):
<GetBase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1050 <fgetc@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%eax
je     1208 <GetBase+0xd8>
cmpl   $0x3e,-0x8(%rbp)
jne    11bd <GetBase+0x8d>
jmp    1172 <GetBase+0x42>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
mov    0x2e52(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x11(%rbp)
je     11a3 <GetBase+0x73>
cmpl   $0xa,-0x8(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    11b3 <GetBase+0x83>
jmp    11b8 <GetBase+0x88>
jmp    1172 <GetBase+0x42>
jmp    1143 <GetBase+0x13>
cmpl   $0xa,-0x8(%rbp)
jne    11cc <GetBase+0x9c>
jmp    1143 <GetBase+0x13>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <toupper@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <strchr@plt>
cmp    $0x0,%eax
jne    11fc <GetBase+0xcc>
movl   $0x1,-0x4(%rbp)
jmp    1214 <GetBase+0xe4>
movl   $0x0,-0x4(%rbp)
jmp    1214 <GetBase+0xe4>
mov    0x2dd1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBase>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%r14
mov    (%r14),%edi
call   1050 <fgetc@plt>
mov    0x2e96(%rip),%rbx
jmp    1158 <GetBase+0x28>
nopl   0x0(%rax)
mov    (%r14),%edi
call   1050 <fgetc@plt>
cmp    (%rbx),%eax
je     11a1 <GetBase+0x71>
cmp    $0xa,%eax
je     1150 <GetBase+0x20>
cmp    $0x3e,%eax
jne    1183 <GetBase+0x53>
cs nopw 0x0(%rax,%rax,1)
mov    (%r14),%edi
call   1050 <fgetc@plt>
cmp    $0xa,%eax
je     1150 <GetBase+0x20>
cmp    (%rbx),%eax
jne    1170 <GetBase+0x40>
jmp    1150 <GetBase+0x20>
mov    %eax,%edi
call   1030 <toupper@plt>
lea    0xe6f(%rip),%rdi
mov    %eax,%esi
call   1040 <strchr@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ACGT\00"
@stdin = global i32 0
@EOF = global i32 0
define i32 @GetBase() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
br label %4
4: ; preds = %28, %24, %0
%5 = load i32, i32* @stdin
%6 = call i32 @fgetc(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %37
9: ; preds = %4
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 62
br i1 %11, label %12, label %25
12: ; preds = %9
br label %13
13: ; preds = %23, %12
%14 = load i32, i32* @stdin
%15 = call i32 @fgetc(i32 %14)
store i32 %15, i32* %2
%16 = load i32, i32* @EOF
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32, i32* %2
%20 = icmp ne i32 %19, 10
br label %21
21: ; preds = %18, %13
%22 = phi i1 [ false, %13 ], [ %20, %18 ]
br i1 %22, label %23, label %24
23: ; preds = %21
br label %13
24: ; preds = %21
br label %4
25: ; preds = %9
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 10
br i1 %27, label %28, label %29
28: ; preds = %25
br label %4
29: ; preds = %25
%30 = load i8*, i8** %3
%31 = load i32, i32* %2
%32 = call i32 @toupper(i32 %31)
%33 = call i32 @strchr(i8* %30, i32 %32)
%34 = icmp ne i32 %33, 0
br i1 %34, label %36, label %35
35: ; preds = %29
store i32 1, i32* %1
br label %39
36: ; preds = %29
store i32 0, i32* %1
br label %39
37: ; preds = %4
%38 = load i32, i32* @EOF
store i32 %38, i32* %1
br label %39
39: ; preds = %37, %36, %35
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
@.str = [5 x i8] c"ACGT\00"
@stdin = global i32 0
@EOF = global i32 0
define i32 @GetBase() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fgetc(i32 %1)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %24, label %5
5: ; preds = %0, %7
%6 = phi i32 [ %9, %7 ], [ %2, %0 ]
switch i32 %6, label %19 [
i32 62, label %12
i32 10, label %7
]
7: ; preds = %12, %5
%8 = load i32, i32* @stdin
%9 = tail call i32 @fgetc(i32 %8)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %24, label %5
12: ; preds = %5, %12
%13 = load i32, i32* @stdin
%14 = tail call i32 @fgetc(i32 %13)
%15 = load i32, i32* @EOF
%16 = icmp ne i32 %14, %15
%17 = icmp ne i32 %14, 10
%18 = and i1 %17, %16
br i1 %18, label %12, label %7
19: ; preds = %5
%20 = tail call i32 @toupper(i32 %6)
%21 = tail call i32 @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %7, %0, %19
%25 = phi i32 [ %23, %19 ], [ %2, %0 ], [ %9, %7 ]
ret i32 %25
}