#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 outline(char *s) {
  while (1) {
    if (*s == 10 || *s == 13 || *s == 0)
      return;
    if (*s == '"')
      putchar('\\');
    if (*s == '\\')
      putchar('\\');
    putchar(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<outline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     114c <outline+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     114c <outline+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1152 <outline+0x42>
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    116c <outline+0x5c>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1186 <outline+0x76>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <outline+0xc>

x86 assembly (clang, -O2):
<outline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
jmp    112c <outline+0x1c>
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x22,%rax
ja     114b <outline+0x3b>
movslq (%r14,%rax,4),%rcx
add    %r14,%rcx
jmp    *%rcx
mov    $0x5c,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
cmp    $0x5c,%al
jne    1120 <outline+0x10>
mov    $0x5c,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
jmp    1120 <outline+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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