#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 int64_t;
typedef int int32_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_load_si128(int /*<<< orphan*/ *);
int /*<<< orphan*/ _mm_store_si128(int /*<<< orphan*/ *, int /*<<< orphan*/);
extern __attribute__((__gnu___, __always___, __artificial__)) __m128i
_MM_MULLO_EPI32(__m128i a, __m128i b) {
  __attribute__((aligned(16))) int32_t atmp[4], btmp[4], res[4];
  int64_t res64;
  int i;
  _mm_store_si128((__m128i *)atmp, a);
  _mm_store_si128((__m128i *)btmp, b);
  for (i = 0; i < 4; i++) {
    res64 = atmp[i] * btmp[i];
    res[i] = (int)(res64 & 0xffffffff);
  }
  return _mm_load_si128((__m128i *)res);
}


x86 assembly (clang, -O0):
<_MM_MULLO_EPI32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <_mm_store_si128@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <_mm_store_si128@plt>
movl   $0x0,-0x48(%rbp)
cmpl   $0x4,-0x48(%rbp)
jge    1187 <_MM_MULLO_EPI32+0x67>
movslq -0x48(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
movslq -0x48(%rbp),%rcx
imul   -0x30(%rbp,%rcx,4),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%ecx
and    $0xffffffff,%ecx
movslq -0x48(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    114d <_MM_MULLO_EPI32+0x2d>
lea    -0x40(%rbp),%rdi
call   1030 <_mm_load_si128@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MM_MULLO_EPI32>:
push   %rbx
sub    $0x30,%rsp
mov    %esi,%ebx
mov    %edi,%esi
lea    0x20(%rsp),%rdi
call   1040 <_mm_store_si128@plt>
lea    0x10(%rsp),%rdi
mov    %ebx,%esi
call   1040 <_mm_store_si128@plt>
movdqa 0x20(%rsp),%xmm0
movdqa 0x10(%rsp),%xmm1
pshufd $0xf5,%xmm1,%xmm2
pmuludq %xmm0,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pshufd $0xf5,%xmm0,%xmm0
pmuludq %xmm0,%xmm2
pshufd $0xe8,%xmm2,%xmm0
punpckldq %xmm0,%xmm1
movdqa %xmm1,(%rsp)
mov    %rsp,%rdi
call   1030 <_mm_load_si128@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_MM_MULLO_EPI32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i32]
%6 = alloca [4 x i32]
%7 = alloca [4 x i32]
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 @_mm_store_si128(i32* %10, i32 %11)
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%14 = load i32, i32* %4
%15 = call i32 @_mm_store_si128(i32* %13, i32 %14)
store i32 0, i32* %9
br label %16
16: ; preds = %34, %2
%17 = load i32, i32* %9
%18 = icmp slt i32 %17, 4
br i1 %18, label %19, label %37
19: ; preds = %16
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = mul nsw i32 %23, %27
store i32 %28, i32* %8
%29 = load i32, i32* %8
%30 = and i32 %29, -1
%31 = load i32, i32* %9
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 %32
store i32 %30, i32* %33
br label %34
34: ; preds = %19
%35 = load i32, i32* %9
%36 = add nsw i32 %35, 1
store i32 %36, i32* %9
br label %16
37: ; preds = %16
%38 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%39 = call i32 @_mm_load_si128(i32* %38)
ret i32 %39
}

LLVM IR (-O2):
define i32 @_MM_MULLO_EPI32(i32 %0, i32 %1) {
%3 = alloca <4 x i32>
%4 = alloca <4 x i32>
%5 = alloca <4 x i32>
%6 = bitcast <4 x i32>* %3 to i8*
%7 = bitcast <4 x i32>* %4 to i8*
%8 = bitcast <4 x i32>* %5 to i8*
%9 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 0
%10 = call i32 @_mm_store_si128(i32* %9, i32 %0)
%11 = getelementptr inbounds <4 x i32>, <4 x i32>* %4, i64 0, i64 0
%12 = call i32 @_mm_store_si128(i32* %11, i32 %1)
%13 = getelementptr inbounds <4 x i32>, <4 x i32>* %5, i64 0, i64 0
%14 = load <4 x i32>, <4 x i32>* %3
%15 = load <4 x i32>, <4 x i32>* %4
%16 = mul nsw <4 x i32> %15, %14
store <4 x i32> %16, <4 x i32>* %5
%17 = call i32 @_mm_load_si128(i32* %13)
ret i32 %17
}