#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 */
int /*<<< orphan*/ is_alphabetic(char);
void remove_non_alphabetic_chars(char *seq, size_t len) {
  for (int i = 0; i < len; i++) {
    if (!is_alphabetic(seq[i])) {
      seq[i] = ' ';
    }
  }
}


x86 assembly (clang, -O0):
<remove_non_alphabetic_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116e <remove_non_alphabetic_chars+0x5e>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <is_alphabetic@plt>
cmp    $0x0,%eax
jne    115b <remove_non_alphabetic_chars+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
jmp    1160 <remove_non_alphabetic_chars+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <remove_non_alphabetic_chars+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_non_alphabetic_chars>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     114e <remove_non_alphabetic_chars+0x3e>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
jmp    1139 <remove_non_alphabetic_chars+0x29>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %rbx,%r14
je     114e <remove_non_alphabetic_chars+0x3e>
movsbl (%r15,%rbx,1),%edi
call   1030 <is_alphabetic@plt>
test   %eax,%eax
jne    1130 <remove_non_alphabetic_chars+0x20>
movb   $0x20,(%r15,%rbx,1)
jmp    1130 <remove_non_alphabetic_chars+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @remove_non_alphabetic_chars(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %2
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %6
%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
%17 = call i32 @is_alphabetic(i8 signext %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %24, label %19
19: ; preds = %11
%20 = load i8*, i8** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 32, i8* %23
br label %24
24: ; preds = %19, %11
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @remove_non_alphabetic_chars(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %12, %2
ret void
5: ; preds = %2, %12
%6 = phi i64 [ %13, %12 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @is_alphabetic(i8 signext %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %5
store i8 32, i8* %7
br label %12
12: ; preds = %5, %11
%13 = add nuw i64 %6, 1
%14 = icmp eq i64 %13, %1
br i1 %14, label %4, label %5
}