#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
scalar_t__ isdigit(char);
scalar_t__ isspace(char);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
char getNextBase(FILE **seqFile) {
  char c = -1;
  c = fgetc(*seqFile);
  for (;; c = fgetc(*seqFile)) {
    if (c == EOF) {
      break;
    } else if (isdigit(c) || isspace(c) || (c == '*')) {
      continue;
    } else if (c == '=') {
      fgetc(*seqFile);
      return c;
    } else if (c == '>') {
      ungetc(c, *seqFile);
      return c;
    } else {
      break;
    }
  }
  return (c);
}


x86 assembly (clang, -O0):
<getNextBase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movb   $0xff,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    0x2e7e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    117a <getNextBase+0x3a>
jmp    1219 <getNextBase+0xd9>
movsbl -0x11(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    11ad <getNextBase+0x6d>
movsbl -0x11(%rbp),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
jne    11ad <getNextBase+0x6d>
movsbl -0x11(%rbp),%eax
cmp    $0x2a,%eax
jne    11b2 <getNextBase+0x72>
jmp    1205 <getNextBase+0xc5>
movsbl -0x11(%rbp),%eax
cmp    $0x3d,%eax
jne    11d6 <getNextBase+0x96>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <fgetc@plt>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    121f <getNextBase+0xdf>
movsbl -0x11(%rbp),%eax
cmp    $0x3e,%eax
jne    1200 <getNextBase+0xc0>
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rsi
movsbl %al,%edi
call   1060 <ungetc@plt>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    121f <getNextBase+0xdf>
jmp    1219 <getNextBase+0xd9>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x11(%rbp)
jmp    115f <getNextBase+0x1f>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextBase>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1040 <fgetc@plt>
mov    %eax,%ebx
mov    0x2e8d(%rip),%r15
jmp    116a <getNextBase+0x2a>
nopl   (%rax)
mov    (%r14),%rdi
call   1040 <fgetc@plt>
mov    %eax,%ebx
cmp    (%r15),%al
je     11b5 <getNextBase+0x75>
movsbl %bl,%ebp
mov    %ebp,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1160 <getNextBase+0x20>
mov    %ebp,%edi
call   1050 <isspace@plt>
cmp    $0x2a,%bpl
je     1160 <getNextBase+0x20>
test   %rax,%rax
jne    1160 <getNextBase+0x20>
cmp    $0x3e,%bl
je     11a6 <getNextBase+0x66>
cmp    $0x3d,%bl
jne    11b5 <getNextBase+0x75>
mov    (%r14),%rdi
call   1040 <fgetc@plt>
mov    $0x3d,%bl
jmp    11b5 <getNextBase+0x75>
mov    (%r14),%rsi
mov    $0x3e,%edi
call   1060 <ungetc@plt>
mov    $0x3e,%bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i8 0
define signext i8 @getNextBase(i32** %0) {
%2 = alloca i8
%3 = alloca i32**
%4 = alloca i8
store i32** %0, i32*** %3
store i8 -1, i8* %4
%5 = load i32**, i32*** %3
%6 = load i32*, i32** %5
%7 = call signext i8 @fgetc(i32* %6)
store i8 %7, i8* %4
br label %8
8: ; preds = %48, %1
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = load i8, i8* @EOF
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %10, %12
br i1 %13, label %14, label %15
14: ; preds = %8
br label %52
15: ; preds = %8
%16 = load i8, i8* %4
%17 = call i64 @isdigit(i8 signext %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %27, label %19
19: ; preds = %15
%20 = load i8, i8* %4
%21 = call i64 @isspace(i8 signext %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i8, i8* %4
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 42
br i1 %26, label %27, label %28
27: ; preds = %23, %19, %15
br label %48
28: ; preds = %23
%29 = load i8, i8* %4
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 61
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = load i32**, i32*** %3
%34 = load i32*, i32** %33
%35 = call signext i8 @fgetc(i32* %34)
%36 = load i8, i8* %4
store i8 %36, i8* %2
br label %54
37: ; preds = %28
%38 = load i8, i8* %4
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 62
br i1 %40, label %41, label %47
41: ; preds = %37
%42 = load i8, i8* %4
%43 = load i32**, i32*** %3
%44 = load i32*, i32** %43
%45 = call i32 @ungetc(i8 signext %42, i32* %44)
%46 = load i8, i8* %4
store i8 %46, i8* %2
br label %54
47: ; preds = %37
br label %52
48: ; preds = %27
%49 = load i32**, i32*** %3
%50 = load i32*, i32** %49
%51 = call signext i8 @fgetc(i32* %50)
store i8 %51, i8* %4
br label %8
52: ; preds = %47, %14
%53 = load i8, i8* %4
store i8 %53, i8* %2
br label %54
54: ; preds = %52, %41, %32
%55 = load i8, i8* %2
ret i8 %55
}

LLVM IR (-O2):
@EOF = global i8 0
define signext i8 @getNextBase(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call signext i8 @fgetc(i32* %2)
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %27, label %6
6: ; preds = %1, %22
%7 = phi i8 [ %24, %22 ], [ %3, %1 ]
%8 = tail call i64 @isdigit(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = tail call i64 @isspace(i8 signext %7)
%12 = icmp ne i64 %11, 0
%13 = icmp eq i8 %7, 42
%14 = or i1 %13, %12
br i1 %14, label %22, label %15
15: ; preds = %10
switch i8 %7, label %27 [
i8 61, label %16
i8 62, label %19
]
16: ; preds = %15
%17 = load i32*, i32** %0
%18 = tail call signext i8 @fgetc(i32* %17)
br label %27
19: ; preds = %15
%20 = load i32*, i32** %0
%21 = tail call i32 @ungetc(i8 signext 62, i32* %20)
br label %27
22: ; preds = %6, %10
%23 = load i32*, i32** %0
%24 = tail call signext i8 @fgetc(i32* %23)
%25 = load i8, i8* @EOF
%26 = icmp eq i8 %24, %25
br i1 %26, label %27, label %6
27: ; preds = %22, %1, %15, %19, %16
%28 = phi i8 [ %7, %15 ], [ 62, %19 ], [ 61, %16 ], [ %3, %1 ], [ %24, %22 ]
ret i8 %28
}