#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 printParamS(const char *str) {
  size_t i;
  putchar(' ');
  putchar('"');
  for (i = 0; str[i] != '\0'; ++i) {
    char c = str[i];
    if (c == '"' || c == '\\')
      putchar('\\');
    putchar(c);
  }
  putchar('"');
}


x86 assembly (clang, -O0):
<printParamS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x22,%edi
call   1030 <putchar@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1199 <printParamS+0x89>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x22,%eax
je     1175 <printParamS+0x65>
movsbl -0x11(%rbp),%eax
cmp    $0x5c,%eax
jne    117f <printParamS+0x6f>
mov    $0x5c,%edi
call   1030 <putchar@plt>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <printParamS+0x28>
mov    $0x22,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printParamS>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x22,%edi
call   1030 <putchar@plt>
jmp    1146 <printParamS+0x36>
nopl   (%rax)
mov    $0x5c,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
movzbl (%r14),%ebx
cmp    $0x22,%bl
je     1130 <printParamS+0x20>
cmp    $0x5c,%bl
je     1130 <printParamS+0x20>
test   %bl,%bl
jne    113a <printParamS+0x2a>
mov    $0x22,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

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