#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 isspace(char);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void RemoveWhiteSpaces(char *pcLine) {
  int iSrcLength;
  int iSrcCounter;
  int isWhiteSpace;
  int iDestCounter;
  char pcStrippedString[(132)];
  iSrcCounter = 0;
  iSrcLength = (int)(strlen(pcLine) + 1);
  iDestCounter = 0;
  if (pcLine != NULL) {
    while (iSrcCounter < iSrcLength) {
      isWhiteSpace = isspace(pcLine[iSrcCounter]);
      if (isWhiteSpace == 0) {
        pcStrippedString[iDestCounter] = pcLine[iSrcCounter];
        iDestCounter++;
      }
      iSrcCounter++;
    }
    strcpy(pcLine, pcStrippedString);
  }
}


x86 assembly (clang, -O0):
<RemoveWhiteSpaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11d4 <RemoveWhiteSpaces+0xa4>
jmp    116d <RemoveWhiteSpaces+0x3d>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c4 <RemoveWhiteSpaces+0x94>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <isspace@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11b6 <RemoveWhiteSpaces+0x86>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x18(%rbp),%rax
mov    %cl,-0xa0(%rbp,%rax,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116d <RemoveWhiteSpaces+0x3d>
mov    -0x8(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RemoveWhiteSpaces>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %r15,%r15
je     1194 <RemoveWhiteSpaces+0x64>
cmp    $0x7ffffffe,%eax
ja     1189 <RemoveWhiteSpaces+0x59>
add    $0x1,%rax
mov    %eax,%r14d
xor    %ebx,%ebx
xor    %r12d,%r12d
jmp    1169 <RemoveWhiteSpaces+0x39>
add    $0x1,%rbx
cmp    %rbx,%r14
je     1189 <RemoveWhiteSpaces+0x59>
movsbl (%r15,%rbx,1),%edi
call   1050 <isspace@plt>
test   %eax,%eax
jne    1160 <RemoveWhiteSpaces+0x30>
movzbl (%r15,%rbx,1),%eax
movslq %r12d,%r12
mov    %al,(%rsp,%r12,1)
add    $0x1,%r12d
jmp    1160 <RemoveWhiteSpaces+0x30>
mov    %rsp,%rsi
mov    %r15,%rdi
call   1030 <strcpy@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @RemoveWhiteSpaces(i8* %0) {
%2 = alloca [132 x i8]
%3 = getelementptr inbounds [132 x i8], [132 x i8]* %2, i64 0, i64 0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = add i64 %4, 1
%6 = icmp eq i8* %0, null
br i1 %6, label %30, label %7
7: ; preds = %1
%8 = trunc i64 %4 to i32
%9 = icmp ult i32 %8, 2147483647
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = and i64 %5, 4294967295
br label %12
12: ; preds = %10, %24
%13 = phi i64 [ 0, %10 ], [ %26, %24 ]
%14 = phi i32 [ 0, %10 ], [ %25, %24 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %13
%16 = load i8, i8* %15
%17 = tail call i32 @isspace(i8 signext %16)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %12
%20 = load i8, i8* %15
%21 = sext i32 %14 to i64
%22 = getelementptr inbounds [132 x i8], [132 x i8]* %2, i64 0, i64 %21
store i8 %20, i8* %22
%23 = add nsw i32 %14, 1
br label %24
24: ; preds = %19, %12
%25 = phi i32 [ %23, %19 ], [ %14, %12 ]
%26 = add nuw nsw i64 %13, 1
%27 = icmp eq i64 %26, %11
br i1 %27, label %28, label %12
28: ; preds = %24, %7
%29 = call i32 @strcpy(i8* %0, i8* %3)
br label %30
30: ; preds = %28, %1
ret void
}