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

/* Variables and functions */
const wchar_t *find_cell_delimiter(const wchar_t *start_pos) {
  const wchar_t *current_pos = start_pos;
  while (*current_pos != L'\0') {
    if (*current_pos == L'|')
      return current_pos;
    if (*current_pos == L'\\')
      ++current_pos;
    ++current_pos;
  }
  return 0;
}


x86 assembly (clang, -O0):
<find_cell_delimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     1161 <find_cell_delimiter+0x61>
mov    -0x18(%rbp),%rax
cmpl   $0x7c,(%rax)
jne    1137 <find_cell_delimiter+0x37>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <find_cell_delimiter+0x69>
mov    -0x18(%rbp),%rax
cmpl   $0x5c,(%rax)
jne    1150 <find_cell_delimiter+0x50>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <find_cell_delimiter+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_cell_delimiter>:
mov    %rdi,%rax
jmp    1118 <find_cell_delimiter+0x18>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x4,%rax
add    $0x4,%rax
mov    (%rax),%ecx
cmp    $0x5c,%ecx
je     1110 <find_cell_delimiter+0x10>
test   %ecx,%ecx
je     1129 <find_cell_delimiter+0x29>
cmp    $0x7c,%ecx
jne    1114 <find_cell_delimiter+0x14>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @find_cell_delimiter(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
%5 = load i32*, i32** %3
store i32* %5, i32** %4
br label %6
6: ; preds = %23, %1
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %6
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 124
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32*, i32** %4
store i32* %15, i32** %2
br label %27
16: ; preds = %10
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 92
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %4
br label %23
23: ; preds = %20, %16
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i32 1
store i32* %25, i32** %4
br label %6
26: ; preds = %6
store i32* null, i32** %2
br label %27
27: ; preds = %26, %14
%28 = load i32*, i32** %2
ret i32* %28
}

LLVM IR (-O2):
define i32* @find_cell_delimiter(i32* %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i32* [ %0, %1 ], [ %9, %7 ]
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %11
i32 124, label %10
i32 92, label %5
]
5: ; preds = %2
%6 = getelementptr inbounds i32, i32* %3, i64 1
br label %7
7: ; preds = %2, %5
%8 = phi i32* [ %6, %5 ], [ %3, %2 ]
%9 = getelementptr inbounds i32, i32* %8, i64 1
br label %2
10: ; preds = %2
br label %11
11: ; preds = %2, %10
%12 = phi i32* [ %3, %10 ], [ null, %2 ]
ret i32* %12
}