#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 stripWhitespace(char *in) {
  char *out;
  for (out = in; in && *in; ++in)
    if (!isspace(*in))
      *out++ = *in;
  *out = '\0';
}


x86 assembly (clang, -O0):
<stripWhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1144 <stripWhitespace+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1154 <stripWhitespace+0x44>
jmp    1196 <stripWhitespace+0x86>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1180 <stripWhitespace+0x70>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1185 <stripWhitespace+0x75>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <stripWhitespace+0x14>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripWhitespace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1154 <stripWhitespace+0x44>
lea    0x1(%r14),%rbx
jmp    113b <stripWhitespace+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1154 <stripWhitespace+0x44>
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1130 <stripWhitespace+0x20>
movzbl -0x1(%rbx),%eax
mov    %al,(%r14)
add    $0x1,%r14
jmp    1130 <stripWhitespace+0x20>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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