#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*/ isspace(char);
void eraseWhiteSpace(char *s) {
  char *in, *out;
  char c;
  in = out = s;
  for (;;) {
    c = *in++;
    if (c == 0)
      break;
    if (!isspace(c))
      *out++ = c;
  }
  *out++ = 0;
}


x86 assembly (clang, -O0):
<eraseWhiteSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x0,%eax
jne    114e <eraseWhiteSpace+0x3e>
jmp    1179 <eraseWhiteSpace+0x69>
movsbl -0x19(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1174 <eraseWhiteSpace+0x64>
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1128 <eraseWhiteSpace+0x18>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eraseWhiteSpace>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%bpl
test   %bpl,%bpl
je     1152 <eraseWhiteSpace+0x42>
lea    0x1(%r14),%rbx
jmp    113c <eraseWhiteSpace+0x2c>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rbx),%ebp
add    $0x1,%rbx
test   %bpl,%bpl
je     1152 <eraseWhiteSpace+0x42>
movsbl %bpl,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1130 <eraseWhiteSpace+0x20>
mov    %bpl,(%r14)
add    $0x1,%r14
jmp    1130 <eraseWhiteSpace+0x20>
movb   $0x0,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @eraseWhiteSpace(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %4
store i8* %6, i8** %3
br label %7
7: ; preds = %23, %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = load i8, i8* %8
store i8 %10, i8* %5
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %7
br label %24
15: ; preds = %7
%16 = load i8, i8* %5
%17 = call i32 @isspace(i8 signext %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %5
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
store i8 %20, i8* %21
br label %23
23: ; preds = %19, %15
br label %7
24: ; preds = %14
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %4
store i8 0, i8* %25
ret void
}

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