#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__ isalpha(char);
void SqueezeString(char *sz) {
  if (!sz)
    return;
  char *curr = sz;
  char *insertpoint = sz;
  while (*curr) {
    if (isalpha(*curr)) {
      *insertpoint = *curr;
      insertpoint++;
      curr++;
    } else {
      curr++;
    }
  }
  *insertpoint = 0;
}


x86 assembly (clang, -O0):
<SqueezeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <SqueezeString+0x1c>
jmp    11a0 <SqueezeString+0x90>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1199 <SqueezeString+0x89>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     1188 <SqueezeString+0x78>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1194 <SqueezeString+0x84>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113c <SqueezeString+0x2c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SqueezeString>:
test   %rdi,%rdi
je     1160 <SqueezeString+0x50>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1155 <SqueezeString+0x45>
lea    0x1(%r14),%rbx
jmp    113b <SqueezeString+0x2b>
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1155 <SqueezeString+0x45>
movsbl %al,%edi
call   1030 <isalpha@plt>
test   %rax,%rax
je     1130 <SqueezeString+0x20>
movzbl -0x1(%rbx),%eax
mov    %al,(%r14)
add    $0x1,%r14
jmp    1130 <SqueezeString+0x20>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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