#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 /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ processString(char *, char const **);
char *strtok(char *, char *);
int main(int argc, char *argv[]) {
  FILE *fp = NULL;
  char line[100], *token = NULL;
  int n = 0;
  const char *keywords[] = {
      "auto",     "break",   "case",    "char",   "continue", "do",
      "default",  "const",   "double",  "else",   "enum",     "extern",
      "for",      "if",      "goto",    "float",  "int",      "long",
      "register", "return",  "signed",  "static", "sizeof",   "short",
      "struct",   "switch",  "typedef", "union",  "void",     "while",
      "volatile", "unsigned"};
  if (argc != 2) {
    printf("\nProvide the c source file\n");
    return -1;
  }
  fp = fopen(argv[1], "r");
  if (NULL == fp) {
    return -1;
  }
  while (NULL != fgets(line, 100, fp)) {
    token = strtok(line, " ,;()[]{}#<>	");
    while (NULL != token) {
      n += processString(token, keywords);
      token = strtok(NULL, " ,;()[]{}#<>	");
    }
  }
  printf("\n %d keywords\n", n);
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x88(%rbp)
movl   $0x0,-0x8c(%rbp)
lea    -0x190(%rbp),%rdi
lea    0x2b6c(%rip),%rsi
mov    $0x100,%edx
call   1060 <memcpy@plt>
cmpl   $0x2,-0x8(%rbp)
je     11e2 <main+0x72>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12c8 <main+0x158>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe22(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1212 <main+0xa2>
movl   $0xffffffff,-0x4(%rbp)
jmp    12c8 <main+0x158>
jmp    1217 <main+0xa7>
lea    -0x80(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x64,%esi
call   1050 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     12a4 <main+0x134>
lea    -0x80(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1090 <strtok@plt>
mov    %rax,-0x88(%rbp)
xor    %eax,%eax
cmp    -0x88(%rbp),%rax
je     129f <main+0x12f>
mov    -0x88(%rbp),%rdi
lea    -0x190(%rbp),%rsi
call   1070 <processString@plt>
mov    %rax,%rcx
movslq -0x8c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe4d(%rip),%rsi
call   1090 <strtok@plt>
mov    %rax,-0x88(%rbp)
jmp    124e <main+0xde>
jmp    1217 <main+0xa7>
mov    -0x8c(%rbp),%esi
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x178,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x2b83(%rip),%rsi
lea    0x70(%rsp),%rdi
mov    $0x100,%edx
call   1070 <memcpy@plt>
cmp    $0x2,%ebp
jne    124e <main+0xce>
mov    0x8(%rbx),%rdi
lea    0xe53(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     125a <main+0xda>
mov    %rax,%r15
mov    %rsp,%rdi
mov    $0x64,%esi
mov    %rax,%rdx
call   1060 <fgets@plt>
xor    %r14d,%r14d
mov    $0x0,%ebp
test   %rax,%rax
je     1262 <main+0xe2>
xor    %ebp,%ebp
lea    0xec8(%rip),%rbx
mov    %rsp,%r12
lea    0x70(%rsp),%r13
jmp    1225 <main+0xa5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1262 <main+0xe2>
mov    %r12,%rdi
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rsi
call   10a0 <strtok@plt>
test   %rax,%rax
je     1210 <main+0x90>
mov    %rax,%rdi
mov    %r13,%rsi
call   1080 <processString@plt>
add    %eax,%ebp
xor    %edi,%edi
jmp    1230 <main+0xb0>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%r14d
jmp    127a <main+0xfa>
lea    0xe64(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %r14d,%eax
add    $0x178,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"auto\00"
@.str.1 = [6 x i8] c"break\00"
@.str.2 = [5 x i8] c"case\00"
@.str.3 = [5 x i8] c"char\00"
@.str.4 = [9 x i8] c"continue\00"
@.str.5 = [3 x i8] c"do\00"
@.str.6 = [8 x i8] c"default\00"
@.str.7 = [6 x i8] c"const\00"
@.str.8 = [7 x i8] c"double\00"
@.str.9 = [5 x i8] c"else\00"
@.str.10 = [5 x i8] c"enum\00"
@.str.11 = [7 x i8] c"extern\00"
@.str.12 = [4 x i8] c"for\00"
@.str.13 = [3 x i8] c"if\00"
@.str.14 = [5 x i8] c"goto\00"
@.str.15 = [6 x i8] c"float\00"
@.str.16 = [4 x i8] c"int\00"
@.str.17 = [5 x i8] c"long\00"
@.str.18 = [9 x i8] c"register\00"
@.str.19 = [7 x i8] c"return\00"
@.str.20 = [7 x i8] c"signed\00"
@.str.21 = [7 x i8] c"static\00"
@.str.22 = [7 x i8] c"sizeof\00"
@.str.23 = [6 x i8] c"short\00"
@.str.24 = [7 x i8] c"struct\00"
@.str.25 = [7 x i8] c"switch\00"
@.str.26 = [8 x i8] c"typedef\00"
@.str.27 = [6 x i8] c"union\00"
@.str.28 = [5 x i8] c"void\00"
@.str.29 = [6 x i8] c"while\00"
@.str.30 = [9 x i8] c"volatile\00"
@.str.31 = [9 x i8] c"unsigned\00"
@__const.main.keywords = [32 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.31, i32 0, i32 0)]
@.str.32 = [28 x i8] c"\0AProvide the c source file\0A\00"
@.str.33 = [2 x i8] c"r\00"
@.str.34 = [14 x i8] c" ,;()[]{}#<>\09\00"
@.str.35 = [15 x i8] c"\0A %d keywords\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [100 x i8]
%8 = alloca i8*
%9 = alloca i32
%10 = alloca [32 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i8* null, i8** %8
store i32 0, i32* %9
%11 = bitcast [32 x i8*]* %10 to i8*
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.32, i64 0, i64 0))
store i32 -1, i32* %3
br label %51
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.33, i64 0, i64 0))
store i32* %20, i32** %6
%21 = load i32*, i32** %6
%22 = icmp eq i32* null, %21
br i1 %22, label %23, label %24
23: ; preds = %16
store i32 -1, i32* %3
br label %51
24: ; preds = %16
br label %25
25: ; preds = %45, %24
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%27 = load i32*, i32** %6
%28 = call i32* @fgets(i8* %26, i32 100, i32* %27)
%29 = icmp ne i32* null, %28
br i1 %29, label %30, label %46
30: ; preds = %25
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%32 = call i8* @strtok(i8* %31, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.34, i64 0, i64 0))
store i8* %32, i8** %8
br label %33
33: ; preds = %36, %30
%34 = load i8*, i8** %8
%35 = icmp ne i8* null, %34
br i1 %35, label %36, label %45
36: ; preds = %33
%37 = load i8*, i8** %8
%38 = getelementptr inbounds [32 x i8*], [32 x i8*]* %10, i64 0, i64 0
%39 = call i64 @processString(i8* %37, i8** %38)
%40 = load i32, i32* %9
%41 = sext i32 %40 to i64
%42 = add nsw i64 %41, %39
%43 = trunc i64 %42 to i32
store i32 %43, i32* %9
%44 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.34, i64 0, i64 0))
store i8* %44, i8** %8
br label %33
45: ; preds = %33
br label %25
46: ; preds = %25
%47 = load i32, i32* %9
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.35, i64 0, i64 0), i32 %47)
%49 = load i32*, i32** %6
%50 = call i32 @fclose(i32* %49)
store i32 0, i32* %3
br label %51
51: ; preds = %46, %23, %14
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
@.str = [5 x i8] c"auto\00"
@.str.1 = [6 x i8] c"break\00"
@.str.2 = [5 x i8] c"case\00"
@.str.3 = [5 x i8] c"char\00"
@.str.4 = [9 x i8] c"continue\00"
@.str.5 = [3 x i8] c"do\00"
@.str.6 = [8 x i8] c"default\00"
@.str.7 = [6 x i8] c"const\00"
@.str.8 = [7 x i8] c"double\00"
@.str.9 = [5 x i8] c"else\00"
@.str.10 = [5 x i8] c"enum\00"
@.str.11 = [7 x i8] c"extern\00"
@.str.12 = [4 x i8] c"for\00"
@.str.13 = [3 x i8] c"if\00"
@.str.14 = [5 x i8] c"goto\00"
@.str.15 = [6 x i8] c"float\00"
@.str.16 = [4 x i8] c"int\00"
@.str.17 = [5 x i8] c"long\00"
@.str.18 = [9 x i8] c"register\00"
@.str.19 = [7 x i8] c"return\00"
@.str.20 = [7 x i8] c"signed\00"
@.str.21 = [7 x i8] c"static\00"
@.str.22 = [7 x i8] c"sizeof\00"
@.str.23 = [6 x i8] c"short\00"
@.str.24 = [7 x i8] c"struct\00"
@.str.25 = [7 x i8] c"switch\00"
@.str.26 = [8 x i8] c"typedef\00"
@.str.27 = [6 x i8] c"union\00"
@.str.28 = [5 x i8] c"void\00"
@.str.29 = [6 x i8] c"while\00"
@.str.30 = [9 x i8] c"volatile\00"
@.str.31 = [9 x i8] c"unsigned\00"
@__const.main.keywords = [32 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.31, i32 0, i32 0)]
@.str.33 = [2 x i8] c"r\00"
@.str.34 = [14 x i8] c" ,;()[]{}#<>\09\00"
@.str.35 = [15 x i8] c"\0A %d keywords\0A\00"
@str = [27 x i8] c"\0AProvide the c source file\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca [32 x i8*]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = bitcast [32 x i8*]* %4 to i8*
%7 = icmp eq i32 %0, 2
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %40
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.33, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %40, label %15
15: ; preds = %10
%16 = call i32* @fgets(i8* %5, i32 100, i32* %13)
%17 = icmp eq i32* %16, null
br i1 %17, label %36, label %18
18: ; preds = %15
%19 = getelementptr inbounds [32 x i8*], [32 x i8*]* %4, i64 0, i64 0
br label %24
20: ; preds = %28, %24
%21 = phi i32 [ %25, %24 ], [ %33, %28 ]
%22 = call i32* @fgets(i8* %5, i32 100, i32* %13)
%23 = icmp eq i32* %22, null
br i1 %23, label %36, label %24
24: ; preds = %18, %20
%25 = phi i32 [ 0, %18 ], [ %21, %20 ]
%26 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.34, i64 0, i64 0))
%27 = icmp eq i8* %26, null
br i1 %27, label %20, label %28
28: ; preds = %24, %28
%29 = phi i32 [ %33, %28 ], [ %25, %24 ]
%30 = phi i8* [ %34, %28 ], [ %26, %24 ]
%31 = call i64 @processString(i8* %30, i8** %19)
%32 = trunc i64 %31 to i32
%33 = add i32 %29, %32
%34 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.34, i64 0, i64 0))
%35 = icmp eq i8* %34, null
br i1 %35, label %20, label %28
36: ; preds = %20, %15
%37 = phi i32 [ 0, %15 ], [ %21, %20 ]
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.35, i64 0, i64 0), i32 %37)
%39 = call i32 @fclose(i32* %13)
br label %40
40: ; preds = %10, %36, %8
%41 = phi i32 [ -1, %8 ], [ 0, %36 ], [ -1, %10 ]
ret i32 %41
}