#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(char);
scalar_t__ isblank(char);
int /*<<< orphan*/ printf(char *, ...);
void print_letters(char arg[], size_t len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    char ch = arg[i];
    if (isalpha(ch) || isblank(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    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11b9 <print_letters+0x89>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
jne    1190 <print_letters+0x60>
movsbl -0x15(%rbp),%edi
call   1040 <isblank@plt>
cmp    $0x0,%rax
je     11a6 <print_letters+0x76>
movsbl -0x15(%rbp),%esi
movsbl -0x15(%rbp),%edx
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ab <print_letters+0x7b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <print_letters+0x1e>
lea    0xe4c(%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   %rsi,%rsi
je     1196 <print_letters+0x56>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xea6(%rip),%r15
xor    %ebx,%ebx
jmp    1177 <print_letters+0x37>
xchg   %ax,%ax
mov    %r15,%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 (%r14,%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 = [12 x i8] c"'%c' == %d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_letters(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %7
7: ; preds = %32, %2
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %35
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
store i8 %17, i8* %6
%18 = load i8, i8* %6
%19 = call i64 @isalpha(i8 signext %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %12
%22 = load i8, i8* %6
%23 = call i64 @isblank(i8 signext %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %31
25: ; preds = %21, %12
%26 = load i8, i8* %6
%27 = sext i8 %26 to i32
%28 = load i8, i8* %6
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %29)
br label %31
31: ; preds = %25, %21
br label %32
32: ; preds = %31
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %7
35: ; preds = %7
%36 = 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 = [12 x i8] c"'%c' == %d \00"
define void @print_letters(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %19, label %4
4: ; preds = %2, %16
%5 = phi i64 [ %17, %16 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i64 @isalpha(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = tail call i64 @isblank(i8 signext %7)
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10, %4
%14 = sext i8 %7 to i32
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %14)
br label %16
16: ; preds = %13, %10
%17 = add nuw i64 %5, 1
%18 = icmp eq i64 %17, %1
br i1 %18, label %19, label %4
19: ; preds = %16, %2
%20 = tail call i32 @putchar(i32 10)
ret void
}