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    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    13d2 <GET_BOOL+0x2b2>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x54,-0x18(%rbp)
jne    124f <GET_BOOL+0x12f>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x52,-0x18(%rbp)
jne    121e <GET_BOOL+0xfe>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x55,-0x18(%rbp)
jne    11ed <GET_BOOL+0xcd>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x45,-0x18(%rbp)
jne    11bc <GET_BOOL+0x9c>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x18(%rbp)
je     11b7 <GET_BOOL+0x97>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
jmp    119e <GET_BOOL+0x7e>
jmp    11e8 <GET_BOOL+0xc8>
jmp    11c1 <GET_BOOL+0xa1>
cmpl   $0xa,-0x18(%rbp)
je     11da <GET_BOOL+0xba>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%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,-0x18(%rbp)
je     120b <GET_BOOL+0xeb>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%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,-0x18(%rbp)
je     123c <GET_BOOL+0x11c>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
jmp    1223 <GET_BOOL+0x103>
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13cd <GET_BOOL+0x2ad>
cmpl   $0x46,-0x18(%rbp)
jne    139c <GET_BOOL+0x27c>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x41,-0x18(%rbp)
jne    136b <GET_BOOL+0x24b>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x4c,-0x18(%rbp)
jne    133a <GET_BOOL+0x21a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x53,-0x18(%rbp)
jne    1309 <GET_BOOL+0x1e9>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x45,-0x18(%rbp)
jne    12d8 <GET_BOOL+0x1b8>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x18(%rbp)
je     12d3 <GET_BOOL+0x1b3>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
jmp    12ba <GET_BOOL+0x19a>
jmp    1304 <GET_BOOL+0x1e4>
jmp    12dd <GET_BOOL+0x1bd>
cmpl   $0xa,-0x18(%rbp)
je     12f6 <GET_BOOL+0x1d6>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%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,-0x18(%rbp)
je     1327 <GET_BOOL+0x207>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%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,-0x18(%rbp)
je     1358 <GET_BOOL+0x238>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%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,-0x18(%rbp)
je     1389 <GET_BOOL+0x269>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%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,-0x18(%rbp)
je     13ba <GET_BOOL+0x29a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%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>
mov    -0x4(%rbp),%eax
add    $0x20,%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 i32 @GET_BOOL(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 1, i32* %4
br label %6
6: ; preds = %132, %1
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %133
9: ; preds = %6
%10 = call i32 (...) @getchar()
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 84
br i1 %12, label %13, label %60
13: ; preds = %9
%14 = call i32 (...) @getchar()
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 82
br i1 %16, label %17, label %51
17: ; preds = %13
%18 = call i32 (...) @getchar()
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = icmp eq i32 %19, 85
br i1 %20, label %21, label %42
21: ; preds = %17
%22 = call i32 (...) @getchar()
store i32 %22, i32* %5
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 69
br i1 %24, label %25, label %33
25: ; preds = %21
%26 = load i32*, i32** %3
store i32 1, i32* %26
store i32 0, i32* %4
br label %27
27: ; preds = %30, %25
%28 = load i32, i32* %5
%29 = icmp ne i32 %28, 10
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (...) @getchar()
store i32 %31, i32* %5
br label %27
32: ; preds = %27
br label %41
33: ; preds = %21
br label %34
34: ; preds = %37, %33
%35 = load i32, i32* %5
%36 = icmp ne i32 %35, 10
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 (...) @getchar()
store i32 %38, i32* %5
br label %34
39: ; preds = %34
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %41
41: ; preds = %39, %32
br label %50
42: ; preds = %17
br label %43
43: ; preds = %46, %42
%44 = load i32, i32* %5
%45 = icmp ne i32 %44, 10
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 (...) @getchar()
store i32 %47, i32* %5
br label %43
48: ; preds = %43
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %50
50: ; preds = %48, %41
br label %59
51: ; preds = %13
br label %52
52: ; preds = %55, %51
%53 = load i32, i32* %5
%54 = icmp ne i32 %53, 10
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 (...) @getchar()
store i32 %56, i32* %5
br label %52
57: ; preds = %52
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %59
59: ; preds = %57, %50
br label %132
60: ; preds = %9
%61 = load i32, i32* %5
%62 = icmp eq i32 %61, 70
br i1 %62, label %63, label %123
63: ; preds = %60
%64 = call i32 (...) @getchar()
store i32 %64, i32* %5
%65 = load i32, i32* %5
%66 = icmp eq i32 %65, 65
br i1 %66, label %67, label %114
67: ; preds = %63
%68 = call i32 (...) @getchar()
store i32 %68, i32* %5
%69 = load i32, i32* %5
%70 = icmp eq i32 %69, 76
br i1 %70, label %71, label %105
71: ; preds = %67
%72 = call i32 (...) @getchar()
store i32 %72, i32* %5
%73 = load i32, i32* %5
%74 = icmp eq i32 %73, 83
br i1 %74, label %75, label %96
75: ; preds = %71
%76 = call i32 (...) @getchar()
store i32 %76, i32* %5
%77 = load i32, i32* %5
%78 = icmp eq i32 %77, 69
br i1 %78, label %79, label %87
79: ; preds = %75
%80 = load i32*, i32** %3
store i32 0, i32* %80
store i32 0, i32* %4
br label %81
81: ; preds = %84, %79
%82 = load i32, i32* %5
%83 = icmp ne i32 %82, 10
br i1 %83, label %84, label %86
84: ; preds = %81
%85 = call i32 (...) @getchar()
store i32 %85, i32* %5
br label %81
86: ; preds = %81
br label %95
87: ; preds = %75
br label %88
88: ; preds = %91, %87
%89 = load i32, i32* %5
%90 = icmp ne i32 %89, 10
br i1 %90, label %91, label %93
91: ; preds = %88
%92 = call i32 (...) @getchar()
store i32 %92, i32* %5
br label %88
93: ; preds = %88
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %95
95: ; preds = %93, %86
br label %104
96: ; preds = %71
br label %97
97: ; preds = %100, %96
%98 = load i32, i32* %5
%99 = icmp ne i32 %98, 10
br i1 %99, label %100, label %102
100: ; preds = %97
%101 = call i32 (...) @getchar()
store i32 %101, i32* %5
br label %97
102: ; preds = %97
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %104
104: ; preds = %102, %95
br label %113
105: ; preds = %67
br label %106
106: ; preds = %109, %105
%107 = load i32, i32* %5
%108 = icmp ne i32 %107, 10
br i1 %108, label %109, label %111
109: ; preds = %106
%110 = call i32 (...) @getchar()
store i32 %110, i32* %5
br label %106
111: ; preds = %106
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %113
113: ; preds = %111, %104
br label %122
114: ; preds = %63
br label %115
115: ; preds = %118, %114
%116 = load i32, i32* %5
%117 = icmp ne i32 %116, 10
br i1 %117, label %118, label %120
118: ; preds = %115
%119 = call i32 (...) @getchar()
store i32 %119, i32* %5
br label %115
120: ; preds = %115
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %122
122: ; preds = %120, %113
br label %131
123: ; preds = %60
br label %124
124: ; preds = %127, %123
%125 = load i32, i32* %5
%126 = icmp ne i32 %125, 10
br i1 %126, label %127, label %129
127: ; preds = %124
%128 = call i32 (...) @getchar()
store i32 %128, i32* %5
br label %124
129: ; preds = %124
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %131
131: ; preds = %129, %122
br label %132
132: ; preds = %131, %59
br label %6
133: ; preds = %6
%134 = load i32, i32* %2
ret i32 %134
}

LLVM IR (-O2):
@.str = [44 x i8] c" Not a boolean (TRUE/FALSE) - re-input: \00"
define i32 @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 i32 undef
}