#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 */
int EOF;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int getc(int /*<<< orphan*/ *);
scalar_t__ isdigit(int);
int /*<<< orphan*/ isspace(int);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int flu_var_count(FILE *fp, const char *add) {
  int num = 0;
  int flg = 0;
  int ch;
  while ((ch = getc(fp)) != EOF) {
    if (ch == 45 || ch == 46 || ch == 69 || ch == 101 || isdigit(ch))
      flg = 1;
    else if (!isspace(ch)) {
      fprintf(stderr,
              "Input contains illegal character(ASCII=%d) in the file '%s'!\n",
              ch, add);
      return 0;
    } else if (flg) {
      num++;
      flg = 0;
    }
  }
  rewind(fp);
  return num;
}


x86 assembly (clang, -O0):
<flu_var_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <getc@plt>
mov    %eax,-0x24(%rbp)
mov    0x2e67(%rip),%rcx
cmp    (%rcx),%eax
je     1231 <flu_var_count+0xe1>
cmpl   $0x2d,-0x24(%rbp)
je     11c3 <flu_var_count+0x73>
cmpl   $0x2e,-0x24(%rbp)
je     11c3 <flu_var_count+0x73>
cmpl   $0x45,-0x24(%rbp)
je     11c3 <flu_var_count+0x73>
cmpl   $0x65,-0x24(%rbp)
je     11c3 <flu_var_count+0x73>
mov    -0x24(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11cf <flu_var_count+0x7f>
movl   $0x1,-0x20(%rbp)
jmp    122c <flu_var_count+0xdc>
mov    -0x24(%rbp),%edi
call   1050 <isspace@plt>
cmp    $0x0,%eax
jne    1208 <flu_var_count+0xb8>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe09(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1240 <flu_var_count+0xf0>
cmpl   $0x0,-0x20(%rbp)
je     1222 <flu_var_count+0xd2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
jmp    1227 <flu_var_count+0xd7>
jmp    122c <flu_var_count+0xdc>
jmp    116e <flu_var_count+0x1e>
mov    -0x10(%rbp),%rdi
call   1040 <rewind@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu_var_count>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
mov    %rdi,%rbx
call   1070 <getc@plt>
mov    0x2e76(%rip),%r12
movl   $0x0,0xc(%rsp)
cmp    (%r12),%eax
jne    119b <flu_var_count+0x4b>
mov    %rbx,%rdi
call   1040 <rewind@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
xor    %r14d,%r14d
movabs $0x100000001000003,%r13
movl   $0x0,0xc(%rsp)
jmp    11e3 <flu_var_count+0x93>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     11f9 <flu_var_count+0xa9>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1070 <getc@plt>
mov    %eax,%ebp
mov    %r15d,%r14d
cmp    (%r12),%eax
je     1180 <flu_var_count+0x30>
mov    $0x1,%r15d
lea    -0x2d(%rbp),%eax
cmp    $0x38,%eax
ja     11c0 <flu_var_count+0x70>
bt     %rax,%r13
jb     11d0 <flu_var_count+0x80>
jmp    11c0 <flu_var_count+0x70>
mov    %ebp,%edi
call   1050 <isspace@plt>
test   %eax,%eax
je     1212 <flu_var_count+0xc2>
cmp    $0x1,%r14d
sbbl   $0xffffffff,0xc(%rsp)
xor    %r15d,%r15d
jmp    11d0 <flu_var_count+0x80>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
lea    0xdde(%rip),%rsi
mov    %ebp,%edx
mov    0x10(%rsp),%rcx
call   1060 <fprintf@plt>
xor    %eax,%eax
jmp    118c <flu_var_count+0x3c>

LLVM IR (-O0):
@EOF = global i32 0
@stderr = global i32 0
@.str = [62 x i8] c"Input contains illegal character(ASCII=%d) in the file '%s'!\0A\00"
define i32 @flu_var_count(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %9
9: ; preds = %48, %2
%10 = load i32*, i32** %4
%11 = call i32 @getc(i32* %10)
store i32 %11, i32* %8
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %49
14: ; preds = %9
%15 = load i32, i32* %8
%16 = icmp eq i32 %15, 45
br i1 %16, label %30, label %17
17: ; preds = %14
%18 = load i32, i32* %8
%19 = icmp eq i32 %18, 46
br i1 %19, label %30, label %20
20: ; preds = %17
%21 = load i32, i32* %8
%22 = icmp eq i32 %21, 69
br i1 %22, label %30, label %23
23: ; preds = %20
%24 = load i32, i32* %8
%25 = icmp eq i32 %24, 101
br i1 %25, label %30, label %26
26: ; preds = %23
%27 = load i32, i32* %8
%28 = call i64 @isdigit(i32 %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %26, %23, %20, %17, %14
store i32 1, i32* %7
br label %48
31: ; preds = %26
%32 = load i32, i32* %8
%33 = call i32 @isspace(i32 %32)
%34 = icmp ne i32 %33, 0
br i1 %34, label %40, label %35
35: ; preds = %31
%36 = load i32, i32* @stderr
%37 = load i32, i32* %8
%38 = load i8*, i8** %5
%39 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %37, i8* %38)
store i32 0, i32* %3
br label %53
40: ; preds = %31
%41 = load i32, i32* %7
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
store i32 0, i32* %7
br label %46
46: ; preds = %43, %40
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47, %30
br label %9
49: ; preds = %9
%50 = load i32*, i32** %4
%51 = call i32 @rewind(i32* %50)
%52 = load i32, i32* %6
store i32 %52, i32* %3
br label %53
53: ; preds = %49, %35
%54 = load i32, i32* %3
ret i32 %54
}

LLVM IR (-O2):
@EOF = global i32 0
@stderr = global i32 0
@.str = [62 x i8] c"Input contains illegal character(ASCII=%d) in the file '%s'!\0A\00"
define i32 @flu_var_count(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %29, label %6
6: ; preds = %2, %23
%7 = phi i32 [ %26, %23 ], [ %3, %2 ]
%8 = phi i32 [ %25, %23 ], [ 0, %2 ]
%9 = phi i32 [ %24, %23 ], [ 0, %2 ]
switch i32 %7, label %10 [
i32 101, label %23
i32 69, label %23
i32 46, label %23
i32 45, label %23
]
10: ; preds = %6
%11 = tail call i64 @isdigit(i32 %7)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = tail call i32 @isspace(i32 %7)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %1)
br label %32
19: ; preds = %13
%20 = icmp ne i32 %8, 0
%21 = zext i1 %20 to i32
%22 = add nsw i32 %9, %21
br label %23
23: ; preds = %19, %10, %6, %6, %6, %6
%24 = phi i32 [ %9, %6 ], [ %9, %6 ], [ %9, %6 ], [ %9, %6 ], [ %9, %10 ], [ %22, %19 ]
%25 = phi i32 [ 1, %6 ], [ 1, %6 ], [ 1, %6 ], [ 1, %6 ], [ 1, %10 ], [ 0, %19 ]
%26 = tail call i32 @getc(i32* %0)
%27 = load i32, i32* @EOF
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %6
29: ; preds = %23, %2
%30 = phi i32 [ 0, %2 ], [ %24, %23 ]
%31 = tail call i32 @rewind(i32* %0)
br label %32
32: ; preds = %29, %16
%33 = phi i32 [ 0, %16 ], [ %30, %29 ]
ret i32 %33
}