#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 */
char *strchr(char const *, char);
int str_need_unescape_unicode(const char *utf8_string) {
  if (utf8_string == NULL)
    return 0;
  const char *bs = utf8_string;
  do {
    bs = strchr(bs, '\\');
    if (bs && (bs[1] == 'u' || bs[1] == 'U')) {
      return 1;
    }
  } while (bs++ && *bs);
  return 0;
}


x86 assembly (clang, -O0):
<str_need_unescape_unicode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <str_need_unescape_unicode+0x23>
movl   $0x0,-0x4(%rbp)
jmp    11cb <str_need_unescape_unicode+0xbb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1186 <str_need_unescape_unicode+0x76>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x75,%eax
je     117a <str_need_unescape_unicode+0x6a>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x55,%eax
jne    1186 <str_need_unescape_unicode+0x76>
movl   $0x1,-0x4(%rbp)
jmp    11cb <str_need_unescape_unicode+0xbb>
jmp    118b <str_need_unescape_unicode+0x7b>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     11b9 <str_need_unescape_unicode+0xa9>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    113b <str_need_unescape_unicode+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_need_unescape_unicode>:
push   %rax
test   %rdi,%rdi
je     114d <str_need_unescape_unicode+0x3d>
mov    %rdi,%rax
nopl   0x0(%rax)
mov    %rax,%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     114d <str_need_unescape_unicode+0x3d>
movzbl 0x1(%rax),%edx
mov    $0x1,%ecx
cmp    $0x75,%dl
je     114f <str_need_unescape_unicode+0x3f>
cmp    $0x55,%dl
je     114f <str_need_unescape_unicode+0x3f>
add    $0x1,%rax
test   %dl,%dl
jne    1120 <str_need_unescape_unicode+0x10>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @str_need_unescape_unicode(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %41
8: ; preds = %1
%9 = load i8*, i8** %3
store i8* %9, i8** %4
br label %10
10: ; preds = %38, %8
%11 = load i8*, i8** %4
%12 = call i8* @strchr(i8* %11, i8 signext 92)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %28
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 117
br i1 %20, label %27, label %21
21: ; preds = %15
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 85
br i1 %26, label %27, label %28
27: ; preds = %21, %15
store i32 1, i32* %2
br label %41
28: ; preds = %21, %10
br label %29
29: ; preds = %28
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %4
%32 = icmp ne i8* %30, null
br i1 %32, label %33, label %38
33: ; preds = %29
%34 = load i8*, i8** %4
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 0
br label %38
38: ; preds = %33, %29
%39 = phi i1 [ false, %29 ], [ %37, %33 ]
br i1 %39, label %10, label %40
40: ; preds = %38
store i32 0, i32* %2
br label %41
41: ; preds = %40, %27, %7
%42 = load i32, i32* %2
ret i32 %42
}

LLVM IR (-O2):
define i32 @str_need_unescape_unicode(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = tail call i8* @strchr(i8* %4, i8 signext 92)
%6 = icmp eq i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %8
switch i8 %9, label %3 [
i8 117, label %11
i8 85, label %11
i8 0, label %10
]
10: ; preds = %7
br label %11
11: ; preds = %3, %7, %7, %10, %1
%12 = phi i32 [ 0, %1 ], [ 0, %10 ], [ 1, %7 ], [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}