#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*/ assert(int);
int /*<<< orphan*/ escape_string(char *);
scalar_t__ strcmp(char *, int /*<<< orphan*/);
void example__escape_string(void) {
  assert(strcmp("abc", escape_string("\"abc\"")) == 0);
  assert(strcmp("ab'c", escape_string("\"ab'c\"")) == 0);
  assert(strcmp("abc", escape_string("'abc'")) == 0);
  assert(strcmp(" \\\"abc", escape_string("\" \"abc\"")) == 0);
  assert(strcmp("", escape_string("\"\"")) == 0);
  assert(strcmp("", escape_string("''")) == 0);
  assert(strcmp("'", escape_string("'\\''")) == 0);
  assert(strcmp("\\'", escape_string("\"\\'\"")) == 0);
  assert(strcmp("\\\"", escape_string("\"\\\"\"")) == 0);
  assert(strcmp("\n", escape_string("'\n'")) == 0);
  assert(strcmp("t00/automagicref.n:76:10",
                escape_string("\"t00/automagicref.n:76:10\"")) == 0);
  assert(strcmp("abc", escape_string("abc")) == 0);
  assert(strcmp("ab'c", escape_string("ab'c")) == 0);
  assert(strcmp("abc", escape_string("'abc'")) == 0);
  assert(strcmp(" \\\"abc", escape_string(" \"abc")) == 0);
  assert(strcmp("", escape_string("")) == 0);
  assert(strcmp("", escape_string("''")) == 0);
  assert(strcmp("'", escape_string("'\\''")) == 0);
  assert(strcmp("\\'", escape_string("\\'")) == 0);
  assert(strcmp("\\\"", escape_string("\"")) == 0);
  assert(strcmp("\\\\\"", escape_string("\\\"")) == 0);
  assert(strcmp("\n", escape_string("'\n'")) == 0);
  assert(strcmp("t00/automagicref.n:76:10",
                escape_string("t00/automagicref.n:76:10")) == 0);
}


