#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
scalar_t__ is_escaped_newline(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int is_quoted(FILE *input, FILE *output, int c) {
  if (c == '"' || c == '\'') {
    int chrEnd = c;
    fputc(c, output);
    do {
      c = fgetc(input);
      fputc(c, output);
      if (is_escaped_newline(input, output, c)) {
        continue;
      }
      if (c == chrEnd) {
        break;
      }
    } while (c != EOF);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_quoted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x22,-0x1c(%rbp)
je     1157 <is_quoted+0x27>
cmpl   $0x27,-0x1c(%rbp)
jne    11d4 <is_quoted+0xa4>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <fputc@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <fputc@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <is_escaped_newline@plt>
cmp    $0x0,%rax
je     11a0 <is_quoted+0x70>
jmp    11b6 <is_quoted+0x86>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    11b1 <is_quoted+0x81>
jmp    11c8 <is_quoted+0x98>
jmp    11b6 <is_quoted+0x86>
mov    -0x1c(%rbp),%eax
mov    0x2e28(%rip),%rcx
cmp    (%rcx),%eax
jne    1169 <is_quoted+0x39>
movl   $0x1,-0x4(%rbp)
jmp    11db <is_quoted+0xab>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_quoted>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%r15
cmp    $0x27,%edx
je     114e <is_quoted+0x1e>
xor    %eax,%eax
cmp    $0x22,%r14d
jne    119c <is_quoted+0x6c>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    0x2e88(%rip),%r12
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <is_escaped_newline@plt>
test   %rax,%rax
sete   %cl
cmp    %r14d,%ebp
sete   %dl
mov    $0x1,%eax
test   %cl,%dl
jne    119c <is_quoted+0x6c>
cmp    (%r12),%ebp
jne    1160 <is_quoted+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @is_quoted(i32* %0, i32* %1, i32 %2) {
switch i32 %2, label %16 [
i32 39, label %4
i32 34, label %4
]
4: ; preds = %3, %3
%5 = tail call i32 @fputc(i32 %2, i32* %1)
br label %6
6: ; preds = %6, %4
%7 = tail call i32 @fgetc(i32* %0)
%8 = tail call i32 @fputc(i32 %7, i32* %1)
%9 = tail call i64 @is_escaped_newline(i32* %0, i32* %1, i32 %7)
%10 = icmp eq i64 %9, 0
%11 = icmp eq i32 %7, %2
%12 = and i1 %11, %10
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %7, %13
%15 = select i1 %12, i1 true, i1 %14
br i1 %15, label %16, label %6
16: ; preds = %6, %3
%17 = phi i32 [ 0, %3 ], [ 1, %6 ]
ret i32 %17
}