#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;
  for (i = 0; string_array[i] != '\0'; i++) {
    char e = string_array[i];
    if ((e >= 'a' && e <= 'z') || (e >= 'A' && e <= 'Z'))
      count += 1;
    printf("%c", e);
  }
  printf("\ncharacter in above string is :%d", count);
  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,-0x414(%rbp)
movslq -0x414(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     121b <main+0xfb>
movslq -0x414(%rbp),%rax
mov    -0x410(%rbp,%rax,1),%al
mov    %al,-0x419(%rbp)
movsbl -0x419(%rbp),%eax
cmp    $0x61,%eax
jl     11c5 <main+0xa5>
movsbl -0x419(%rbp),%eax
cmp    $0x7a,%eax
jle    11e5 <main+0xc5>
movsbl -0x419(%rbp),%eax
cmp    $0x41,%eax
jl     11f4 <main+0xd4>
movsbl -0x419(%rbp),%eax
cmp    $0x5a,%eax
jg     11f4 <main+0xd4>
mov    -0x418(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x418(%rbp)
movsbl -0x419(%rbp),%esi
lea    0xdfe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    1179 <main+0x59>
mov    -0x418(%rbp),%esi
lea    0xddb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%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    0xeaa(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %esi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
adc    $0x0,%ebp
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1160 <main+0x40>
lea    0xe7b(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [34 x i8] c"\0Acharacter in above string is :%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 ], [ %19, %8 ]
%10 = phi i8 [ 49, %0 ], [ %21, %8 ]
%11 = phi i32 [ undef, %0 ], [ %17, %8 ]
%12 = sext i8 %10 to i32
%13 = and i8 %10, -33
%14 = add i8 %13, -65
%15 = icmp ult i8 %14, 26
%16 = zext i1 %15 to i32
%17 = add nsw i32 %11, %16
%18 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
%19 = add nuw i64 %9, 1
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 0
br i1 %22, label %23, label %8
23: ; preds = %8
%24 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}