#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*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ isdigit(char);
scalar_t__ islower(char);
scalar_t__ isspace(char);
scalar_t__ isupper(char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
int /*<<< orphan*/ system(char *);
int main() {
  system("clear");
  char yazi[100];
  int i;
  printf("yazi girin: ");
  fgets(yazi, 100, stdin);
  yazi[strlen(yazi) - 1] = '\0';
  int kucuk_sayi = 0;
  int buyuk_sayi = 0;
  int rakam_sayi = 0;
  int bosluk_sayi = 0;
  for (i = 0; yazi[i] != '\0'; i++) {
    kucuk_sayi += (islower(yazi[i])) ? 1 : 0;
    buyuk_sayi += (isupper(yazi[i])) ? 1 : 0;
    rakam_sayi += (isdigit(yazi[i])) ? 1 : 0;
    bosluk_sayi += (isspace(yazi[i])) ? 1 : 0;
  }
  printf("kucuk harf sayisi: %d\n", kucuk_sayi);
  printf("buyuk harf sayisi: %d\n", buyuk_sayi);
  printf("rakam sayisi: %d\n", rakam_sayi);
  printf("bosluk sayisi: %d\n", bosluk_sayi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe67(%rip),%rdi
call   1060 <system@plt>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    0x2e31(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1090 <fgets@plt>
lea    -0x70(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x70(%rbp,%rax,1)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x74(%rbp)
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     12b6 <main+0x136>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   1040 <islower@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    -0x78(%rbp),%eax
mov    %eax,-0x78(%rbp)
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   10a0 <isupper@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    -0x7c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   1030 <isdigit@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    -0x80(%rbp),%eax
mov    %eax,-0x80(%rbp)
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   1080 <isspace@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    -0x84(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11fc <main+0x7c>
mov    -0x78(%rbp),%esi
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x7c(%rbp),%esi
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x80(%rbp),%esi
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x84(%rbp),%esi
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x70,%rsp
lea    0xe6d(%rip),%rdi
call   1060 <system@plt>
lea    0xe67(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x64,%esi
call   1090 <fgets@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    (%rsp),%al
mov    $0x0,%ebx
mov    $0x0,%r12d
mov    $0x0,%r15d
test   %al,%al
je     124e <main+0xce>
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %ebx,%ebx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
call   1040 <islower@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r14d
movsbl 0x0(%rbp),%edi
call   10a0 <isupper@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
movsbl 0x0(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r12d
movsbl 0x0(%rbp),%edi
call   1080 <isspace@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r15d
movzbl 0x1(%rbp),%eax
add    $0x1,%rbp
test   %al,%al
jne    1200 <main+0x80>
lea    0xdbe(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdc4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdcb(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdcc(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [13 x i8] c"yazi girin: \00"
@stdin = global i32 0
@.str.2 = [23 x i8] c"kucuk harf sayisi: %d\0A\00"
@.str.3 = [23 x i8] c"buyuk harf sayisi: %d\0A\00"
@.str.4 = [18 x i8] c"rakam sayisi: %d\0A\00"
@.str.5 = [19 x i8] c"bosluk sayisi: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %10, i32 100, i32 %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %16
store i8 0, i8* %17
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %3
br label %18
18: ; preds = %66, %0
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %69
25: ; preds = %18
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = call i64 @islower(i8 signext %29)
%31 = icmp ne i64 %30, 0
%32 = zext i1 %31 to i64
%33 = select i1 %31, i32 1, i32 0
%34 = load i32, i32* %4
%35 = add nsw i32 %34, %33
store i32 %35, i32* %4
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = call i64 @isupper(i8 signext %39)
%41 = icmp ne i64 %40, 0
%42 = zext i1 %41 to i64
%43 = select i1 %41, i32 1, i32 0
%44 = load i32, i32* %5
%45 = add nsw i32 %44, %43
store i32 %45, i32* %5
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = call i64 @isdigit(i8 signext %49)
%51 = icmp ne i64 %50, 0
%52 = zext i1 %51 to i64
%53 = select i1 %51, i32 1, i32 0
%54 = load i32, i32* %6
%55 = add nsw i32 %54, %53
store i32 %55, i32* %6
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = call i64 @isspace(i8 signext %59)
%61 = icmp ne i64 %60, 0
%62 = zext i1 %61 to i64
%63 = select i1 %61, i32 1, i32 0
%64 = load i32, i32* %7
%65 = add nsw i32 %64, %63
store i32 %65, i32* %7
br label %66
66: ; preds = %25
%67 = load i32, i32* %3
%68 = add nsw i32 %67, 1
store i32 %68, i32* %3
br label %18
69: ; preds = %18
%70 = load i32, i32* %4
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %5
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %6
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %7
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %76)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [13 x i8] c"yazi girin: \00"
@stdin = global i32 0
@.str.2 = [23 x i8] c"kucuk harf sayisi: %d\0A\00"
@.str.3 = [23 x i8] c"buyuk harf sayisi: %d\0A\00"
@.str.4 = [18 x i8] c"rakam sayisi: %d\0A\00"
@.str.5 = [19 x i8] c"bosluk sayisi: %d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %3, i32 100, i32 %5)
%7 = call i32 @strlen(i8* %3)
%8 = add nsw i32 %7, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %10
%11 = load i8, i8* %3
%12 = icmp eq i8 %11, 0
br i1 %12, label %44, label %13
13: ; preds = %0, %13
%14 = phi i64 [ %40, %13 ], [ 0, %0 ]
%15 = phi i8 [ %42, %13 ], [ %11, %0 ]
%16 = phi i8* [ %41, %13 ], [ %3, %0 ]
%17 = phi i32 [ %39, %13 ], [ 0, %0 ]
%18 = phi i32 [ %34, %13 ], [ 0, %0 ]
%19 = phi i32 [ %29, %13 ], [ 0, %0 ]
%20 = phi i32 [ %24, %13 ], [ 0, %0 ]
%21 = call i64 @islower(i8 signext %15)
%22 = icmp ne i64 %21, 0
%23 = zext i1 %22 to i32
%24 = add nuw nsw i32 %20, %23
%25 = load i8, i8* %16
%26 = call i64 @isupper(i8 signext %25)
%27 = icmp ne i64 %26, 0
%28 = zext i1 %27 to i32
%29 = add nuw nsw i32 %19, %28
%30 = load i8, i8* %16
%31 = call i64 @isdigit(i8 signext %30)
%32 = icmp ne i64 %31, 0
%33 = zext i1 %32 to i32
%34 = add nuw nsw i32 %18, %33
%35 = load i8, i8* %16
%36 = call i64 @isspace(i8 signext %35)
%37 = icmp ne i64 %36, 0
%38 = zext i1 %37 to i32
%39 = add nuw nsw i32 %17, %38
%40 = add nuw i64 %14, 1
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 0
br i1 %43, label %44, label %13
44: ; preds = %13, %0
%45 = phi i32 [ 0, %0 ], [ %24, %13 ]
%46 = phi i32 [ 0, %0 ], [ %29, %13 ]
%47 = phi i32 [ 0, %0 ], [ %34, %13 ]
%48 = phi i32 [ 0, %0 ], [ %39, %13 ]
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %47)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %48)
ret i32 0
}