#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*/ warn(char *, int);
int parseQuotedStringNoEscapes(char *in, char *out, char **retNext) {
  char c, *s = in;
  int quoteChar = *s++;
  for (;;) {
    c = *s++;
    if (c == 0) {
      warn("Unmatched %c", quoteChar);
      return 0;
    } else if (c == quoteChar)
      break;
    else
      *out++ = c;
  }
  *out = 0;
  if (retNext != NULL)
    *retNext = s;
  return 1;
}


x86 assembly (clang, -O0):
<parseQuotedStringNoEscapes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%al
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x0,%eax
jne    117d <parseQuotedStringNoEscapes+0x6d>
mov    -0x34(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <warn@plt>
movl   $0x0,-0x4(%rbp)
jmp    11d1 <parseQuotedStringNoEscapes+0xc1>
movsbl -0x21(%rbp),%eax
cmp    -0x34(%rbp),%eax
jne    118f <parseQuotedStringNoEscapes+0x7f>
jmp    11ad <parseQuotedStringNoEscapes+0x9d>
mov    -0x21(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    11a8 <parseQuotedStringNoEscapes+0x98>
jmp    1141 <parseQuotedStringNoEscapes+0x31>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     11ca <parseQuotedStringNoEscapes+0xba>
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseQuotedStringNoEscapes>:
push   %rax
mov    %rsi,%rax
movsbl (%rdi),%esi
mov    0x1(%rdi),%cl
test   %cl,%cl
je     1146 <parseQuotedStringNoEscapes+0x36>
add    $0x2,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %sil,%cl
je     1156 <parseQuotedStringNoEscapes+0x46>
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1130 <parseQuotedStringNoEscapes+0x20>
lea    0xeb3(%rip),%rdi
call   1030 <warn@plt>
xor    %eax,%eax
pop    %rcx
ret
movb   $0x0,(%rax)
mov    $0x1,%eax
test   %rdx,%rdx
je     1166 <parseQuotedStringNoEscapes+0x56>
mov    %rdi,(%rdx)
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Unmatched %c\00"
define i32 @parseQuotedStringNoEscapes(i8* %0, i8* %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
%11 = load i8*, i8** %5
store i8* %11, i8** %9
%12 = load i8*, i8** %9
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %9
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
store i32 %15, i32* %10
br label %16
16: ; preds = %37, %3
%17 = load i8*, i8** %9
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %9
%19 = load i8, i8* %17
store i8 %19, i8* %8
%20 = load i8, i8* %8
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %16
%24 = load i32, i32* %10
%25 = call i32 @warn(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %24)
store i32 0, i32* %4
br label %46
26: ; preds = %16
%27 = load i8, i8* %8
%28 = sext i8 %27 to i32
%29 = load i32, i32* %10
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %32
31: ; preds = %26
br label %38
32: ; preds = %26
%33 = load i8, i8* %8
%34 = load i8*, i8** %6
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %6
store i8 %33, i8* %34
br label %36
36: ; preds = %32
br label %37
37: ; preds = %36
br label %16
38: ; preds = %31
%39 = load i8*, i8** %6
store i8 0, i8* %39
%40 = load i8**, i8*** %7
%41 = icmp ne i8** %40, null
br i1 %41, label %42, label %45
42: ; preds = %38
%43 = load i8*, i8** %9
%44 = load i8**, i8*** %7
store i8* %43, i8** %44
br label %45
45: ; preds = %42, %38
store i32 1, i32* %4
br label %46
46: ; preds = %45, %23
%47 = load i32, i32* %4
ret i32 %47
}

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