#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 getchar();
scalar_t__ isdigit(int);
scalar_t__ islower(int);
scalar_t__ isupper(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, const char *argv[]) {
  int i, small = 0, digit = 0, capital = 0;
  while ((i = getchar()) != '#') {
    if (islower(i))
      ++small;
    if (isupper(i))
      ++capital;
    if (isdigit(i))
      ++digit;
  }
  printf("%i %i %i", capital, small, digit);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x23,%eax
je     11e4 <main+0x94>
mov    -0x14(%rbp),%edi
call   1040 <islower@plt>
cmp    $0x0,%rax
je     11a9 <main+0x59>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1070 <isupper@plt>
cmp    $0x0,%rax
je     11c4 <main+0x74>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11df <main+0x8f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117b <main+0x2b>
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe0c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1060 <getchar@plt>
mov    $0x0,%r15d
mov    $0x0,%ebx
cmp    $0x23,%eax
je     11ba <main+0x6a>
mov    %eax,%ebp
xor    %ebx,%ebx
xor    %r15d,%r15d
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <islower@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r14d
mov    %ebp,%edi
call   1070 <isupper@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
mov    %ebp,%edi
call   1030 <isdigit@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r15d
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebp
cmp    $0x23,%eax
jne    1180 <main+0x30>
lea    0xe3f(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%i %i %i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %10
10: ; preds = %34, %2
%11 = call i32 (...) @getchar()
store i32 %11, i32* %6
%12 = icmp ne i32 %11, 35
br i1 %12, label %13, label %35
13: ; preds = %10
%14 = load i32, i32* %6
%15 = call i64 @islower(i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
br label %20
20: ; preds = %17, %13
%21 = load i32, i32* %6
%22 = call i64 @isupper(i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
store i32 %26, i32* %9
br label %27
27: ; preds = %24, %20
%28 = load i32, i32* %6
%29 = call i64 @isdigit(i32 %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %34
34: ; preds = %31, %27
br label %10
35: ; preds = %10
%36 = load i32, i32* %9
%37 = load i32, i32* %7
%38 = load i32, i32* %8
%39 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %36, i32 %37, i32 %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%i %i %i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = icmp eq i32 %3, 35
br i1 %4, label %24, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %22, %5 ], [ %3, %2 ]
%7 = phi i32 [ %17, %5 ], [ 0, %2 ]
%8 = phi i32 [ %21, %5 ], [ 0, %2 ]
%9 = phi i32 [ %13, %5 ], [ 0, %2 ]
%10 = tail call i64 @islower(i32 %6)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %9, %12
%14 = tail call i64 @isupper(i32 %6)
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i32
%17 = add nuw nsw i32 %7, %16
%18 = tail call i64 @isdigit(i32 %6)
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i32
%21 = add nuw nsw i32 %8, %20
%22 = tail call i32 (...) @getchar()
%23 = icmp eq i32 %22, 35
br i1 %23, label %24, label %5
24: ; preds = %5, %2
%25 = phi i32 [ 0, %2 ], [ %13, %5 ]
%26 = phi i32 [ 0, %2 ], [ %21, %5 ]
%27 = phi i32 [ 0, %2 ], [ %17, %5 ]
%28 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %25, i32 %26)
ret i32 0
}