void GET_BOOL(r) int *r;
{
  int b, c;
  b = 1;
  while (b == 1) {
    c = getchar();
    if (c == 'T') {
      c = getchar();
      if (c == 'R') {
        c = getchar();
        if (c == 'U') {
          c = getchar();
          if (c == 'E') {
            *r = 1;
            b = 0;
            while (c != '\n') {
              c = getchar();
            }
          } else {
            while (c != '\n') {
              c = getchar();
            }
            printf("    Not a boolean (TRUE/FALSE) - re-input: ");
          }
        } else {
          while (c != '\n') {
            c = getchar();
          }
          printf("    Not a boolean (TRUE/FALSE) - re-input: ");
        }
      } else {
        while (c != '\n') {
          c = getchar();
        }
        printf("    Not a boolean (TRUE/FALSE) - re-input: ");
      }
    } else if (c == 'F') {
      c = getchar();
      if (c == 'A') {
        c = getchar();
        if (c == 'L') {
          c = getchar();
          if (c == 'S') {
            c = getchar();
            if (c == 'E') {
              *r = 0;
              b = 0;
              while (c != '\n') {
                c = getchar();
              }
            } else {
              while (c != '\n') {
                c = getchar();
              }
              printf("    Not a boolean (TRUE/FALSE) - re-input: ");
            }
          } else {
            while (c != '\n') {
              c = getchar();
            }
            printf("    Not a boolean (TRUE/FALSE) - re-input: ");
          }
        } else {
          while (c != '\n') {
            c = getchar();
          }
          printf("    Not a boolean (TRUE/FALSE) - re-input: ");
        }
      } else {
        while (c != '\n') {
          c = getchar();
        }
        printf("    Not a boolean (TRUE/FALSE) - re-input: ");
      }
    } else {
      while (c != '\n') {
        c = getchar();
      }
      printf("    Not a boolean (TRUE/FALSE) - re-input: ");
    }
  }
}


