#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 *, ...);
void yyprint_str(const char *s) {
  printf("\"");
  for (; *s; ++s) {
    switch (*s) {
    case '"':
    case '\\':
      printf("\\");
      break;
    case '\n':
      printf("\\n");
      continue;
    case '\t':
      printf("\\t");
      continue;
    case '\v':
      printf("\\v");
      continue;
    }
    printf("%c", *s);
  }
  printf("\"");
}


x86 assembly (clang, -O0):
<yyprint_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1205 <yyprint_str+0xf5>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
sub    $0x9,%eax
je     11b9 <yyprint_str+0xa9>
jmp    114f <yyprint_str+0x3f>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
je     11a6 <yyprint_str+0x96>
jmp    1160 <yyprint_str+0x50>
mov    -0xc(%rbp),%eax
sub    $0xb,%eax
je     11cc <yyprint_str+0xbc>
jmp    1171 <yyprint_str+0x61>
mov    -0xc(%rbp),%eax
sub    $0x22,%eax
je     1193 <yyprint_str+0x83>
jmp    1182 <yyprint_str+0x72>
mov    -0xc(%rbp),%eax
sub    $0x5c,%eax
jne    11df <yyprint_str+0xcf>
jmp    1193 <yyprint_str+0x83>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11df <yyprint_str+0xcf>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f4 <yyprint_str+0xe4>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f4 <yyprint_str+0xe4>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f4 <yyprint_str+0xe4>
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112a <yyprint_str+0x1a>
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyprint_str>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%rbx
mov    $0x22,%edi
call   1030 <putchar@plt>
mov    (%rbx),%al
test   %al,%al
je     11af <yyprint_str+0x8f>
add    $0x1,%rbx
lea    0xeb9(%rip),%r13
lea    0xf1d(%rip),%r14
lea    0xf13(%rip),%r15
lea    0xf12(%rip),%r12
jmp    1173 <yyprint_str+0x53>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11af <yyprint_str+0x8f>
movsbl %al,%edi
lea    -0x9(%rdi),%eax
cmp    $0x19,%eax
ja     1190 <yyprint_str+0x70>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
mov    %r14,%rdi
jmp    1161 <yyprint_str+0x41>
nopl   (%rax)
cmp    $0x5c,%edi
jne    11a3 <yyprint_str+0x83>
mov    $0x5c,%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbx),%edi
call   1030 <putchar@plt>
jmp    1168 <yyprint_str+0x48>
mov    %r12,%rdi
jmp    1161 <yyprint_str+0x41>
mov    $0x22,%edi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\22\00"
@.str.1 = [2 x i8] c"\\\00"
@.str.2 = [3 x i8] c"\\n\00"
@.str.3 = [3 x i8] c"\\t\00"
@.str.4 = [3 x i8] c"\\v\00"
@.str.5 = [3 x i8] c"%c\00"
define void @yyprint_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %25, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %28
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
switch i32 %11, label %20 [
i32 34, label %12
i32 92, label %12
i32 10, label %14
i32 9, label %16
i32 11, label %18
]
12: ; preds = %8, %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
14: ; preds = %8
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %25
16: ; preds = %8
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %25
18: ; preds = %8
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %25
20: ; preds = %8, %12
%21 = load i8*, i8** %2
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %20, %18, %16, %14
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %2
br label %4
28: ; preds = %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"\\n\00"
@.str.3 = [3 x i8] c"\\t\00"
@.str.4 = [3 x i8] c"\\v\00"
define void @yyprint_str(i8* nocapture %0) {
%2 = tail call i32 @putchar(i32 34)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %26, label %5
5: ; preds = %1, %22
%6 = phi i8 [ %24, %22 ], [ %3, %1 ]
%7 = phi i8* [ %23, %22 ], [ %0, %1 ]
%8 = sext i8 %6 to i32
switch i32 %8, label %19 [
i32 34, label %9
i32 92, label %9
i32 10, label %13
i32 9, label %15
i32 11, label %17
]
9: ; preds = %5, %5
%10 = tail call i32 @putchar(i32 92)
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
br label %19
13: ; preds = %5
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %22
15: ; preds = %5
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %22
17: ; preds = %5
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %22
19: ; preds = %5, %9
%20 = phi i32 [ %8, %5 ], [ %12, %9 ]
%21 = tail call i32 @putchar(i32 %20)
br label %22
22: ; preds = %19, %17, %15, %13
%23 = getelementptr inbounds i8, i8* %7, i64 1
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %5
26: ; preds = %22, %1
%27 = tail call i32 @putchar(i32 34)
ret void
}