#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);
char tolower(char);
void removeCaseAndPunctuation(char line[], char formattedLine[]) {
  int indLine, indFormatted;
  for (indLine = 0, indFormatted = 0; line[indLine] != '\0'; indLine++)
    if (isalpha(line[indLine])) {
      formattedLine[indFormatted] = tolower(line[indLine]);
      indFormatted++;
    }
  formattedLine[indFormatted] = '\0';
}


x86 assembly (clang, -O0):
<removeCaseAndPunctuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11a8 <removeCaseAndPunctuation+0x88>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     1195 <removeCaseAndPunctuation+0x75>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    119a <removeCaseAndPunctuation+0x7a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <removeCaseAndPunctuation+0x1e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeCaseAndPunctuation>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    (%rdi),%al
test   %al,%al
je     116e <removeCaseAndPunctuation+0x4e>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %r15d,%r15d
jmp    114b <removeCaseAndPunctuation+0x2b>
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1171 <removeCaseAndPunctuation+0x51>
movsbl %al,%edi
call   1040 <isalpha@plt>
test   %rax,%rax
je     1140 <removeCaseAndPunctuation+0x20>
movsbl -0x1(%rbx),%edi
call   1030 <tolower@plt>
movslq %r15d,%r15
mov    %al,(%r14,%r15,1)
add    $0x1,%r15d
jmp    1140 <removeCaseAndPunctuation+0x20>
xor    %r15d,%r15d
movslq %r15d,%rax
movb   $0x0,(%r14,%rax,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @removeCaseAndPunctuation(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %37, %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %40
15: ; preds = %7
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = call i64 @isalpha(i8 signext %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %36
23: ; preds = %15
%24 = load i8*, i8** %3
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = call signext i8 @tolower(i8 signext %28)
%30 = load i8*, i8** %4
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
store i8 %29, i8* %33
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %36
36: ; preds = %23, %15
br label %37
37: ; preds = %36
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %7
40: ; preds = %7
%41 = load i8*, i8** %4
%42 = load i32, i32* %6
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %41, i64 %43
store i8 0, i8* %44
ret void
}

LLVM IR (-O2):
define void @removeCaseAndPunctuation(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %24, label %5
5: ; preds = %2, %18
%6 = phi i64 [ %20, %18 ], [ 0, %2 ]
%7 = phi i8 [ %22, %18 ], [ %3, %2 ]
%8 = phi i8* [ %21, %18 ], [ %0, %2 ]
%9 = phi i32 [ %19, %18 ], [ 0, %2 ]
%10 = tail call i64 @isalpha(i8 signext %7)
%11 = icmp eq i64 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %5
%13 = load i8, i8* %8
%14 = tail call signext i8 @tolower(i8 signext %13)
%15 = sext i32 %9 to i64
%16 = getelementptr inbounds i8, i8* %1, i64 %15
store i8 %14, i8* %16
%17 = add nsw i32 %9, 1
br label %18
18: ; preds = %5, %12
%19 = phi i32 [ %17, %12 ], [ %9, %5 ]
%20 = add nuw i64 %6, 1
%21 = getelementptr inbounds i8, i8* %0, i64 %20
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %5
24: ; preds = %18, %2
%25 = phi i32 [ 0, %2 ], [ %19, %18 ]
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %1, i64 %26
store i8 0, i8* %27
ret void
}