int white_space(char A) {
  static int commentP = 0;
  if (A == '%') {
    commentP = 1;
    return 1;
  }
  if (commentP) {
    if (A == '\n')
      commentP = 0;
    return 1;
  }
  if (A == ' ' || A == '\n' || A == '\t')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<white_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x25,%eax
jne    112d <white_space+0x2d>
movl   $0x1,0x2f03(%rip)
movl   $0x1,-0x4(%rbp)
jmp    1197 <white_space+0x97>
cmpl   $0x0,0x2ef0(%rip)
je     115d <white_space+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1151 <white_space+0x51>
movl   $0x0,0x2ed3(%rip)
movl   $0x1,-0x4(%rbp)
jmp    1197 <white_space+0x97>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1184 <white_space+0x84>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1184 <white_space+0x84>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    1190 <white_space+0x90>
movl   $0x1,-0x4(%rbp)
jmp    1197 <white_space+0x97>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<white_space>:
cmp    $0x25,%dil
jne    1113 <white_space+0x13>
movb   $0x1,0x2f17(%rip)
mov    $0x1,%eax
ret
cmpb   $0x1,0x2f0a(%rip)
jne    112f <white_space+0x2f>
mov    $0x1,%eax
cmp    $0xa,%dil
jne    114e <white_space+0x4e>
movb   $0x0,0x2ef6(%rip)
ret
cmp    $0x20,%dil
ja     114f <white_space+0x4f>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    114f <white_space+0x4f>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@white_space.commentP = internal global i32 0
define i32 @white_space(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 37
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* @white_space.commentP
store i32 1, i32* %2
br label %31
8: ; preds = %1
%9 = load i32, i32* @white_space.commentP
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 0, i32* @white_space.commentP
br label %16
16: ; preds = %15, %11
store i32 1, i32* %2
br label %31
17: ; preds = %8
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 32
br i1 %20, label %29, label %21
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 10
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 9
br i1 %28, label %29, label %30
29: ; preds = %25, %21, %17
store i32 1, i32* %2
br label %31
30: ; preds = %25
store i32 0, i32* %2
br label %31
31: ; preds = %30, %29, %16, %7
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
@white_space.commentP = internal unnamed_addr global i1 false
define i32 @white_space(i8 signext %0) {
%2 = icmp eq i8 %0, 37
br i1 %2, label %3, label %4
3: ; preds = %1
store i1 true, i1* @white_space.commentP
br label %11
4: ; preds = %1
%5 = load i1, i1* @white_space.commentP
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = icmp eq i8 %0, 10
br i1 %7, label %8, label %11
8: ; preds = %6
store i1 false, i1* @white_space.commentP
br label %11
9: ; preds = %4
switch i8 %0, label %10 [
i8 32, label %11
i8 10, label %11
i8 9, label %11
]
10: ; preds = %9
br label %11
11: ; preds = %9, %9, %9, %6, %8, %10, %3
%12 = phi i32 [ 1, %3 ], [ 0, %10 ], [ 1, %8 ], [ 1, %6 ], [ 1, %9 ], [ 1, %9 ], [ 1, %9 ]
ret i32 %12
}