#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 *, ...);
int strlen(char *);
void print_letters(char *arg) {
  int i = 0;
  for (i = 0; i < strlen(arg); 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)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    11d3 <print_letters+0x93>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%edi
call   1060 <isalpha@plt>
cmp    $0x0,%rax
jne    11aa <print_letters+0x6a>
movsbl -0xd(%rbp),%edi
call   1050 <isblank@plt>
cmp    $0x0,%rax
je     11c0 <print_letters+0x80>
movsbl -0xd(%rbp),%esi
movsbl -0xd(%rbp),%edx
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11c5 <print_letters+0x85>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115a <print_letters+0x1a>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_letters>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    11b0 <print_letters+0x60>
lea    0xe96(%rip),%r14
xor    %ebx,%ebx
jmp    1191 <print_letters+0x41>
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11b0 <print_letters+0x60>
movsbl (%r15,%rbx,1),%ebp
mov    %ebp,%edi
call   1070 <isalpha@plt>
test   %rax,%rax
jne    1170 <print_letters+0x20>
mov    %ebp,%edi
call   1060 <isblank@plt>
test   %rax,%rax
jne    1170 <print_letters+0x20>
jmp    117e <print_letters+0x2e>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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