#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*/ sqlite3Fts3Dequote(char *);
char *sqlite3_mprintf(char *, char const *);
int fts3IsSpecialColumn(const char *z, int *pnKey, char **pzValue) {
  char *zValue;
  const char *zCsr = z;
  while (*zCsr != '=') {
    if (*zCsr == '\0')
      return 0;
    zCsr++;
  }
  *pnKey = (int)(zCsr - z);
  zValue = sqlite3_mprintf("%s", &zCsr[1]);
  if (zValue) {
    sqlite3Fts3Dequote(zValue);
  }
  *pzValue = zValue;
  return 1;
}


x86 assembly (clang, -O0):
<fts3IsSpecialColumn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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
movsbl (%rax),%eax
cmp    $0x3d,%eax
je     1179 <fts3IsSpecialColumn+0x59>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1168 <fts3IsSpecialColumn+0x48>
movl   $0x0,-0x4(%rbp)
jmp    11ca <fts3IsSpecialColumn+0xaa>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    113c <fts3IsSpecialColumn+0x1c>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rsi
add    $0x1,%rsi
lea    0xe65(%rip),%rdi
call   1040 <sqlite3_mprintf@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11b8 <fts3IsSpecialColumn+0x98>
mov    -0x28(%rbp),%rdi
call   1030 <sqlite3Fts3Dequote@plt>
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts3IsSpecialColumn>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rax
add    $0x1,%rax
xor    %ecx,%ecx
movzbl -0x1(%rax),%edx
test   %dl,%dl
je     1146 <fts3IsSpecialColumn+0x26>
cmp    $0x3d,%dl
je     114a <fts3IsSpecialColumn+0x2a>
add    $0x1,%rax
add    $0x1,%ecx
jmp    1130 <fts3IsSpecialColumn+0x10>
xor    %eax,%eax
jmp    1173 <fts3IsSpecialColumn+0x53>
mov    %ecx,(%rsi)
lea    0xead(%rip),%rdi
mov    %rax,%rsi
call   1040 <sqlite3_mprintf@plt>
mov    %rax,%rbx
test   %rax,%rax
je     116b <fts3IsSpecialColumn+0x4b>
mov    %rbx,%rdi
call   1030 <sqlite3Fts3Dequote@plt>
mov    %rbx,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @fts3IsSpecialColumn(i8* %0, i32* nocapture writeonly %1, i8** nocapture writeonly %2) {
br label %4
4: ; preds = %7, %3
%5 = phi i8* [ %0, %3 ], [ %8, %7 ]
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 61, label %9
i8 0, label %20
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
9: ; preds = %4
%10 = ptrtoint i8* %5 to i64
%11 = ptrtoint i8* %0 to i64
%12 = sub i64 %10, %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %1
%14 = getelementptr inbounds i8, i8* %5, i64 1
%15 = tail call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = icmp eq i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %9
%18 = tail call i32 @sqlite3Fts3Dequote(i8* %15)
br label %19
19: ; preds = %17, %9
store i8* %15, i8** %2
br label %20
20: ; preds = %4, %19
%21 = phi i32 [ 1, %19 ], [ 0, %4 ]
ret i32 %21
}