#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 */
scalar_t__ isalpha(int);
scalar_t__ isblank(int);
int /*<<< orphan*/ printf(char *, ...);
void print_letters(char arg[], int len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    char ch = arg[i];
    if (isalpha((int)ch) || isblank((int)ch)) {
      printf("'%c' ==  %d ", ch, ch);
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_letters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b6 <print_letters+0x86>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
jne    118d <print_letters+0x5d>
movsbl -0x11(%rbp),%edi
call   1040 <isblank@plt>
cmp    $0x0,%rax
je     11a3 <print_letters+0x73>
movsbl -0x11(%rbp),%esi
movsbl -0x11(%rbp),%edx
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a8 <print_letters+0x78>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <print_letters+0x1d>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_letters>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    1196 <print_letters+0x56>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xea7(%rip),%r14
xor    %ebx,%ebx
jmp    1177 <print_letters+0x37>
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
je     1196 <print_letters+0x56>
movsbl (%r15,%rbx,1),%ebp
mov    %ebp,%edi
call   1060 <isalpha@plt>
test   %rax,%rax
jne    1160 <print_letters+0x20>
mov    %ebp,%edi
call   1050 <isblank@plt>
test   %rax,%rax
jne    1160 <print_letters+0x20>
jmp    116e <print_letters+0x2e>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"'%c' == %d \00"
define void @print_letters(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %18
%7 = phi i64 [ 0, %4 ], [ %19, %18 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i64 @isalpha(i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %6
%14 = tail call i64 @isblank(i32 %10)
%15 = icmp eq i64 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13, %6
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %10)
br label %18
18: ; preds = %16, %13
%19 = add nuw nsw i64 %7, 1
%20 = icmp eq i64 %19, %5
br i1 %20, label %21, label %6
21: ; preds = %18, %2
%22 = tail call i32 @putchar(i32 10)
ret void
}