#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;
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
char getchar();
scalar_t__ isalnum(char);
scalar_t__ isalpha(char);
scalar_t__ isblank(char);
int /*<<< orphan*/ iscntrl(char);
scalar_t__ isdigit(char);
scalar_t__ isgraph(int);
scalar_t__ islower(char);
int /*<<< orphan*/ ispunct(int);
scalar_t__ isupper(char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
char tolower(char);
char toupper(char);
int main() {
  int i = 0;
  int lim = 20;
  char str1[] = "ch34o...";
  char str2[lim], c;
  printf("Please input a string(<=20):");
  for (i = 0; i < lim - 1 && (c = getchar()) != '\n' && c != EOF; ++i)
    str2[i] = c;
  while (isalnum(str2[i]))
    i++;
  printf("The first %d characters are alphanumeric.\n", i);
  i = 0;
  while (isalpha(str2[i]))
    i++;
  printf("The first %d characters are alpha.\n", i);
  i = 0;
  while (isblank(str2[i]))
    i++;
  printf("Last blank is %d.\n", i);
  i = 0;
  while (!iscntrl(str2[i])) {
    putchar(str2[i]);
    i++;
  }
  putchar('\n');
  i = 0;
  while (str2[i]) {
    c = str2[i];
    if (isupper(c)) {
      c = tolower(c);
    } else if (islower(c)) {
      c = toupper(c);
    }
    putchar(c);
    i++;
  }
  putchar('\n');
  char str3[] = "1776ad";
  int year;
  if (isdigit(str3[0])) {
    year = atoi(str3);
    printf("The year that followed %d was %d.\n", year, year + 1);
  }
  FILE *pFile;
  int ch;
  pFile = fopen("myfile.txt", "r");
  if (pFile) {
    do {
      ch = fgetc(pFile);
      if (isgraph(ch) && !ispunct(ch))
        putchar(ch);
    } while (ch != EOF);
    fclose(pFile);
  } else {
    printf("read file failed\n");
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movabs $0x2e2e2e6f34336863,%rax
2e 2e 2e
mov    %rax,-0x18(%rbp)
movb   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x51(%rbp)
jge    12d1 <main+0xb1>
mov    $0x0,%al
call   10e0 <getchar@plt>
mov    %al,-0x29(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x51(%rbp)
je     12d1 <main+0xb1>
movsbl -0x29(%rbp),%eax
mov    0x2d22(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x51(%rbp)
mov    -0x51(%rbp),%al
test   $0x1,%al
jne    12e1 <main+0xc1>
jmp    12fd <main+0xdd>
mov    -0x50(%rbp),%rax
mov    -0x29(%rbp),%dl
movslq -0x8(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    128a <main+0x6a>
jmp    1302 <main+0xe2>
mov    -0x50(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   10a0 <isalnum@plt>
cmp    $0x0,%rax
je     132b <main+0x10b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1302 <main+0xe2>
mov    -0x8(%rbp),%esi
lea    0xcf1(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1100 <isalpha@plt>
cmp    $0x0,%rax
je     136c <main+0x14c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1343 <main+0x123>
mov    -0x8(%rbp),%esi
lea    0xcdb(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   10b0 <isblank@plt>
cmp    $0x0,%rax
je     13ad <main+0x18d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1384 <main+0x164>
mov    -0x8(%rbp),%esi
lea    0xcbe(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1070 <iscntrl@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13eb <main+0x1cb>
jmp    140a <main+0x1ea>
mov    -0x50(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13c5 <main+0x1a5>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     149a <main+0x27a>
mov    -0x50(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x29(%rbp)
movsbl -0x29(%rbp),%edi
call   1110 <isupper@plt>
cmp    $0x0,%rax
je     145f <main+0x23f>
movsbl -0x29(%rbp),%edi
call   10f0 <tolower@plt>
mov    %al,-0x29(%rbp)
jmp    1483 <main+0x263>
movsbl -0x29(%rbp),%edi
call   1050 <islower@plt>
cmp    $0x0,%rax
je     147e <main+0x25e>
movsbl -0x29(%rbp),%edi
call   1060 <toupper@plt>
mov    %al,-0x29(%rbp)
jmp    1483 <main+0x263>
movsbl -0x29(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    141b <main+0x1fb>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xbde(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xbd8(%rip),%ax
mov    %ax,-0x2c(%rbp)
mov    0xbd0(%rip),%al
mov    %al,-0x2a(%rbp)
movsbl -0x30(%rbp),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     14f7 <main+0x2d7>
lea    -0x30(%rbp),%rdi
call   1130 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
mov    -0x34(%rbp),%edx
add    $0x1,%edx
lea    0xb9f(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    0xbb4(%rip),%rdi
lea    0xbb8(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1580 <main+0x360>
jmp    151e <main+0x2fe>
mov    -0x40(%rbp),%rdi
call   10c0 <fgetc@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%edi
call   1140 <isgraph@plt>
cmp    $0x0,%rax
je     1558 <main+0x338>
mov    -0x44(%rbp),%edi
call   10d0 <ispunct@plt>
cmp    $0x0,%eax
jne    1558 <main+0x338>
mov    -0x44(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    155d <main+0x33d>
mov    -0x44(%rbp),%eax
mov    0x2a81(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    151e <main+0x2fe>
mov    -0x40(%rbp),%rdi
call   1080 <fclose@plt>
jmp    158e <main+0x36e>
lea    0xb38(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xdbf(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x2d99(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10f0 <getchar@plt>
cmp    $0xa,%al
je     1282 <main+0x52>
cmp    (%r14),%al
je     1282 <main+0x52>
mov    %al,(%rsp,%rbp,1)
add    $0x1,%rbp
cmp    $0x13,%rbp
jne    1260 <main+0x30>
mov    $0x13,%ebp
lea    -0x1(%rbp),%ebx
add    %rsp,%rbp
nopl   0x0(%rax,%rax,1)
movsbl 0x0(%rbp),%edi
call   10b0 <isalnum@plt>
add    $0x1,%ebx
add    $0x1,%rbp
test   %rax,%rax
jne    1290 <main+0x60>
lea    0xd71(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    $0xffffffff,%ebx
mov    %rsp,%rbp
nopl   (%rax)
movsbl 0x0(%rbp),%edi
call   1110 <isalpha@plt>
add    $0x1,%ebx
add    $0x1,%rbp
test   %rax,%rax
jne    12c0 <main+0x90>
lea    0xd6c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    $0xffffffff,%ebx
mov    %rsp,%rbp
nopl   (%rax)
movsbl 0x0(%rbp),%edi
call   10c0 <isblank@plt>
add    $0x1,%ebx
add    $0x1,%rbp
test   %rax,%rax
jne    12f0 <main+0xc0>
lea    0xd60(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%rsp),%r15b
movsbl %r15b,%edi
call   1080 <iscntrl@plt>
test   %eax,%eax
jne    134d <main+0x11d>
lea    0x1(%rsp),%rbx
mov    %r15d,%ebp
xchg   %ax,%ax
movsbl %bpl,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%ebp
movsbl %bpl,%edi
call   1080 <iscntrl@plt>
add    $0x1,%rbx
test   %eax,%eax
je     1330 <main+0x100>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r15b,%r15b
je     13b5 <main+0x185>
lea    0x1(%rsp),%rbx
jmp    1390 <main+0x160>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
call   1100 <tolower@plt>
mov    %eax,%r15d
movsbl %r15b,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%r15d
add    $0x1,%rbx
test   %r15b,%r15b
je     13b5 <main+0x185>
movsbl %r15b,%ebp
mov    %ebp,%edi
call   1120 <isupper@plt>
test   %rax,%rax
jne    1370 <main+0x140>
mov    %ebp,%edi
call   1050 <islower@plt>
test   %rax,%rax
je     137a <main+0x14a>
mov    %ebp,%edi
call   1060 <toupper@plt>
jmp    1377 <main+0x147>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x31,%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     13ed <main+0x1bd>
lea    0xcaa(%rip),%rdi
call   1140 <atoi@plt>
lea    0x1(%rax),%edx
lea    0xca2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xcb5(%rip),%rdi
lea    0xcb9(%rip),%rsi
call   1130 <fopen@plt>
test   %rax,%rax
je     144e <main+0x21e>
mov    %rax,%rbx
jmp    1418 <main+0x1e8>
nopw   0x0(%rax,%rax,1)
movsbl (%r14),%eax
cmp    %eax,%ebp
je     1444 <main+0x214>
mov    %rbx,%rdi
call   10d0 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1150 <isgraph@plt>
test   %rax,%rax
je     1410 <main+0x1e0>
mov    %ebp,%edi
call   10e0 <ispunct@plt>
test   %eax,%eax
jne    1410 <main+0x1e0>
movsbl %bpl,%edi
call   1030 <putchar@plt>
jmp    1410 <main+0x1e0>
mov    %rbx,%rdi
call   1090 <fclose@plt>
jmp    145a <main+0x22a>
lea    0xc61(%rip),%rdi
call   1070 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.str1 = [9 x i8] c"ch34o...\00"
@.str = [29 x i8] c"Please input a string(<=20):\00"
@EOF = global i8 0
@.str.1 = [43 x i8] c"The first %d characters are alphanumeric.\0A\00"
@.str.2 = [36 x i8] c"The first %d characters are alpha.\0A\00"
@.str.3 = [19 x i8] c"Last blank is %d.\0A\00"
@__const.main.str3 = [7 x i8] c"1776ad\00"
@.str.4 = [35 x i8] c"The year that followed %d was %d.\0A\00"
@.str.5 = [11 x i8] c"myfile.txt\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [18 x i8] c"read file failed\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [9 x i8]
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8
%8 = alloca [7 x i8]
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 20, i32* %3
%12 = bitcast [9 x i8]* %4 to i8*
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %5
%16 = alloca i8, i64 %14
store i64 %14, i64* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %18
18: ; preds = %40, %0
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 1
%22 = icmp slt i32 %19, %21
br i1 %22, label %23, label %33
23: ; preds = %18
%24 = call signext i8 (...) @getchar()
store i8 %24, i8* %7
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 10
br i1 %26, label %27, label %33
27: ; preds = %23
%28 = load i8, i8* %7
%29 = sext i8 %28 to i32
%30 = load i8, i8* @EOF
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %29, %31
br label %33
33: ; preds = %27, %23, %18
%34 = phi i1 [ false, %23 ], [ false, %18 ], [ %32, %27 ]
br i1 %34, label %35, label %43
35: ; preds = %33
%36 = load i8, i8* %7
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %16, i64 %38
store i8 %36, i8* %39
br label %40
40: ; preds = %35
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %18
43: ; preds = %33
br label %44
44: ; preds = %51, %43
%45 = load i32, i32* %2
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %16, i64 %46
%48 = load i8, i8* %47
%49 = call i64 @isalnum(i8 signext %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %44
%52 = load i32, i32* %2
%53 = add nsw i32 %52, 1
store i32 %53, i32* %2
br label %44
54: ; preds = %44
%55 = load i32, i32* %2
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %55)
store i32 0, i32* %2
br label %57
57: ; preds = %64, %54
%58 = load i32, i32* %2
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %16, i64 %59
%61 = load i8, i8* %60
%62 = call i64 @isalpha(i8 signext %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %57
%65 = load i32, i32* %2
%66 = add nsw i32 %65, 1
store i32 %66, i32* %2
br label %57
67: ; preds = %57
%68 = load i32, i32* %2
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %68)
store i32 0, i32* %2
br label %70
70: ; preds = %77, %67
%71 = load i32, i32* %2
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %16, i64 %72
%74 = load i8, i8* %73
%75 = call i64 @isblank(i8 signext %74)
%76 = icmp ne i64 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %70
%78 = load i32, i32* %2
%79 = add nsw i32 %78, 1
store i32 %79, i32* %2
br label %70
80: ; preds = %70
%81 = load i32, i32* %2
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %81)
store i32 0, i32* %2
br label %83
83: ; preds = %91, %80
%84 = load i32, i32* %2
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i8, i8* %16, i64 %85
%87 = load i8, i8* %86
%88 = call i32 @iscntrl(i8 signext %87)
%89 = icmp ne i32 %88, 0
%90 = xor i1 %89, true
br i1 %90, label %91, label %99
91: ; preds = %83
%92 = load i32, i32* %2
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %16, i64 %93
%95 = load i8, i8* %94
%96 = call i32 @putchar(i8 signext %95)
%97 = load i32, i32* %2
%98 = add nsw i32 %97, 1
store i32 %98, i32* %2
br label %83
99: ; preds = %83
%100 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %2
br label %101
101: ; preds = %126, %99
%102 = load i32, i32* %2
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %16, i64 %103
%105 = load i8, i8* %104
%106 = icmp ne i8 %105, 0
br i1 %106, label %107, label %131
107: ; preds = %101
%108 = load i32, i32* %2
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %16, i64 %109
%111 = load i8, i8* %110
store i8 %111, i8* %7
%112 = load i8, i8* %7
%113 = call i64 @isupper(i8 signext %112)
%114 = icmp ne i64 %113, 0
br i1 %114, label %115, label %118
115: ; preds = %107
%116 = load i8, i8* %7
%117 = call signext i8 @tolower(i8 signext %116)
store i8 %117, i8* %7
br label %126
118: ; preds = %107
%119 = load i8, i8* %7
%120 = call i64 @islower(i8 signext %119)
%121 = icmp ne i64 %120, 0
br i1 %121, label %122, label %125
122: ; preds = %118
%123 = load i8, i8* %7
%124 = call signext i8 @toupper(i8 signext %123)
store i8 %124, i8* %7
br label %125
125: ; preds = %122, %118
br label %126
126: ; preds = %125, %115
%127 = load i8, i8* %7
%128 = call i32 @putchar(i8 signext %127)
%129 = load i32, i32* %2
%130 = add nsw i32 %129, 1
store i32 %130, i32* %2
br label %101
131: ; preds = %101
%132 = call i32 @putchar(i8 signext 10)
%133 = bitcast [7 x i8]* %8 to i8*
%134 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 0
%135 = load i8, i8* %134
%136 = call i64 @isdigit(i8 signext %135)
%137 = icmp ne i64 %136, 0
br i1 %137, label %138, label %145
138: ; preds = %131
%139 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 0
%140 = call i32 @atoi(i8* %139)
store i32 %140, i32* %9
%141 = load i32, i32* %9
%142 = load i32, i32* %9
%143 = add nsw i32 %142, 1
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %141, i32 %143)
br label %145
145: ; preds = %138, %131
%146 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %146, i32** %10
%147 = load i32*, i32** %10
%148 = icmp ne i32* %147, null
br i1 %148, label %149, label %173
149: ; preds = %145
br label %150
150: ; preds = %165, %149
%151 = load i32*, i32** %10
%152 = call i32 @fgetc(i32* %151)
store i32 %152, i32* %11
%153 = load i32, i32* %11
%154 = call i64 @isgraph(i32 %153)
%155 = icmp ne i64 %154, 0
br i1 %155, label %156, label %164
156: ; preds = %150
%157 = load i32, i32* %11
%158 = call i32 @ispunct(i32 %157)
%159 = icmp ne i32 %158, 0
br i1 %159, label %164, label %160
160: ; preds = %156
%161 = load i32, i32* %11
%162 = trunc i32 %161 to i8
%163 = call i32 @putchar(i8 signext %162)
br label %164
164: ; preds = %160, %156, %150
br label %165
165: ; preds = %164
%166 = load i32, i32* %11
%167 = load i8, i8* @EOF
%168 = sext i8 %167 to i32
%169 = icmp ne i32 %166, %168
br i1 %169, label %150, label %170
170: ; preds = %165
%171 = load i32*, i32** %10
%172 = call i32 @fclose(i32* %171)
br label %175
173: ; preds = %145
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
br label %175
175: ; preds = %173, %170
%176 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %1
%177 = load i8*, i8** %5
%178 = load i32, i32* %1
ret i32 %178
}

LLVM IR (-O2):
@.str = [29 x i8] c"Please input a string(<=20):\00"
@EOF = global i8 0
@.str.1 = [43 x i8] c"The first %d characters are alphanumeric.\0A\00"
@.str.2 = [36 x i8] c"The first %d characters are alpha.\0A\00"
@.str.3 = [19 x i8] c"Last blank is %d.\0A\00"
@__const.main.str3 = [7 x i8] c"1776ad\00"
@.str.4 = [35 x i8] c"The year that followed %d was %d.\0A\00"
@.str.5 = [11 x i8] c"myfile.txt\00"
@.str.6 = [2 x i8] c"r\00"
@str = [17 x i8] c"read file failed\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %10
%4 = phi i64 [ 0, %0 ], [ %12, %10 ]
%5 = tail call signext i8 (...) @getchar()
%6 = icmp eq i8 %5, 10
%7 = load i8, i8* @EOF
%8 = icmp eq i8 %5, %7
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %4
store i8 %5, i8* %11
%12 = add nuw nsw i64 %4, 1
%13 = icmp eq i64 %12, 19
br i1 %13, label %14, label %3
14: ; preds = %10, %3
%15 = phi i64 [ 19, %10 ], [ %4, %3 ]
%16 = and i64 %15, 4294967295
br label %17
17: ; preds = %17, %14
%18 = phi i64 [ %23, %17 ], [ %16, %14 ]
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = tail call i64 @isalnum(i8 signext %20)
%22 = icmp eq i64 %21, 0
%23 = add nuw i64 %18, 1
br i1 %22, label %24, label %17
24: ; preds = %17
%25 = trunc i64 %18 to i32
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %27, %24
%28 = phi i64 [ %33, %27 ], [ 0, %24 ]
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = tail call i64 @isalpha(i8 signext %30)
%32 = icmp eq i64 %31, 0
%33 = add nuw i64 %28, 1
br i1 %32, label %34, label %27
34: ; preds = %27
%35 = trunc i64 %28 to i32
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %37, %34
%38 = phi i64 [ %43, %37 ], [ 0, %34 ]
%39 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = tail call i64 @isblank(i8 signext %40)
%42 = icmp eq i64 %41, 0
%43 = add nuw i64 %38, 1
br i1 %42, label %44, label %37
44: ; preds = %37
%45 = trunc i64 %38 to i32
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%48 = load i8, i8* %47
%49 = tail call i32 @iscntrl(i8 signext %48)
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %60
51: ; preds = %44, %51
%52 = phi i64 [ %55, %51 ], [ 0, %44 ]
%53 = phi i8 [ %57, %51 ], [ %48, %44 ]
%54 = tail call i32 @putchar(i8 signext %53)
%55 = add nuw i64 %52, 1
%56 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = tail call i32 @iscntrl(i8 signext %57)
%59 = icmp eq i32 %58, 0
br i1 %59, label %51, label %60
60: ; preds = %51, %44
%61 = tail call i32 @putchar(i8 signext 10)
%62 = icmp eq i8 %48, 0
br i1 %62, label %82, label %63
63: ; preds = %60, %75
%64 = phi i64 [ %78, %75 ], [ 0, %60 ]
%65 = phi i8 [ %80, %75 ], [ %48, %60 ]
%66 = tail call i64 @isupper(i8 signext %65)
%67 = icmp eq i64 %66, 0
br i1 %67, label %70, label %68
68: ; preds = %63
%69 = tail call signext i8 @tolower(i8 signext %65)
br label %75
70: ; preds = %63
%71 = tail call i64 @islower(i8 signext %65)
%72 = icmp eq i64 %71, 0
br i1 %72, label %75, label %73
73: ; preds = %70
%74 = tail call signext i8 @toupper(i8 signext %65)
br label %75
75: ; preds = %70, %73, %68
%76 = phi i8 [ %69, %68 ], [ %74, %73 ], [ %65, %70 ]
%77 = tail call i32 @putchar(i8 signext %76)
%78 = add nuw i64 %64, 1
%79 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %78
%80 = load i8, i8* %79
%81 = icmp eq i8 %80, 0
br i1 %81, label %82, label %63
82: ; preds = %75, %60
%83 = tail call i32 @putchar(i8 signext 10)
%84 = tail call i64 @isdigit(i8 signext 49)
%85 = icmp eq i64 %84, 0
br i1 %85, label %90, label %86
86: ; preds = %82
%87 = tail call i32 @atoi(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__const.main.str3, i64 0, i64 0))
%88 = add nsw i32 %87, 1
%89 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %87, i32 %88)
br label %90
90: ; preds = %86, %82
%91 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%92 = icmp eq i32* %91, null
br i1 %92, label %109, label %93
93: ; preds = %90, %103
%94 = tail call i32 @fgetc(i32* %91)
%95 = tail call i64 @isgraph(i32 %94)
%96 = icmp eq i64 %95, 0
br i1 %96, label %103, label %97
97: ; preds = %93
%98 = tail call i32 @ispunct(i32 %94)
%99 = icmp eq i32 %98, 0
br i1 %99, label %100, label %103
100: ; preds = %97
%101 = trunc i32 %94 to i8
%102 = tail call i32 @putchar(i8 signext %101)
br label %103
103: ; preds = %93, %97, %100
%104 = load i8, i8* @EOF
%105 = sext i8 %104 to i32
%106 = icmp eq i32 %94, %105
br i1 %106, label %107, label %93
107: ; preds = %103
%108 = tail call i32 @fclose(i32* %91)
br label %111
109: ; preds = %90
%110 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %111
111: ; preds = %109, %107
%112 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}