#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*/ printf(char *, int, ...);
int main() {
  char string_array[1024] = "123fdd";
  int i, count_number = 0, count_char = 0;
  for (i = 0; string_array[i] != '\0'; i++) {
    char e = string_array[i];
    if ((e >= 'a' && e <= 'z') || (e >= 'A' && e <= 'Z'))
      count_char += 1;
    if (e >= '0' && e <= '9')
      count_number += 1;
    printf("%c", e);
  }
  printf("\nchar counts:%d\tnunber counts:%d", count_number, count_char);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
movb   $0x31,-0x410(%rbp)
movb   $0x32,-0x40f(%rbp)
movb   $0x33,-0x40e(%rbp)
movb   $0x66,-0x40d(%rbp)
movb   $0x64,-0x40c(%rbp)
movb   $0x64,-0x40b(%rbp)
movl   $0x0,-0x418(%rbp)
movl   $0x0,-0x41c(%rbp)
movl   $0x0,-0x414(%rbp)
movslq -0x414(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1260 <main+0x140>
movslq -0x414(%rbp),%rax
mov    -0x410(%rbp,%rax,1),%al
mov    %al,-0x41d(%rbp)
movsbl -0x41d(%rbp),%eax
cmp    $0x61,%eax
jl     11d9 <main+0xb9>
movsbl -0x41d(%rbp),%eax
cmp    $0x7a,%eax
jle    11f9 <main+0xd9>
movsbl -0x41d(%rbp),%eax
cmp    $0x41,%eax
jl     1208 <main+0xe8>
movsbl -0x41d(%rbp),%eax
cmp    $0x5a,%eax
jg     1208 <main+0xe8>
mov    -0x41c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x41c(%rbp)
movsbl -0x41d(%rbp),%eax
cmp    $0x30,%eax
jl     1237 <main+0x117>
movsbl -0x41d(%rbp),%eax
cmp    $0x39,%eax
jg     1237 <main+0x117>
mov    -0x418(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x418(%rbp)
movsbl -0x41d(%rbp),%esi
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    118d <main+0x6d>
mov    -0x418(%rbp),%esi
mov    -0x41c(%rbp),%edx
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1040 <memset@plt>
movl   $0x66333231,(%rsp)
lea    0x1(%rsp),%rbx
movw   $0x6464,0x4(%rsp)
mov    $0x31,%al
lea    0xea8(%rip),%r14
xor    %r15d,%r15d
xor    %ebp,%ebp
nopl   (%rax)
movsbl %al,%esi
mov    %esi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
adc    $0x0,%r15d
lea    -0x30(%rsi),%eax
cmp    $0xa,%al
adc    $0x0,%ebp
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1160 <main+0x40>
lea    0xe70(%rip),%rdi
mov    %ebp,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [33 x i8] c"\0Achar counts:%d\09nunber counts:%d\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
store i8 49, i8* %2
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 1
store i8 50, i8* %3
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 2
store i8 51, i8* %4
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 3
store i8 102, i8* %5
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 4
store i8 100, i8* %6
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 5
store i8 100, i8* %7
br label %8
8: ; preds = %0, %8
%9 = phi i64 [ 0, %0 ], [ %24, %8 ]
%10 = phi i8 [ 49, %0 ], [ %26, %8 ]
%11 = phi i32 [ 0, %0 ], [ %18, %8 ]
%12 = phi i32 [ 0, %0 ], [ %22, %8 ]
%13 = sext i8 %10 to i32
%14 = and i8 %10, -33
%15 = add i8 %14, -65
%16 = icmp ult i8 %15, 26
%17 = zext i1 %16 to i32
%18 = add nuw nsw i32 %11, %17
%19 = add i8 %10, -48
%20 = icmp ult i8 %19, 10
%21 = zext i1 %20 to i32
%22 = add nuw nsw i32 %12, %21
%23 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
%24 = add nuw i64 %9, 1
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 0
br i1 %27, label %28, label %8
28: ; preds = %8
%29 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %18)
ret i32 0
}