#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);
char toupper(char);
void remove_spaces_and_slashes(char *string) {
  char *p1 = string, *p2 = string;
  while (*p2 != '\0') {
    if (!isspace(*p2) && *p2 != '/') {
      *p1 = *p2;
      p1++;
    } else {
      *(p2 + 1) = toupper(*(p2 + 1));
    }
    p2++;
  }
  *p1 = '\0';
  return;
}


x86 assembly (clang, -O0):
<remove_spaces_and_slashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11b5 <remove_spaces_and_slashes+0x95>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
jne    118e <remove_spaces_and_slashes+0x6e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     118e <remove_spaces_and_slashes+0x6e>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    11a4 <remove_spaces_and_slashes+0x84>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113c <remove_spaces_and_slashes+0x1c>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_spaces_and_slashes>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1172 <remove_spaces_and_slashes+0x52>
lea    0x1(%r14),%rbx
jmp    1152 <remove_spaces_and_slashes+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
je     1172 <remove_spaces_and_slashes+0x52>
movsbl %al,%edi
call   1040 <isspace@plt>
test   %eax,%eax
jne    1140 <remove_spaces_and_slashes+0x20>
movzbl -0x1(%rbx),%eax
cmp    $0x2f,%al
je     1140 <remove_spaces_and_slashes+0x20>
mov    %al,(%r14)
add    $0x1,%r14
movzbl (%rbx),%eax
jmp    114a <remove_spaces_and_slashes+0x2a>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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