#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__ can_print_it(char);
int /*<<< orphan*/ printf(char *, ...);
void print_letters(char arg[], int size) {
  int i = 0;
  for (i = 0; i < size; i++) {
    char ch = arg[i];
    if (can_print_it(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    1193 <print_letters+0x73>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edi
call   1040 <can_print_it@plt>
cmp    $0x0,%rax
je     1180 <print_letters+0x60>
movsbl -0x11(%rbp),%esi
movsbl -0x11(%rbp),%edx
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1185 <print_letters+0x65>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <print_letters+0x1d>
lea    0xe72(%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    117a <print_letters+0x4a>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xeb7(%rip),%r14
xor    %ebx,%ebx
jmp    1159 <print_letters+0x29>
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r12
je     117a <print_letters+0x4a>
movsbl (%r15,%rbx,1),%ebp
mov    %ebp,%edi
call   1050 <can_print_it@plt>
test   %rax,%rax
je     1150 <print_letters+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1150 <print_letters+0x20>
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, 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 = %27, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %30
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 = call i64 @can_print_it(i8 signext %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %11
%21 = load i8, i8* %6
%22 = sext i8 %21 to i32
%23 = load i8, i8* %6
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %24)
br label %26
26: ; preds = %20, %11
br label %27
27: ; preds = %26
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %7
30: ; preds = %7
%31 = 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, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %15
%7 = phi i64 [ 0, %4 ], [ %16, %15 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i64 @can_print_it(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = sext i8 %9 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %13)
br label %15
15: ; preds = %12, %6
%16 = add nuw nsw i64 %7, 1
%17 = icmp eq i64 %16, %5
br i1 %17, label %18, label %6
18: ; preds = %15, %2
%19 = tail call i32 @putchar(i32 10)
ret void
}