#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*/ printf(char *, ...);
void removewhitespace(const char *rawcode, char *purecode) {
  printf("Removing whitespace.\n");
  char *pos = rawcode;
  int right, left;
  while (*pos != '\n') {
    switch ((int)pos) {
      printf("%i\n", (int)pos);
    case ' ':
      pos++;
      break;
    default:
      *purecode++ = *pos++;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<removewhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     118f <removewhitespace+0x7f>
mov    -0x18(%rbp),%eax
sub    $0x20,%eax
jne    1168 <removewhitespace+0x58>
jmp    1157 <removewhitespace+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    118a <removewhitespace+0x7a>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1136 <removewhitespace+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removewhitespace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%cl
cmp    $0xa,%cl
jne    1136 <removewhitespace+0x26>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x20,%eax
sub    %r14d,%eax
xor    %edx,%edx
jmp    115f <removewhitespace+0x4f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%r14,%rdx,1),%ecx
add    $0x1,%rdx
cmp    $0xa,%cl
je     112e <removewhitespace+0x1e>
cmp    %edx,%eax
je     1150 <removewhitespace+0x40>
mov    %cl,(%rbx)
add    $0x1,%rbx
jmp    1150 <removewhitespace+0x40>

LLVM IR (-O0):
@.str = [22 x i8] c"Removing whitespace.\0A\00"
define void @removewhitespace(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %3
store i8* %9, i8** %5
br label %10
10: ; preds = %27, %2
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %28
15: ; preds = %10
%16 = load i8*, i8** %5
%17 = ptrtoint i8* %16 to i32
switch i32 %17, label %21 [
i32 32, label %18
]
18: ; preds = %15
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %5
br label %27
21: ; preds = %15
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %5
%24 = load i8, i8* %22
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %4
store i8 %24, i8* %25
br label %27
27: ; preds = %21, %18
br label %10
28: ; preds = %10
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Removing whitespace.\00"
define void @removewhitespace(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 10
br i1 %5, label %20, label %6
6: ; preds = %2, %15
%7 = phi i8 [ %18, %15 ], [ %4, %2 ]
%8 = phi i8* [ %16, %15 ], [ %1, %2 ]
%9 = phi i8* [ %17, %15 ], [ %0, %2 ]
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %15, label %13
13: ; preds = %6
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %8
br label %15
15: ; preds = %6, %13
%16 = phi i8* [ %14, %13 ], [ %8, %6 ]
%17 = getelementptr inbounds i8, i8* %9, i64 1
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 10
br i1 %19, label %20, label %6
20: ; preds = %15, %2
ret void
}