x86 assembly (clang, -O0):
<example__escape_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xee0(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xf26(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe9f(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe7b(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xed0(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe5d(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xe48(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe49(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xe3f(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe11(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xe14(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xde4(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xdec(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdc1(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xdb0(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xd9b(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xdd3(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xd77(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xd67(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xd69(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xd42(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xd5b(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xd4d(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xcc1(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xcb3(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xca2(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xcf7(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xcd8(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xc6f(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xc74(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xc66(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xc38(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xc3b(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xc0b(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xc13(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xbe5(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xbd7(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xbc5(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xbfa(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xbdd(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xbce(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xb73(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xb63(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xb4c(%rip),%rdi
call   1050 <escape_string@plt>
mov    %eax,%esi
lea    0xb3e(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<example__escape_string>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed9(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xf21(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe98(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xe87(%rip),%r15
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe74(%rip),%rdi
call   1050 <escape_string@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe5d(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xe4a(%rip),%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe4c(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xe44(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe14(%rip),%rdi
call   1050 <escape_string@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xdee(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xdf8(%rip),%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xdce(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xdbf(%rip),%r12
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xda8(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xde2(%rip),%rbp
mov    %rbp,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xd84(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xd76(%rip),%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xd79(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xd54(%rip),%r13
mov    %r13,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %r14,%rdi
call   1050 <escape_string@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %r15,%rdi
call   1050 <escape_string@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xcc8(%rip),%rdi
call   1050 <escape_string@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xd05(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xc9e(%rip),%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <escape_string@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xc73(%rip),%rdi
call   1050 <escape_string@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xc4d(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xc57(%rip),%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %r12,%rdi
call   1050 <escape_string@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xc15(%rip),%rdi
call   1050 <escape_string@plt>
mov    %rbp,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbp,%rdi
call   1050 <escape_string@plt>
lea    0xc2b(%rip),%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xbd1(%rip),%rdi
call   1050 <escape_string@plt>
lea    0xbc3(%rip),%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %r13,%rdi
call   1050 <escape_string@plt>
mov    %r13,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [6 x i8] c"\22abc\22\00"
@.str.2 = [5 x i8] c"ab'c\00"
@.str.3 = [7 x i8] c"\22ab'c\22\00"
@.str.4 = [6 x i8] c"'abc'\00"
@.str.5 = [7 x i8] c" \\\22abc\00"
@.str.6 = [8 x i8] c"\22 \22abc\22\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [3 x i8] c"\22\22\00"
@.str.9 = [3 x i8] c"''\00"
@.str.10 = [2 x i8] c"'\00"
@.str.11 = [5 x i8] c"'\\''\00"
@.str.12 = [3 x i8] c"\\'\00"
@.str.13 = [5 x i8] c"\22\\'\22\00"
@.str.14 = [3 x i8] c"\\\22\00"
@.str.15 = [5 x i8] c"\22\\\22\22\00"
@.str.16 = [2 x i8] c"\0A\00"
@.str.17 = [4 x i8] c"'\0A'\00"
@.str.18 = [25 x i8] c"t00/automagicref.n:76:10\00"
@.str.19 = [27 x i8] c"\22t00/automagicref.n:76:10\22\00"
@.str.20 = [6 x i8] c" \22abc\00"
@.str.21 = [2 x i8] c"\22\00"
@.str.22 = [4 x i8] c"\\\\\22\00"
define void @example__escape_string() {
%1 = call i32 @escape_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @escape_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%7 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @escape_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%12 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i32 @escape_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%17 = call i64 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = icmp eq i64 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @escape_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%22 = call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 %21)
%23 = icmp eq i64 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i32 @escape_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%27 = call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 %26)
%28 = icmp eq i64 %27, 0
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call i32 @escape_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%32 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 %31)
%33 = icmp eq i64 %32, 0
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = call i32 @escape_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%37 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32 %36)
%38 = icmp eq i64 %37, 0
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i32 @escape_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%42 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %41)
%43 = icmp eq i64 %42, 0
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = call i32 @escape_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%47 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i32 %46)
%48 = icmp eq i64 %47, 0
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = call i32 @escape_string(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0))
%52 = call i64 @strcmp(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 %51)
%53 = icmp eq i64 %52, 0
%54 = zext i1 %53 to i32
%55 = call i32 @assert(i32 %54)
%56 = call i32 @escape_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%57 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %56)
%58 = icmp eq i64 %57, 0
%59 = zext i1 %58 to i32
%60 = call i32 @assert(i32 %59)
%61 = call i32 @escape_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%62 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %61)
%63 = icmp eq i64 %62, 0
%64 = zext i1 %63 to i32
%65 = call i32 @assert(i32 %64)
%66 = call i32 @escape_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%67 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %66)
%68 = icmp eq i64 %67, 0
%69 = zext i1 %68 to i32
%70 = call i32 @assert(i32 %69)
%71 = call i32 @escape_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0))
%72 = call i64 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %71)
%73 = icmp eq i64 %72, 0
%74 = zext i1 %73 to i32
%75 = call i32 @assert(i32 %74)
%76 = call i32 @escape_string(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0))
%77 = call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 %76)
%78 = icmp eq i64 %77, 0
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = call i32 @escape_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%82 = call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 %81)
%83 = icmp eq i64 %82, 0
%84 = zext i1 %83 to i32
%85 = call i32 @assert(i32 %84)
%86 = call i32 @escape_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%87 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 %86)
%88 = icmp eq i64 %87, 0
%89 = zext i1 %88 to i32
%90 = call i32 @assert(i32 %89)
%91 = call i32 @escape_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%92 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32 %91)
%93 = icmp eq i64 %92, 0
%94 = zext i1 %93 to i32
%95 = call i32 @assert(i32 %94)
%96 = call i32 @escape_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
%97 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %96)
%98 = icmp eq i64 %97, 0
%99 = zext i1 %98 to i32
%100 = call i32 @assert(i32 %99)
%101 = call i32 @escape_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%102 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i64 0, i64 0), i32 %101)
%103 = icmp eq i64 %102, 0
%104 = zext i1 %103 to i32
%105 = call i32 @assert(i32 %104)
%106 = call i32 @escape_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%107 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i32 %106)
%108 = icmp eq i64 %107, 0
%109 = zext i1 %108 to i32
%110 = call i32 @assert(i32 %109)
%111 = call i32 @escape_string(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0))
%112 = call i64 @strcmp(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 %111)
%113 = icmp eq i64 %112, 0
%114 = zext i1 %113 to i32
%115 = call i32 @assert(i32 %114)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [6 x i8] c"\22abc\22\00"
@.str.2 = [5 x i8] c"ab'c\00"
@.str.3 = [7 x i8] c"\22ab'c\22\00"
@.str.4 = [6 x i8] c"'abc'\00"
@.str.5 = [7 x i8] c" \\\22abc\00"
@.str.6 = [8 x i8] c"\22 \22abc\22\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [3 x i8] c"\22\22\00"
@.str.9 = [3 x i8] c"''\00"
@.str.10 = [2 x i8] c"'\00"
@.str.11 = [5 x i8] c"'\\''\00"
@.str.12 = [3 x i8] c"\\'\00"
@.str.13 = [5 x i8] c"\22\\'\22\00"
@.str.14 = [3 x i8] c"\\\22\00"
@.str.15 = [5 x i8] c"\22\\\22\22\00"
@.str.16 = [2 x i8] c"\0A\00"
@.str.17 = [4 x i8] c"'\0A'\00"
@.str.18 = [25 x i8] c"t00/automagicref.n:76:10\00"
@.str.19 = [27 x i8] c"\22t00/automagicref.n:76:10\22\00"
@.str.20 = [6 x i8] c" \22abc\00"
@.str.21 = [2 x i8] c"\22\00"
@.str.22 = [4 x i8] c"\\\\\22\00"
define void @example__escape_string() {
%1 = tail call i32 @escape_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @escape_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @escape_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = tail call i32 @escape_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%17 = tail call i64 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = icmp eq i64 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @escape_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%22 = tail call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 %21)
%23 = icmp eq i64 %22, 0
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
%26 = tail call i32 @escape_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%27 = tail call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 %26)
%28 = icmp eq i64 %27, 0
%29 = zext i1 %28 to i32
%30 = tail call i32 @assert(i32 %29)
%31 = tail call i32 @escape_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%32 = tail call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 %31)
%33 = icmp eq i64 %32, 0
%34 = zext i1 %33 to i32
%35 = tail call i32 @assert(i32 %34)
%36 = tail call i32 @escape_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%37 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32 %36)
%38 = icmp eq i64 %37, 0
%39 = zext i1 %38 to i32
%40 = tail call i32 @assert(i32 %39)
%41 = tail call i32 @escape_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%42 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %41)
%43 = icmp eq i64 %42, 0
%44 = zext i1 %43 to i32
%45 = tail call i32 @assert(i32 %44)
%46 = tail call i32 @escape_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%47 = tail call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i32 %46)
%48 = icmp eq i64 %47, 0
%49 = zext i1 %48 to i32
%50 = tail call i32 @assert(i32 %49)
%51 = tail call i32 @escape_string(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0))
%52 = tail call i64 @strcmp(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 %51)
%53 = icmp eq i64 %52, 0
%54 = zext i1 %53 to i32
%55 = tail call i32 @assert(i32 %54)
%56 = tail call i32 @escape_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%57 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %56)
%58 = icmp eq i64 %57, 0
%59 = zext i1 %58 to i32
%60 = tail call i32 @assert(i32 %59)
%61 = tail call i32 @escape_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%62 = tail call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %61)
%63 = icmp eq i64 %62, 0
%64 = zext i1 %63 to i32
%65 = tail call i32 @assert(i32 %64)
%66 = tail call i32 @escape_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%67 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %66)
%68 = icmp eq i64 %67, 0
%69 = zext i1 %68 to i32
%70 = tail call i32 @assert(i32 %69)
%71 = tail call i32 @escape_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0))
%72 = tail call i64 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %71)
%73 = icmp eq i64 %72, 0
%74 = zext i1 %73 to i32
%75 = tail call i32 @assert(i32 %74)
%76 = tail call i32 @escape_string(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0))
%77 = tail call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 %76)
%78 = icmp eq i64 %77, 0
%79 = zext i1 %78 to i32
%80 = tail call i32 @assert(i32 %79)
%81 = tail call i32 @escape_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%82 = tail call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 %81)
%83 = icmp eq i64 %82, 0
%84 = zext i1 %83 to i32
%85 = tail call i32 @assert(i32 %84)
%86 = tail call i32 @escape_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%87 = tail call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 %86)
%88 = icmp eq i64 %87, 0
%89 = zext i1 %88 to i32
%90 = tail call i32 @assert(i32 %89)
%91 = tail call i32 @escape_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%92 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32 %91)
%93 = icmp eq i64 %92, 0
%94 = zext i1 %93 to i32
%95 = tail call i32 @assert(i32 %94)
%96 = tail call i32 @escape_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
%97 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %96)
%98 = icmp eq i64 %97, 0
%99 = zext i1 %98 to i32
%100 = tail call i32 @assert(i32 %99)
%101 = tail call i32 @escape_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%102 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i64 0, i64 0), i32 %101)
%103 = icmp eq i64 %102, 0
%104 = zext i1 %103 to i32
%105 = tail call i32 @assert(i32 %104)
%106 = tail call i32 @escape_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%107 = tail call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i32 %106)
%108 = icmp eq i64 %107, 0
%109 = zext i1 %108 to i32
%110 = tail call i32 @assert(i32 %109)
%111 = tail call i32 @escape_string(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0))
%112 = tail call i64 @strcmp(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 %111)
%113 = icmp eq i64 %112, 0
%114 = zext i1 %113 to i32
%115 = tail call i32 @assert(i32 %114)
ret void
}