x86 assembly (clang, -O0):
<GET_BOOL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    13d2 <GET_BOOL+0x2b2>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x54,-0x10(%rbp)
jne    124f <GET_BOOL+0x12f>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x52,-0x10(%rbp)
jne    121e <GET_BOOL+0xfe>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x55,-0x10(%rbp)
jne    11ed <GET_BOOL+0xcd>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x45,-0x10(%rbp)
jne    11bc <GET_BOOL+0x9c>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0x10(%rbp)
je     11b7 <GET_BOOL+0x97>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
jmp    119e <GET_BOOL+0x7e>
jmp    11e8 <GET_BOOL+0xc8>
jmp    11c1 <GET_BOOL+0xa1>
cmpl   $0xa,-0x10(%rbp)
je     11da <GET_BOOL+0xba>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
jmp    11c1 <GET_BOOL+0xa1>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1219 <GET_BOOL+0xf9>
jmp    11f2 <GET_BOOL+0xd2>
cmpl   $0xa,-0x10(%rbp)
je     120b <GET_BOOL+0xeb>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
jmp    11f2 <GET_BOOL+0xd2>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124a <GET_BOOL+0x12a>
jmp    1223 <GET_BOOL+0x103>
cmpl   $0xa,-0x10(%rbp)
je     123c <GET_BOOL+0x11c>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
jmp    1223 <GET_BOOL+0x103>
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13cd <GET_BOOL+0x2ad>
cmpl   $0x46,-0x10(%rbp)
jne    139c <GET_BOOL+0x27c>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x41,-0x10(%rbp)
jne    136b <GET_BOOL+0x24b>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x4c,-0x10(%rbp)
jne    133a <GET_BOOL+0x21a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x53,-0x10(%rbp)
jne    1309 <GET_BOOL+0x1e9>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x45,-0x10(%rbp)
jne    12d8 <GET_BOOL+0x1b8>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0x10(%rbp)
je     12d3 <GET_BOOL+0x1b3>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
jmp    12ba <GET_BOOL+0x19a>
jmp    1304 <GET_BOOL+0x1e4>
jmp    12dd <GET_BOOL+0x1bd>
cmpl   $0xa,-0x10(%rbp)
je     12f6 <GET_BOOL+0x1d6>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
jmp    12dd <GET_BOOL+0x1bd>
lea    0xd03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1335 <GET_BOOL+0x215>
jmp    130e <GET_BOOL+0x1ee>
cmpl   $0xa,-0x10(%rbp)
je     1327 <GET_BOOL+0x207>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
jmp    130e <GET_BOOL+0x1ee>
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1366 <GET_BOOL+0x246>
jmp    133f <GET_BOOL+0x21f>
cmpl   $0xa,-0x10(%rbp)
je     1358 <GET_BOOL+0x238>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
jmp    133f <GET_BOOL+0x21f>
lea    0xca1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1397 <GET_BOOL+0x277>
jmp    1370 <GET_BOOL+0x250>
cmpl   $0xa,-0x10(%rbp)
je     1389 <GET_BOOL+0x269>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
jmp    1370 <GET_BOOL+0x250>
lea    0xc70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c8 <GET_BOOL+0x2a8>
jmp    13a1 <GET_BOOL+0x281>
cmpl   $0xa,-0x10(%rbp)
je     13ba <GET_BOOL+0x29a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
jmp    13a1 <GET_BOOL+0x281>
lea    0xc3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13cd <GET_BOOL+0x2ad>
jmp    1133 <GET_BOOL+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_BOOL>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rbx
jmp    113a <GET_BOOL+0x1a>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1130 <GET_BOOL+0x10>
cmp    $0x46,%eax
je     11f0 <GET_BOOL+0xd0>
cmp    $0x54,%eax
jne    11a0 <GET_BOOL+0x80>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1130 <GET_BOOL+0x10>
cmp    $0x52,%eax
jne    11b0 <GET_BOOL+0x90>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1130 <GET_BOOL+0x10>
cmp    $0x55,%eax
jne    11d0 <GET_BOOL+0xb0>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1130 <GET_BOOL+0x10>
cmp    $0x45,%eax
je     12c1 <GET_BOOL+0x1a1>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1190 <GET_BOOL+0x70>
jmp    1130 <GET_BOOL+0x10>
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    11a0 <GET_BOOL+0x80>
jmp    1130 <GET_BOOL+0x10>
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    11b0 <GET_BOOL+0x90>
jmp    1130 <GET_BOOL+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    11d0 <GET_BOOL+0xb0>
jmp    1130 <GET_BOOL+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1130 <GET_BOOL+0x10>
cmp    $0x41,%eax
jne    1270 <GET_BOOL+0x150>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1130 <GET_BOOL+0x10>
cmp    $0x4c,%eax
jne    1290 <GET_BOOL+0x170>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1130 <GET_BOOL+0x10>
cmp    $0x53,%eax
jne    12b0 <GET_BOOL+0x190>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1130 <GET_BOOL+0x10>
cmp    $0x45,%eax
je     12de <GET_BOOL+0x1be>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1250 <GET_BOOL+0x130>
jmp    1130 <GET_BOOL+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1270 <GET_BOOL+0x150>
jmp    1130 <GET_BOOL+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1290 <GET_BOOL+0x170>
jmp    1130 <GET_BOOL+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    12b0 <GET_BOOL+0x190>
jmp    1130 <GET_BOOL+0x10>
movl   $0x1,(%r14)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    12d0 <GET_BOOL+0x1b0>
jmp    12fc <GET_BOOL+0x1dc>
movl   $0x0,(%r14)
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    12f0 <GET_BOOL+0x1d0>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [44 x i8] c" Not a boolean (TRUE/FALSE) - re-input: \00"
define void @GET_BOOL(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
br label %5
5: ; preds = %131, %1
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %132
8: ; preds = %5
%9 = call i32 (...) @getchar()
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 84
br i1 %11, label %12, label %59
12: ; preds = %8
%13 = call i32 (...) @getchar()
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 82
br i1 %15, label %16, label %50
16: ; preds = %12
%17 = call i32 (...) @getchar()
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 85
br i1 %19, label %20, label %41
20: ; preds = %16
%21 = call i32 (...) @getchar()
store i32 %21, i32* %4
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, 69
br i1 %23, label %24, label %32
24: ; preds = %20
%25 = load i32*, i32** %2
store i32 1, i32* %25
store i32 0, i32* %3
br label %26
26: ; preds = %29, %24
%27 = load i32, i32* %4
%28 = icmp ne i32 %27, 10
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (...) @getchar()
store i32 %30, i32* %4
br label %26
31: ; preds = %26
br label %40
32: ; preds = %20
br label %33
33: ; preds = %36, %32
%34 = load i32, i32* %4
%35 = icmp ne i32 %34, 10
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 (...) @getchar()
store i32 %37, i32* %4
br label %33
38: ; preds = %33
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %40
40: ; preds = %38, %31
br label %49
41: ; preds = %16
br label %42
42: ; preds = %45, %41
%43 = load i32, i32* %4
%44 = icmp ne i32 %43, 10
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 (...) @getchar()
store i32 %46, i32* %4
br label %42
47: ; preds = %42
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %49
49: ; preds = %47, %40
br label %58
50: ; preds = %12
br label %51
51: ; preds = %54, %50
%52 = load i32, i32* %4
%53 = icmp ne i32 %52, 10
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = call i32 (...) @getchar()
store i32 %55, i32* %4
br label %51
56: ; preds = %51
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %58
58: ; preds = %56, %49
br label %131
59: ; preds = %8
%60 = load i32, i32* %4
%61 = icmp eq i32 %60, 70
br i1 %61, label %62, label %122
62: ; preds = %59
%63 = call i32 (...) @getchar()
store i32 %63, i32* %4
%64 = load i32, i32* %4
%65 = icmp eq i32 %64, 65
br i1 %65, label %66, label %113
66: ; preds = %62
%67 = call i32 (...) @getchar()
store i32 %67, i32* %4
%68 = load i32, i32* %4
%69 = icmp eq i32 %68, 76
br i1 %69, label %70, label %104
70: ; preds = %66
%71 = call i32 (...) @getchar()
store i32 %71, i32* %4
%72 = load i32, i32* %4
%73 = icmp eq i32 %72, 83
br i1 %73, label %74, label %95
74: ; preds = %70
%75 = call i32 (...) @getchar()
store i32 %75, i32* %4
%76 = load i32, i32* %4
%77 = icmp eq i32 %76, 69
br i1 %77, label %78, label %86
78: ; preds = %74
%79 = load i32*, i32** %2
store i32 0, i32* %79
store i32 0, i32* %3
br label %80
80: ; preds = %83, %78
%81 = load i32, i32* %4
%82 = icmp ne i32 %81, 10
br i1 %82, label %83, label %85
83: ; preds = %80
%84 = call i32 (...) @getchar()
store i32 %84, i32* %4
br label %80
85: ; preds = %80
br label %94
86: ; preds = %74
br label %87
87: ; preds = %90, %86
%88 = load i32, i32* %4
%89 = icmp ne i32 %88, 10
br i1 %89, label %90, label %92
90: ; preds = %87
%91 = call i32 (...) @getchar()
store i32 %91, i32* %4
br label %87
92: ; preds = %87
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %94
94: ; preds = %92, %85
br label %103
95: ; preds = %70
br label %96
96: ; preds = %99, %95
%97 = load i32, i32* %4
%98 = icmp ne i32 %97, 10
br i1 %98, label %99, label %101
99: ; preds = %96
%100 = call i32 (...) @getchar()
store i32 %100, i32* %4
br label %96
101: ; preds = %96
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %103
103: ; preds = %101, %94
br label %112
104: ; preds = %66
br label %105
105: ; preds = %108, %104
%106 = load i32, i32* %4
%107 = icmp ne i32 %106, 10
br i1 %107, label %108, label %110
108: ; preds = %105
%109 = call i32 (...) @getchar()
store i32 %109, i32* %4
br label %105
110: ; preds = %105
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %112
112: ; preds = %110, %103
br label %121
113: ; preds = %62
br label %114
114: ; preds = %117, %113
%115 = load i32, i32* %4
%116 = icmp ne i32 %115, 10
br i1 %116, label %117, label %119
117: ; preds = %114
%118 = call i32 (...) @getchar()
store i32 %118, i32* %4
br label %114
119: ; preds = %114
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %121
121: ; preds = %119, %112
br label %130
122: ; preds = %59
br label %123
123: ; preds = %126, %122
%124 = load i32, i32* %4
%125 = icmp ne i32 %124, 10
br i1 %125, label %126, label %128
126: ; preds = %123
%127 = call i32 (...) @getchar()
store i32 %127, i32* %4
br label %123
128: ; preds = %123
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %130
130: ; preds = %128, %121
br label %131
131: ; preds = %130, %58
br label %5
132: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c" Not a boolean (TRUE/FALSE) - re-input: \00"
define void @GET_BOOL(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %50, %1
%3 = tail call i32 (...) @getchar()
switch i32 %3, label %47 [
i32 84, label %4
i32 70, label %23
i32 10, label %50
]
4: ; preds = %2
%5 = tail call i32 (...) @getchar()
switch i32 %5, label %20 [
i32 82, label %6
i32 10, label %50
]
6: ; preds = %4
%7 = tail call i32 (...) @getchar()
switch i32 %7, label %17 [
i32 85, label %8
i32 10, label %50
]
8: ; preds = %6
%9 = tail call i32 (...) @getchar()
switch i32 %9, label %14 [
i32 69, label %10
i32 10, label %50
]
10: ; preds = %8
store i32 1, i32* %0
br label %11
11: ; preds = %10, %11
%12 = tail call i32 (...) @getchar()
%13 = icmp eq i32 %12, 10
br i1 %13, label %52, label %11
14: ; preds = %8, %14
%15 = tail call i32 (...) @getchar()
%16 = icmp eq i32 %15, 10
br i1 %16, label %50, label %14
17: ; preds = %6, %17
%18 = tail call i32 (...) @getchar()
%19 = icmp eq i32 %18, 10
br i1 %19, label %50, label %17
20: ; preds = %4, %20
%21 = tail call i32 (...) @getchar()
%22 = icmp eq i32 %21, 10
br i1 %22, label %50, label %20
23: ; preds = %2
%24 = tail call i32 (...) @getchar()
switch i32 %24, label %44 [
i32 65, label %25
i32 10, label %50
]
25: ; preds = %23
%26 = tail call i32 (...) @getchar()
switch i32 %26, label %41 [
i32 76, label %27
i32 10, label %50
]
27: ; preds = %25
%28 = tail call i32 (...) @getchar()
switch i32 %28, label %38 [
i32 83, label %29
i32 10, label %50
]
29: ; preds = %27
%30 = tail call i32 (...) @getchar()
switch i32 %30, label %35 [
i32 69, label %31
i32 10, label %50
]
31: ; preds = %29
store i32 0, i32* %0
br label %32
32: ; preds = %31, %32
%33 = tail call i32 (...) @getchar()
%34 = icmp eq i32 %33, 10
br i1 %34, label %52, label %32
35: ; preds = %29, %35
%36 = tail call i32 (...) @getchar()
%37 = icmp eq i32 %36, 10
br i1 %37, label %50, label %35
38: ; preds = %27, %38
%39 = tail call i32 (...) @getchar()
%40 = icmp eq i32 %39, 10
br i1 %40, label %50, label %38
41: ; preds = %25, %41
%42 = tail call i32 (...) @getchar()
%43 = icmp eq i32 %42, 10
br i1 %43, label %50, label %41
44: ; preds = %23, %44
%45 = tail call i32 (...) @getchar()
%46 = icmp eq i32 %45, 10
br i1 %46, label %50, label %44
47: ; preds = %2, %47
%48 = tail call i32 (...) @getchar()
%49 = icmp eq i32 %48, 10
br i1 %49, label %50, label %47
50: ; preds = %35, %38, %41, %44, %14, %17, %20, %47, %2, %23, %25, %27, %29, %4, %6, %8
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %2
52: ; preds = %32, %11
ret void
}