#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_alignr_epi8(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_and_si128(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_setr_epi8(int, int, int, int, int, int, int, int, int,
                                 int, int, int, int, int, int, int);
int /*<<< orphan*/ _mm_shuffle_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
void checkOverlong(__m128i current_bytes, __m128i off1_current_bytes,
                   __m128i hibits, __m128i previous_hibits,
                   __m128i *has_error) {
  __m128i off1_hibits = _mm_alignr_epi8(hibits, previous_hibits, 16 - 1);
  __m128i initial_mins = _mm_shuffle_epi8(
      _mm_setr_epi8(-128, -128, -128, -128, -128, -128, -128, -128, -128, -128,
                    -128, -128, 0xC2, -128, 0xE1, 0xF1),
      off1_hibits);
  __m128i initial_under = _mm_cmpgt_epi8(initial_mins, off1_current_bytes);
  __m128i second_mins = _mm_shuffle_epi8(
      _mm_setr_epi8(-128, -128, -128, -128, -128, -128, -128, -128, -128, -128,
                    -128, -128, 127, 127, 0xA0, 0x90),
      off1_hibits);
  __m128i second_under = _mm_cmpgt_epi8(second_mins, current_bytes);
  *has_error =
      _mm_or_si128(*has_error, _mm_and_si128(initial_under, second_under));
}


x86 assembly (clang, -O0):
<checkOverlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0xf,%edx
call   1030 <_mm_alignr_epi8@plt>
mov    %eax,-0x1c(%rbp)
mov    $0xffffff80,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0xffffff80,(%rsp)
movl   $0xffffff80,0x8(%rsp)
ff
movl   $0xffffff80,0x10(%rsp)
ff
movl   $0xffffff80,0x18(%rsp)
ff
movl   $0xffffff80,0x20(%rsp)
ff
movl   $0xffffff80,0x28(%rsp)
ff
movl   $0xc2,0x30(%rsp)
movl   $0xffffff80,0x38(%rsp)
ff
movl   $0xe1,0x40(%rsp)
movl   $0xf1,0x48(%rsp)
call   1060 <_mm_setr_epi8@plt>
mov    %eax,%edi
mov    -0x1c(%rbp),%esi
call   1050 <_mm_shuffle_epi8@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_cmpgt_epi8@plt>
mov    %eax,-0x24(%rbp)
mov    $0xffffff80,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0xffffff80,(%rsp)
movl   $0xffffff80,0x8(%rsp)
ff
movl   $0xffffff80,0x10(%rsp)
ff
movl   $0xffffff80,0x18(%rsp)
ff
movl   $0xffffff80,0x20(%rsp)
ff
movl   $0xffffff80,0x28(%rsp)
ff
movl   $0x7f,0x30(%rsp)
movl   $0x7f,0x38(%rsp)
movl   $0xa0,0x40(%rsp)
movl   $0x90,0x48(%rsp)
call   1060 <_mm_setr_epi8@plt>
mov    %eax,%edi
mov    -0x1c(%rbp),%esi
call   1050 <_mm_shuffle_epi8@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <_mm_cmpgt_epi8@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   1080 <_mm_and_si128@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   1070 <_mm_or_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkOverlong>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r15
mov    %esi,%ebx
mov    %edi,%r14d
mov    %edx,%edi
mov    %ecx,%esi
mov    $0xf,%edx
call   1030 <_mm_alignr_epi8@plt>
mov    %eax,%ebp
mov    $0xffffff80,%edi
mov    $0xffffff80,%esi
mov    $0xffffff80,%edx
mov    $0xffffff80,%ecx
mov    $0xffffff80,%r8d
mov    $0xffffff80,%r9d
push   $0xf1
push   $0xe1
push   $0xffffffffffffff80
push   $0xc2
push   $0xffffffffffffff80
push   $0xffffffffffffff80
push   $0xffffffffffffff80
push   $0xffffffffffffff80
push   $0xffffffffffffff80
push   $0xffffffffffffff80
call   1060 <_mm_setr_epi8@plt>
add    $0x50,%rsp
mov    %eax,%edi
mov    %ebp,%esi
call   1050 <_mm_shuffle_epi8@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <_mm_cmpgt_epi8@plt>
mov    %eax,%ebx
mov    $0xffffff80,%edi
mov    $0xffffff80,%esi
mov    $0xffffff80,%edx
mov    $0xffffff80,%ecx
mov    $0xffffff80,%r8d
mov    $0xffffff80,%r9d
push   $0x90
push   $0xa0
push   $0x7f
push   $0x7f
push   $0xffffffffffffff80
push   $0xffffffffffffff80
push   $0xffffffffffffff80
push   $0xffffffffffffff80
push   $0xffffffffffffff80
push   $0xffffffffffffff80
call   1060 <_mm_setr_epi8@plt>
add    $0x50,%rsp
mov    %eax,%edi
mov    %ebp,%esi
call   1050 <_mm_shuffle_epi8@plt>
mov    %eax,%edi
mov    %r14d,%esi
call   1040 <_mm_cmpgt_epi8@plt>
mov    (%r15),%ebp
mov    %ebx,%edi
mov    %eax,%esi
call   1080 <_mm_and_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1070 <_mm_or_si128@plt>
mov    %eax,(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @checkOverlong(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = call i32 @_mm_alignr_epi8(i32 %16, i32 %17, i32 15)
store i32 %18, i32* %11
%19 = call i32 @_mm_setr_epi8(i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 194, i32 -128, i32 225, i32 241)
%20 = load i32, i32* %11
%21 = call i32 @_mm_shuffle_epi8(i32 %19, i32 %20)
store i32 %21, i32* %12
%22 = load i32, i32* %12
%23 = load i32, i32* %7
%24 = call i32 @_mm_cmpgt_epi8(i32 %22, i32 %23)
store i32 %24, i32* %13
%25 = call i32 @_mm_setr_epi8(i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 127, i32 127, i32 160, i32 144)
%26 = load i32, i32* %11
%27 = call i32 @_mm_shuffle_epi8(i32 %25, i32 %26)
store i32 %27, i32* %14
%28 = load i32, i32* %14
%29 = load i32, i32* %6
%30 = call i32 @_mm_cmpgt_epi8(i32 %28, i32 %29)
store i32 %30, i32* %15
%31 = load i32*, i32** %10
%32 = load i32, i32* %31
%33 = load i32, i32* %13
%34 = load i32, i32* %15
%35 = call i32 @_mm_and_si128(i32 %33, i32 %34)
%36 = call i32 @_mm_or_si128(i32 %32, i32 %35)
%37 = load i32*, i32** %10
store i32 %36, i32* %37
ret void
}

LLVM IR (-O2):
define void @checkOverlong(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4) {
%6 = tail call i32 @_mm_alignr_epi8(i32 %2, i32 %3, i32 15)
%7 = tail call i32 @_mm_setr_epi8(i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 194, i32 -128, i32 225, i32 241)
%8 = tail call i32 @_mm_shuffle_epi8(i32 %7, i32 %6)
%9 = tail call i32 @_mm_cmpgt_epi8(i32 %8, i32 %1)
%10 = tail call i32 @_mm_setr_epi8(i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 127, i32 127, i32 160, i32 144)
%11 = tail call i32 @_mm_shuffle_epi8(i32 %10, i32 %6)
%12 = tail call i32 @_mm_cmpgt_epi8(i32 %11, i32 %0)
%13 = load i32, i32* %4
%14 = tail call i32 @_mm_and_si128(i32 %9, i32 %12)
%15 = tail call i32 @_mm_or_si128(i32 %13, i32 %14)
store i32 %15, i32* %4
ret void
}