#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 char wchar_t;

/* Variables and functions */
int is_query_position_restrictive(wchar_t *search_query) {
  wchar_t c, last_considerable_char, first_considerable_char;
  int i;
  i = 0;
  c = search_query[i];
  first_considerable_char = '\0';
  last_considerable_char = '\0';
  while (c != '\0') {
    if (c != L' ' && first_considerable_char == '\0') {
      first_considerable_char = c;
    } else if (first_considerable_char != '\0' && c != L' ') {
      last_considerable_char = c;
    }
    i++;
    c = search_query[i];
  }
  if (first_considerable_char == last_considerable_char &&
      first_considerable_char == L'"') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_query_position_restrictive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movb   $0x0,-0x13(%rbp)
movb   $0x0,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
je     1198 <is_query_position_restrictive+0x98>
movsbl -0x11(%rbp),%eax
cmp    $0x20,%eax
je     1157 <is_query_position_restrictive+0x57>
movsbl -0x13(%rbp),%eax
cmp    $0x0,%eax
jne    1157 <is_query_position_restrictive+0x57>
mov    -0x11(%rbp),%al
mov    %al,-0x13(%rbp)
jmp    117c <is_query_position_restrictive+0x7c>
movsbl -0x13(%rbp),%eax
cmp    $0x0,%eax
je     1177 <is_query_position_restrictive+0x77>
movsbl -0x11(%rbp),%eax
cmp    $0x20,%eax
je     1177 <is_query_position_restrictive+0x77>
mov    -0x11(%rbp),%al
mov    %al,-0x12(%rbp)
jmp    117c <is_query_position_restrictive+0x7c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
jmp    1125 <is_query_position_restrictive+0x25>
movsbl -0x13(%rbp),%eax
movsbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jne    11c1 <is_query_position_restrictive+0xc1>
movsbl -0x13(%rbp),%eax
cmp    $0x22,%eax
jne    11c1 <is_query_position_restrictive+0xc1>
movl   $0x1,-0x4(%rbp)
jmp    11c8 <is_query_position_restrictive+0xc8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_query_position_restrictive>:
mov    (%rdi),%al
test   %al,%al
je     1151 <is_query_position_restrictive+0x51>
add    $0x1,%rdi
xor    %ecx,%ecx
xor    %edx,%edx
xchg   %ax,%ax
cmp    $0x20,%al
movzbl %dl,%esi
movzbl %al,%r9d
mov    %esi,%edx
cmovne %r9d,%edx
setne  %r8b
test   %cl,%cl
cmove  %esi,%edx
sete   %al
test   %al,%r8b
cmovne %esi,%edx
movzbl %cl,%ecx
cmovne %r9d,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <is_query_position_restrictive+0x10>
xor    $0x22,%cl
xor    $0x22,%dl
xor    %eax,%eax
or     %cl,%dl
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_query_position_restrictive(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %7
%8 = load i8*, i8** %3
%9 = load i32, i32* %7
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %4
store i8 0, i8* %6
store i8 0, i8* %5
br label %13
13: ; preds = %38, %1
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %46
17: ; preds = %13
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 32
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i8, i8* %6
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i8, i8* %4
store i8 %26, i8* %6
br label %38
27: ; preds = %21, %17
%28 = load i8, i8* %6
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %37
31: ; preds = %27
%32 = load i8, i8* %4
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 32
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = load i8, i8* %4
store i8 %36, i8* %5
br label %37
37: ; preds = %35, %31, %27
br label %38
38: ; preds = %37, %25
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
%41 = load i8*, i8** %3
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %41, i64 %43
%45 = load i8, i8* %44
store i8 %45, i8* %4
br label %13
46: ; preds = %13
%47 = load i8, i8* %6
%48 = sext i8 %47 to i32
%49 = load i8, i8* %5
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %48, %50
br i1 %51, label %52, label %57
52: ; preds = %46
%53 = load i8, i8* %6
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 34
br i1 %55, label %56, label %57
56: ; preds = %52
store i32 1, i32* %2
br label %58
57: ; preds = %52, %46
store i32 0, i32* %2
br label %58
58: ; preds = %57, %56
%59 = load i32, i32* %2
ret i32 %59
}

LLVM IR (-O2):
define i32 @is_query_position_restrictive(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %26, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %17, %4 ], [ 0, %1 ]
%6 = phi i8 [ %19, %4 ], [ %2, %1 ]
%7 = phi i8 [ %16, %4 ], [ 0, %1 ]
%8 = phi i8 [ %15, %4 ], [ 0, %1 ]
%9 = icmp ne i8 %6, 32
%10 = icmp eq i8 %7, 0
%11 = select i1 %9, i1 %10, i1 false
%12 = icmp ne i8 %7, 0
%13 = select i1 %12, i1 %9, i1 false
%14 = select i1 %13, i8 %6, i8 %8
%15 = select i1 %11, i8 %8, i8 %14
%16 = select i1 %11, i8 %6, i8 %7
%17 = add nuw nsw i64 %5, 1
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %4
21: ; preds = %4
%22 = icmp eq i8 %16, 34
%23 = icmp eq i8 %15, 34
%24 = and i1 %23, %22
%25 = zext i1 %24 to i32
br label %26
26: ; preds = %21, %1
%27 = phi i32 [ %25, %21 ], [ 0, %1 ]
ret i32 %27
}