#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*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_and_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cmpeq_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cmpgt_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_or_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_epi8(int);
void checkFirstContinuationMax(__m128i current_bytes,
                               __m128i off1_current_bytes, __m128i *has_error) {
  __m128i maskED = _mm_cmpeq_epi8(off1_current_bytes, _mm_set1_epi8(0xED));
  __m128i maskF4 = _mm_cmpeq_epi8(off1_current_bytes, _mm_set1_epi8(0xF4));
  __m128i badfollowED =
      _mm_and_si128(_mm_cmpgt_epi8(current_bytes, _mm_set1_epi8(0x9F)), maskED);
  __m128i badfollowF4 =
      _mm_and_si128(_mm_cmpgt_epi8(current_bytes, _mm_set1_epi8(0x8F)), maskF4);
  *has_error = _mm_or_si128(*has_error, _mm_or_si128(badfollowED, badfollowF4));
}


x86 assembly (clang, -O0):
<checkFirstContinuationMax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    $0xed,%edi
call   1040 <_mm_set1_epi8@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%esi
call   1070 <_mm_cmpeq_epi8@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    $0xf4,%edi
call   1040 <_mm_set1_epi8@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   1070 <_mm_cmpeq_epi8@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    $0x9f,%edi
call   1040 <_mm_set1_epi8@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_cmpgt_epi8@plt>
mov    %eax,%edi
mov    -0x14(%rbp),%esi
call   1060 <_mm_and_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0x8f,%edi
call   1040 <_mm_set1_epi8@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_cmpgt_epi8@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%esi
call   1060 <_mm_and_si128@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1050 <_mm_or_si128@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1050 <_mm_or_si128@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkFirstContinuationMax>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xed,%edi
call   1040 <_mm_set1_epi8@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1070 <_mm_cmpeq_epi8@plt>
mov    %eax,%r15d
mov    $0xf4,%edi
call   1040 <_mm_set1_epi8@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1070 <_mm_cmpeq_epi8@plt>
mov    %eax,%r12d
mov    $0x9f,%edi
call   1040 <_mm_set1_epi8@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_cmpgt_epi8@plt>
mov    %eax,%edi
mov    %r15d,%esi
call   1060 <_mm_and_si128@plt>
mov    %eax,%ebx
mov    $0x8f,%edi
call   1040 <_mm_set1_epi8@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_cmpgt_epi8@plt>
mov    %eax,%edi
mov    %r12d,%esi
call   1060 <_mm_and_si128@plt>
mov    (%r14),%ebp
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <_mm_or_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <_mm_or_si128@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @checkFirstContinuationMax(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%11 = load i32, i32* %5
%12 = call i32 @_mm_set1_epi8(i32 237)
%13 = call i32 @_mm_cmpeq_epi8(i32 %11, i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %5
%15 = call i32 @_mm_set1_epi8(i32 244)
%16 = call i32 @_mm_cmpeq_epi8(i32 %14, i32 %15)
store i32 %16, i32* %8
%17 = load i32, i32* %4
%18 = call i32 @_mm_set1_epi8(i32 159)
%19 = call i32 @_mm_cmpgt_epi8(i32 %17, i32 %18)
%20 = load i32, i32* %7
%21 = call i32 @_mm_and_si128(i32 %19, i32 %20)
store i32 %21, i32* %9
%22 = load i32, i32* %4
%23 = call i32 @_mm_set1_epi8(i32 143)
%24 = call i32 @_mm_cmpgt_epi8(i32 %22, i32 %23)
%25 = load i32, i32* %8
%26 = call i32 @_mm_and_si128(i32 %24, i32 %25)
store i32 %26, i32* %10
%27 = load i32*, i32** %6
%28 = load i32, i32* %27
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = call i32 @_mm_or_si128(i32 %29, i32 %30)
%32 = call i32 @_mm_or_si128(i32 %28, i32 %31)
%33 = load i32*, i32** %6
store i32 %32, i32* %33
ret void
}

LLVM IR (-O2):
define void @checkFirstContinuationMax(i32 %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @_mm_set1_epi8(i32 237)
%5 = tail call i32 @_mm_cmpeq_epi8(i32 %1, i32 %4)
%6 = tail call i32 @_mm_set1_epi8(i32 244)
%7 = tail call i32 @_mm_cmpeq_epi8(i32 %1, i32 %6)
%8 = tail call i32 @_mm_set1_epi8(i32 159)
%9 = tail call i32 @_mm_cmpgt_epi8(i32 %0, i32 %8)
%10 = tail call i32 @_mm_and_si128(i32 %9, i32 %5)
%11 = tail call i32 @_mm_set1_epi8(i32 143)
%12 = tail call i32 @_mm_cmpgt_epi8(i32 %0, i32 %11)
%13 = tail call i32 @_mm_and_si128(i32 %12, i32 %7)
%14 = load i32, i32* %2
%15 = tail call i32 @_mm_or_si128(i32 %10, i32 %13)
%16 = tail call i32 @_mm_or_si128(i32 %14, i32 %15)
store i32 %16, i32* %2
ret void
}