#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[]) {
  int i = 0;
  for (i = 0; arg[i] != '\0'; 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    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11bc <print_letters+0x8c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
jne    1193 <print_letters+0x63>
movsbl -0xd(%rbp),%edi
call   1040 <isblank@plt>
cmp    $0x0,%rax
je     11a9 <print_letters+0x79>
movsbl -0xd(%rbp),%esi
movsbl -0xd(%rbp),%edx
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ae <print_letters+0x7e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <print_letters+0x1a>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_letters>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1196 <print_letters+0x56>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xea8(%rip),%r14
jmp    1179 <print_letters+0x39>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1196 <print_letters+0x56>
movsbl %al,%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    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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