#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 strlen(char *);
void no_multiples(char *string) {
  int i;
  char c[255] = {};
  for (i = 0; i < strlen(string); i++) {
    if (c[string[i]] && string[i] != ' ')
      string[i] = ' ';
    else
      c[string[i]]++;
  }
  return;
}


x86 assembly (clang, -O0):
<no_multiples>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1040 <memset@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x114(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x114(%rbp),%eax
cmp    %ecx,%eax
jge    11e0 <no_multiples+0xc0>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbq (%rax,%rcx,1),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     11af <no_multiples+0x8f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     11af <no_multiples+0x8f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
jmp    11cd <no_multiples+0xad>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbq (%rax,%rcx,1),%rax
mov    -0x110(%rbp,%rax,1),%cl
add    $0x1,%cl
mov    %cl,-0x110(%rbp,%rax,1)
jmp    11d2 <no_multiples+0xb2>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <no_multiples+0x29>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_multiples>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movups %xmm0,0xef(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1030 <strlen@plt>
test   %eax,%eax
jle    11d6 <no_multiples+0xc6>
xor    %ebx,%ebx
jmp    11b9 <no_multiples+0xa9>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%cl
mov    %cl,(%rsp,%rax,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11d6 <no_multiples+0xc6>
movzbl (%r14,%rbx,1),%edx
movsbq %dl,%rax
movzbl (%rsp,%rax,1),%ecx
test   %cl,%cl
je     11a0 <no_multiples+0x90>
cmp    $0x20,%dl
je     11a0 <no_multiples+0x90>
movb   $0x20,(%r14,%rbx,1)
jmp    11a6 <no_multiples+0x96>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @no_multiples(i8* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %24
6: ; preds = %1, %19
%7 = phi i64 [ %20, %19 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i64
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = icmp eq i8 %9, 32
%15 = select i1 %13, i1 true, i1 %14
br i1 %15, label %17, label %16
16: ; preds = %6
store i8 32, i8* %8
br label %19
17: ; preds = %6
%18 = add i8 %12, 1
store i8 %18, i8* %11
br label %19
19: ; preds = %16, %17
%20 = add nuw nsw i64 %7, 1
%21 = tail call i32 @strlen(i8* %0)
%22 = sext i32 %21 to i64
%23 = icmp slt i64 %20, %22
br i1 %23, label %6, label %24
24: ; preds = %19, %1
ret void
}