#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 */

/* Variables and functions */
int /*<<< orphan*/ _flushall();
int scanf(char *, char *);
int enter_initials(char *initial_a, char *initial_b, char *initial_c) {
  int good_initials = 0, a_result = 0, b_result = 0, c_result = 0;
  char a_initial = 'A', b_initial = 'A', c_initial = 'A';
  _flushall();
  a_result = scanf("%c", &a_initial);
  b_result = scanf("%c", &b_initial);
  c_result = scanf("%c", &c_initial);
  if (((a_initial >= 'A') && (a_initial <= 'Z')) &&
      ((b_initial >= 'A') && (b_initial <= 'Z')) &&
      ((c_initial >= 'A') && (c_initial <= 'Z'))) {
    good_initials = 1;
  }
  if ((!a_result) || (!b_result) || (!c_result)) {
    good_initials = 0;
  }
  *initial_a = a_initial;
  *initial_b = b_initial;
  *initial_c = c_initial;
  return good_initials;
}


x86 assembly (clang, -O0):
<enter_initials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movb   $0x41,-0x29(%rbp)
movb   $0x41,-0x2a(%rbp)
movb   $0x41,-0x2b(%rbp)
mov    $0x0,%al
call   1030 <_flushall@plt>
lea    0xe96(%rip),%rdi
lea    -0x29(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x20(%rbp)
lea    0xe83(%rip),%rdi
lea    -0x2a(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x24(%rbp)
lea    0xe70(%rip),%rdi
lea    -0x2b(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x28(%rbp)
movsbl -0x29(%rbp),%eax
cmp    $0x41,%eax
jl     11f1 <enter_initials+0xd1>
movsbl -0x29(%rbp),%eax
cmp    $0x5a,%eax
jg     11f1 <enter_initials+0xd1>
movsbl -0x2a(%rbp),%eax
cmp    $0x41,%eax
jl     11f1 <enter_initials+0xd1>
movsbl -0x2a(%rbp),%eax
cmp    $0x5a,%eax
jg     11f1 <enter_initials+0xd1>
movsbl -0x2b(%rbp),%eax
cmp    $0x41,%eax
jl     11f1 <enter_initials+0xd1>
movsbl -0x2b(%rbp),%eax
cmp    $0x5a,%eax
jg     11f1 <enter_initials+0xd1>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     120f <enter_initials+0xef>
cmpl   $0x0,-0x24(%rbp)
je     120f <enter_initials+0xef>
cmpl   $0x0,-0x28(%rbp)
jne    1216 <enter_initials+0xf6>
movl   $0x0,-0x1c(%rbp)
mov    -0x29(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x2a(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x2b(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enter_initials>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,0x10(%rsp)
mov    %rsi,%r15
mov    %rdi,%r12
movb   $0x41,0xf(%rsp)
movb   $0x41,0xe(%rsp)
movb   $0x41,0xd(%rsp)
xor    %eax,%eax
call   1030 <_flushall@plt>
lea    0xeaa(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %eax,%r13d
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %eax,%r14d
lea    0xd(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xf(%rsp),%bpl
lea    -0x41(%rbp),%edx
cmp    $0x1a,%dl
setb   %sil
mov    0xe(%rsp),%r11b
cmp    $0x41,%r11b
setge  %r8b
cmp    $0x5b,%r11b
setl   %dil
mov    0xd(%rsp),%bl
cmp    $0x41,%bl
setge  %cl
cmp    $0x5b,%bl
setl   %r9b
test   %r13d,%r13d
setne  %r10b
test   %r14d,%r14d
setne  %dl
and    %r10b,%dl
test   %eax,%eax
setne  %al
and    %dl,%al
and    %r8b,%al
and    %sil,%al
and    %dil,%cl
and    %r9b,%cl
and    %al,%cl
movzbl %cl,%eax
mov    %bpl,(%r12)
mov    %r11b,(%r15)
mov    0x10(%rsp),%rcx
mov    %bl,(%rcx)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @enter_initials(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i8 65, i8* %11
store i8 65, i8* %12
store i8 65, i8* %13
%14 = call i32 (...) @_flushall()
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 %15, i32* %8
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 %16, i32* %9
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 %17, i32* %10
%18 = load i8, i8* %11
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 65
br i1 %20, label %21, label %42
21: ; preds = %3
%22 = load i8, i8* %11
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 90
br i1 %24, label %25, label %42
25: ; preds = %21
%26 = load i8, i8* %12
%27 = sext i8 %26 to i32
%28 = icmp sge i32 %27, 65
br i1 %28, label %29, label %42
29: ; preds = %25
%30 = load i8, i8* %12
%31 = sext i8 %30 to i32
%32 = icmp sle i32 %31, 90
br i1 %32, label %33, label %42
33: ; preds = %29
%34 = load i8, i8* %13
%35 = sext i8 %34 to i32
%36 = icmp sge i32 %35, 65
br i1 %36, label %37, label %42
37: ; preds = %33
%38 = load i8, i8* %13
%39 = sext i8 %38 to i32
%40 = icmp sle i32 %39, 90
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 1, i32* %7
br label %42
42: ; preds = %41, %37, %33, %29, %25, %21, %3
%43 = load i32, i32* %8
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %51
45: ; preds = %42
%46 = load i32, i32* %9
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = load i32, i32* %10
%50 = icmp ne i32 %49, 0
br i1 %50, label %52, label %51
51: ; preds = %48, %45, %42
store i32 0, i32* %7
br label %52
52: ; preds = %51, %48
%53 = load i8, i8* %11
%54 = load i8*, i8** %4
store i8 %53, i8* %54
%55 = load i8, i8* %12
%56 = load i8*, i8** %5
store i8 %55, i8* %56
%57 = load i8, i8* %13
%58 = load i8*, i8** %6
store i8 %57, i8* %58
%59 = load i32, i32* %7
ret i32 %59
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @enter_initials(i8* nocapture writeonly %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 65, i8* %4
store i8 65, i8* %5
store i8 65, i8* %6
%7 = tail call i32 (...) @_flushall()
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%11 = load i8, i8* %4
%12 = add i8 %11, -65
%13 = icmp ult i8 %12, 26
%14 = load i8, i8* %5
%15 = icmp sgt i8 %14, 64
%16 = icmp slt i8 %14, 91
%17 = load i8, i8* %6
%18 = icmp sgt i8 %17, 64
%19 = icmp slt i8 %17, 91
%20 = icmp ne i32 %8, 0
%21 = icmp ne i32 %9, 0
%22 = and i1 %20, %21
%23 = icmp ne i32 %10, 0
%24 = and i1 %22, %23
%25 = select i1 %24, i1 %13, i1 false
%26 = select i1 %25, i1 %15, i1 false
%27 = select i1 %26, i1 %16, i1 false
%28 = select i1 %27, i1 %18, i1 false
%29 = select i1 %28, i1 %19, i1 false
%30 = zext i1 %29 to i32
store i8 %11, i8* %0
store i8 %14, i8* %1
store i8 %17, i8* %2
ret i32 %30
}