#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__ isspace(unsigned char);
int removeWhitespace_execute(unsigned char *input, long int input_len,
                             unsigned char *changed) {
  long int i, j;
  changed[0] = '0';
  i = j = 0;
  while (i < input_len) {
    if (isspace(input[i]) || (input[i] == 160)) {
      changed[0] = '1';
    } else {
      input[j] = input[i];
      j++;
    }
    i++;
  }
  return j;
}


x86 assembly (clang, -O0):
<removeWhitespace_execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x30,(%rax)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    11ba <removeWhitespace_execute+0xaa>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    117b <removeWhitespace_execute+0x6b>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0xa0,%eax
jne    1187 <removeWhitespace_execute+0x77>
mov    -0x18(%rbp),%rax
movb   $0x31,(%rax)
jmp    11a9 <removeWhitespace_execute+0x99>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113b <removeWhitespace_execute+0x2b>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeWhitespace_execute>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
movb   $0x30,(%rdx)
test   %rsi,%rsi
jle    1172 <removeWhitespace_execute+0x62>
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
xor    %r14d,%r14d
xor    %ebx,%ebx
jmp    114d <removeWhitespace_execute+0x3d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movb   $0x31,(%r15)
add    $0x1,%rbx
cmp    %rbx,%r12
je     1175 <removeWhitespace_execute+0x65>
movzbl 0x0(%r13,%rbx,1),%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1140 <removeWhitespace_execute+0x30>
movzbl 0x0(%r13,%rbx,1),%eax
cmp    $0xa0,%al
je     1140 <removeWhitespace_execute+0x30>
mov    %al,0x0(%r13,%r14,1)
add    $0x1,%r14
jmp    1144 <removeWhitespace_execute+0x34>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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