#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*/ putchar(char);
void PrintStr(char *cString) {
  int i;
  i = 0;
  while (cString[i]) {
    if (cString[i] == 0x20)
      putchar('\\');
    putchar(cString[i]);
    i++;
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<PrintStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1173 <PrintStr+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1154 <PrintStr+0x44>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <PrintStr+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintStr>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <PrintStr+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0x5c,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x20,%al
je     1120 <PrintStr+0x10>
test   %al,%al
jne    112d <PrintStr+0x1d>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @PrintStr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %21, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %30
11: ; preds = %4
%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 i32
%18 = icmp eq i32 %17, 32
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = call i32 @putchar(i8 signext 92)
br label %21
21: ; preds = %19, %11
%22 = load i8*, i8** %2
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = call i32 @putchar(i8 signext %26)
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %4
30: ; preds = %4
%31 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @PrintStr(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %12, %9 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %9 [
i8 0, label %13
i8 32, label %6
]
6: ; preds = %2
%7 = tail call i32 @putchar(i8 signext 92)
%8 = load i8, i8* %4
br label %9
9: ; preds = %2, %6
%10 = phi i8 [ %5, %2 ], [ %8, %6 ]
%11 = tail call i32 @putchar(i8 signext %10)
%12 = add nuw i64 %3, 1
br label %2
13: ; preds = %2
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}