#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 check_epi16_overflow_x4(int /*<<< orphan*/ const *,
                            int /*<<< orphan*/ const *,
                            int /*<<< orphan*/ const *,
                            int /*<<< orphan*/ const *);
int check_epi16_overflow_x8(const __m128i *preg0, const __m128i *preg1,
                            const __m128i *preg2, const __m128i *preg3,
                            const __m128i *preg4, const __m128i *preg5,
                            const __m128i *preg6, const __m128i *preg7) {
  int res0, res1;
  res0 = check_epi16_overflow_x4(preg0, preg1, preg2, preg3);
  res1 = check_epi16_overflow_x4(preg4, preg5, preg6, preg7);
  return res0 + res1;
}


x86 assembly (clang, -O0):
<check_epi16_overflow_x8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <check_epi16_overflow_x4@plt>
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    0x10(%rbp),%rdx
mov    0x18(%rbp),%rcx
call   1030 <check_epi16_overflow_x4@plt>
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    -0x38(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_epi16_overflow_x8>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9,%r14
mov    %r8,%rbx
mov    0x30(%rsp),%r15
mov    0x38(%rsp),%r12
call   1030 <check_epi16_overflow_x4@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1030 <check_epi16_overflow_x4@plt>
add    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @check_epi16_overflow_x8(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i32
store i32* %0, i32** %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store i32* %6, i32** %15
store i32* %7, i32** %16
%19 = load i32*, i32** %9
%20 = load i32*, i32** %10
%21 = load i32*, i32** %11
%22 = load i32*, i32** %12
%23 = call i32 @check_epi16_overflow_x4(i32* %19, i32* %20, i32* %21, i32* %22)
store i32 %23, i32* %17
%24 = load i32*, i32** %13
%25 = load i32*, i32** %14
%26 = load i32*, i32** %15
%27 = load i32*, i32** %16
%28 = call i32 @check_epi16_overflow_x4(i32* %24, i32* %25, i32* %26, i32* %27)
store i32 %28, i32* %18
%29 = load i32, i32* %17
%30 = load i32, i32* %18
%31 = add nsw i32 %29, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @check_epi16_overflow_x8(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = tail call i32 @check_epi16_overflow_x4(i32* %0, i32* %1, i32* %2, i32* %3)
%10 = tail call i32 @check_epi16_overflow_x4(i32* %4, i32* %5, i32* %6, i32* %7)
%11 = add nsw i32 %10, %9
ret i32 %11
}