#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*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ scanf(char *, char *);
void ReadAndEditStr(char *Str, int StringSize) {
  char Aux;
  int i = 0;
  memset(Str, 0, StringSize);
  while (Aux != '\n') {
    scanf("%c", &Aux);
    if ((Aux != ' ') & (Aux != '\t') & (Aux != '\r') & (Aux != '\n')) {
      Str[i] = Aux;
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<ReadAndEditStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
movsbl -0xd(%rbp),%eax
cmp    $0xa,%eax
je     11cb <ReadAndEditStr+0xab>
lea    0xea8(%rip),%rdi
lea    -0xd(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0xd(%rbp),%eax
cmp    $0x20,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0xd(%rbp),%ecx
cmp    $0x9,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
movsbl -0xd(%rbp),%ecx
cmp    $0xd,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
movsbl -0xd(%rbp),%ecx
cmp    $0xa,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     11c6 <ReadAndEditStr+0xa6>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <ReadAndEditStr+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadAndEditStr>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %esi,%edx
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xebe(%rip),%r15
lea    0xf(%rsp),%r12
movabs $0x100002600,%r13
jmp    1174 <ReadAndEditStr+0x54>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq %ebx,%rbx
mov    %al,(%r14,%rbx,1)
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
cmp    $0xa,%al
je     1192 <ReadAndEditStr+0x72>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
movzbl 0xf(%rsp),%eax
cmp    $0x20,%rax
ja     1160 <ReadAndEditStr+0x40>
bt     %rax,%r13
jb     1170 <ReadAndEditStr+0x50>
jmp    1160 <ReadAndEditStr+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @ReadAndEditStr(i8* %0, i32 %1) {
%3 = alloca i8
%4 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
br label %5
5: ; preds = %2, %13
%6 = phi i32 [ %14, %13 ], [ 0, %2 ]
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%8 = load i8, i8* %3
switch i8 %8, label %9 [
i8 32, label %13
i8 13, label %13
i8 10, label %13
i8 9, label %13
]
9: ; preds = %5
%10 = sext i32 %6 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %8, i8* %11
%12 = add nsw i32 %6, 1
br label %13
13: ; preds = %5, %5, %5, %5, %9
%14 = phi i32 [ %12, %9 ], [ %6, %5 ], [ %6, %5 ], [ %6, %5 ], [ %6, %5 ]
%15 = icmp eq i8 %8, 10
br i1 %15, label %16, label %5
16: ; preds = %13
ret void
}