#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fputc(char const, int /*<<< orphan*/ *);
void pq(FILE *f, const char *c) {
  while (*c) {
    if (*c == '"')
      fprintf(f, "\\\"");
    else {
      fputc(*c, f);
      if (*c == '?' && c[1] == '?') {
        fprintf(f, "\" \"");
      }
    }
    c++;
  }
}


x86 assembly (clang, -O0):
<pq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11bb <pq+0x9b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1162 <pq+0x42>
mov    -0x8(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11aa <pq+0x8a>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
jne    11a5 <pq+0x85>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3f,%eax
jne    11a5 <pq+0x85>
mov    -0x8(%rbp),%rdi
lea    0xe63(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11aa <pq+0x8a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <pq+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pq>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xecb(%rip),%r15
lea    0xec7(%rip),%r12
jmp    1159 <pq+0x39>
xchg   %ax,%ax
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1040 <fwrite@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x22,%al
je     1140 <pq+0x20>
test   %al,%al
je     1189 <pq+0x69>
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
cmpb   $0x3f,(%rbx)
jne    1155 <pq+0x35>
cmpb   $0x3f,0x1(%rbx)
jne    1155 <pq+0x35>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r12,%rdi
jmp    114d <pq+0x2d>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"\\\22\00"
@.str.1 = [4 x i8] c"\22 \22\00"
define void @pq(i32* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %18, %2
%4 = phi i8* [ %1, %2 ], [ %19, %18 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 0, label %20
i8 34, label %6
]
6: ; preds = %3
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
br label %18
8: ; preds = %3
%9 = tail call i32 @fputc(i8 signext %5, i32* %0)
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 63
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %4, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 63
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3, i64 1, i32* %0)
br label %18
18: ; preds = %8, %12, %16, %6
%19 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
20: ; preds = %3
ret void
}