#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 */
scalar_t__ mcp_intern_is_simplechar(char const);
int mcp_intern_is_unquoted(const char **in, char *buf, int buflen) {
  int origbuflen = buflen;
  if (!mcp_intern_is_simplechar(**in))
    return 0;
  while (mcp_intern_is_simplechar(**in)) {
    if (--buflen > 0) {
      *buf++ = **in;
    }
    (*in)++;
  }
  if (origbuflen > 0)
    *buf = '\0';
  return 1;
}


x86 assembly (clang, -O0):
<mcp_intern_is_unquoted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <mcp_intern_is_simplechar@plt>
cmp    $0x0,%rax
jne    114e <mcp_intern_is_unquoted+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    11c3 <mcp_intern_is_unquoted+0xb3>
jmp    1153 <mcp_intern_is_unquoted+0x43>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <mcp_intern_is_simplechar@plt>
cmp    $0x0,%rax
je     11ab <mcp_intern_is_unquoted+0x9b>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jle    1198 <mcp_intern_is_unquoted+0x88>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <mcp_intern_is_unquoted+0x43>
cmpl   $0x0,-0x20(%rbp)
jle    11bc <mcp_intern_is_unquoted+0xac>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcp_intern_is_unquoted>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
mov    (%rdi),%rax
movsbl (%rax),%edi
call   1030 <mcp_intern_is_simplechar@plt>
test   %rax,%rax
je     1192 <mcp_intern_is_unquoted+0x82>
mov    0x0(%rbp),%rax
movsbl (%rax),%edi
call   1030 <mcp_intern_is_simplechar@plt>
test   %rax,%rax
je     1182 <mcp_intern_is_unquoted+0x72>
mov    %r14d,%ebx
jmp    116d <mcp_intern_is_unquoted+0x5d>
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%rbp),%rax
lea    0x1(%rax),%rcx
mov    %rcx,0x0(%rbp)
movsbl 0x1(%rax),%edi
call   1030 <mcp_intern_is_simplechar@plt>
add    $0xffffffff,%ebx
test   %rax,%rax
je     1182 <mcp_intern_is_unquoted+0x72>
cmp    $0x2,%ebx
jl     1150 <mcp_intern_is_unquoted+0x40>
mov    0x0(%rbp),%rax
movzbl (%rax),%eax
mov    %al,(%r15)
add    $0x1,%r15
jmp    1150 <mcp_intern_is_unquoted+0x40>
mov    $0x1,%eax
test   %r14d,%r14d
jle    1194 <mcp_intern_is_unquoted+0x84>
movb   $0x0,(%r15)
jmp    1194 <mcp_intern_is_unquoted+0x84>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mcp_intern_is_unquoted(i8** %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8** %0, i8*** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i32, i32* %7
store i32 %9, i32* %8
%10 = load i8**, i8*** %5
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = call i64 @mcp_intern_is_simplechar(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %3
store i32 0, i32* %4
br label %43
16: ; preds = %3
br label %17
17: ; preds = %33, %16
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
%20 = load i8, i8* %19
%21 = call i64 @mcp_intern_is_simplechar(i8 signext %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %37
23: ; preds = %17
%24 = load i32, i32* %7
%25 = add nsw i32 %24, -1
store i32 %25, i32* %7
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %33
27: ; preds = %23
%28 = load i8**, i8*** %5
%29 = load i8*, i8** %28
%30 = load i8, i8* %29
%31 = load i8*, i8** %6
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %6
store i8 %30, i8* %31
br label %33
33: ; preds = %27, %23
%34 = load i8**, i8*** %5
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %34
br label %17
37: ; preds = %17
%38 = load i32, i32* %8
%39 = icmp sgt i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = load i8*, i8** %6
store i8 0, i8* %41
br label %42
42: ; preds = %40, %37
store i32 1, i32* %4
br label %43
43: ; preds = %42, %15
%44 = load i32, i32* %4
ret i32 %44
}

LLVM IR (-O2):
define i32 @mcp_intern_is_unquoted(i8** nocapture %0, i8* nocapture writeonly %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = load i8, i8* %4
%6 = tail call i64 @mcp_intern_is_simplechar(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %33, label %8
8: ; preds = %3
%9 = load i8*, i8** %0
%10 = load i8, i8* %9
%11 = tail call i64 @mcp_intern_is_simplechar(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %29, label %13
13: ; preds = %8, %22
%14 = phi i32 [ %16, %22 ], [ %2, %8 ]
%15 = phi i8* [ %23, %22 ], [ %1, %8 ]
%16 = add nsw i32 %14, -1
%17 = icmp sgt i32 %14, 1
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i8*, i8** %0
%20 = load i8, i8* %19
%21 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %20, i8* %15
br label %22
22: ; preds = %18, %13
%23 = phi i8* [ %21, %18 ], [ %15, %13 ]
%24 = load i8*, i8** %0
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8* %25, i8** %0
%26 = load i8, i8* %25
%27 = tail call i64 @mcp_intern_is_simplechar(i8 signext %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %13
29: ; preds = %22, %8
%30 = phi i8* [ %1, %8 ], [ %23, %22 ]
%31 = icmp sgt i32 %2, 0
br i1 %31, label %32, label %33
32: ; preds = %29
store i8 0, i8* %30
br label %33
33: ; preds = %29, %32, %3
%34 = phi i32 [ 0, %3 ], [ 1, %32 ], [ 1, %29 ]
ret i32 %34
}