#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 *, char *);
int strlen(char *);
main(void) {
  char str[] = "Localhost yeah yeah";
  int aux;
  for (aux = 0; aux < strlen(str); aux++) {
    if (str[aux] == ' ') {
      str[aux] = str[aux + 1];
    }
  }
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cmp    %ecx,%eax
jge    11aa <main+0x8a>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x20,%eax
jne    1197 <main+0x77>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x20(%rbp,%rax,1),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x20(%rbp,%rax,1)
jmp    119c <main+0x7c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1155 <main+0x35>
lea    -0x20(%rbp),%rsi
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x686165,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1177 <main+0x57>
xor    %eax,%eax
mov    %rsp,%r14
jmp    1163 <main+0x43>
nopl   (%rax)
mov    %r14,%rdi
call   1030 <strlen@plt>
movslq %eax,%rcx
mov    %rbx,%rax
cmp    %rcx,%rbx
jge    1177 <main+0x57>
lea    0x1(%rax),%rbx
cmpb   $0x20,(%rsp,%rax,1)
jne    1150 <main+0x30>
movzbl 0x1(%rsp,%rax,1),%ecx
mov    %cl,(%rsp,%rax,1)
jmp    1150 <main+0x30>
lea    0xe96(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str = [20 x i8] c"Localhost yeah yeah\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [20 x i8]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %27, %0
%6 = load i32, i32* %3
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %30
10: ; preds = %5
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 32
br i1 %16, label %17, label %26
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %24
store i8 %22, i8* %25
br label %26
26: ; preds = %17, %10
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %5
30: ; preds = %5
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %31)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [20 x i8] c"Localhost yeah yeah\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %0, %14
%6 = phi i64 [ %10, %14 ], [ 0, %0 ]
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
%10 = add nuw nsw i64 %6, 1
br i1 %9, label %11, label %14
11: ; preds = %5
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %10
%13 = load i8, i8* %12
store i8 %13, i8* %7
br label %14
14: ; preds = %5, %11
%15 = call i32 @strlen(i8* %2)
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %10, %16
br i1 %17, label %5, label %18
18: ; preds = %14, %0
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}