#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;
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int _mm_extract_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_mullo_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set_pd(double, double);
int /*<<< orphan*/ _mm_setr_epi32(int volatile, int, int volatile, int);
int /*<<< orphan*/ _mm_shuffle_epi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_slli_epi64(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srl_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_srli_epi64(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_si128(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_unpacklo_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  volatile int a0 = 17;
  volatile int a1 = 42;
  __m128i foo = _mm_setr_epi32(argc, argc + 1, argc + 2, argc + 3);
  __m128i bar = _mm_setr_epi32(argc + 3, argc + 2, argc + 1, argc);
  __m128i x = _mm_setr_epi32(a1, 0, a0, 0);
  __m128d g = _mm_set_pd((double)a1, (double)a0);
  x = _mm_srl_epi64(x, _mm_setr_epi32(2, 0, 0, 0));
  foo = _mm_mullo_epi16(foo, bar);
  foo = _mm_slli_epi64(foo, 1);
  foo = _mm_xor_si128(bar, _mm_unpacklo_epi32(foo, bar));
  foo = _mm_srli_epi64(foo, 1);
  foo = _mm_mullo_epi16(foo, bar);
  foo = _mm_shuffle_epi32(foo, 78);
  foo = _mm_xor_si128(bar, _mm_unpacklo_epi32(foo, bar));
  foo = _mm_srli_si128(foo, 1);
  foo = _mm_xor_si128(foo, x);
  return _mm_extract_epi16(foo, 0) & (argc - 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x11,-0x14(%rbp)
movl   $0x2a,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
add    $0x2,%edx
mov    -0x8(%rbp),%ecx
add    $0x3,%ecx
call   10c0 <_mm_setr_epi32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
add    $0x3,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
call   10c0 <_mm_setr_epi32@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
mov    %ecx,%esi
call   10c0 <_mm_setr_epi32@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm1
call   1050 <_mm_set_pd@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    $0x2,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   10c0 <_mm_setr_epi32@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%esi
call   10b0 <_mm_srl_epi64@plt>
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1090 <_mm_mullo_epi16@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   10d0 <_mm_slli_epi64@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   10a0 <_mm_xor_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1040 <_mm_srli_epi64@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1090 <_mm_mullo_epi16@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x4e,%esi
call   1070 <_mm_shuffle_epi32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
call   10a0 <_mm_xor_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1060 <_mm_srli_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x24(%rbp),%esi
call   10a0 <_mm_xor_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
xor    %esi,%esi
call   1080 <_mm_extract_epi16@plt>
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r12d
movl   $0x11,0xc(%rsp)
movl   $0x2a,0x8(%rsp)
lea    0x1(%r12),%r14d
lea    0x2(%r12),%ebx
lea    0x3(%r12),%ebp
mov    %r14d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   10c0 <_mm_setr_epi32@plt>
mov    %eax,%r15d
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14d,%edx
mov    %r12d,%ecx
call   10c0 <_mm_setr_epi32@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   10c0 <_mm_setr_epi32@plt>
mov    %eax,%ebx
cvtsi2sdl 0x8(%rsp),%xmm0
cvtsi2sdl 0xc(%rsp),%xmm1
call   1050 <_mm_set_pd@plt>
mov    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   10c0 <_mm_setr_epi32@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   10b0 <_mm_srl_epi64@plt>
mov    %eax,%r14d
mov    %r15d,%edi
mov    %ebp,%esi
call   1090 <_mm_mullo_epi16@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   10d0 <_mm_slli_epi64@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   10a0 <_mm_xor_si128@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <_mm_srli_epi64@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1090 <_mm_mullo_epi16@plt>
mov    %eax,%edi
mov    $0x4e,%esi
call   1070 <_mm_shuffle_epi32@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   10a0 <_mm_xor_si128@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1060 <_mm_srli_si128@plt>
mov    %eax,%edi
mov    %r14d,%esi
call   10a0 <_mm_xor_si128@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1080 <_mm_extract_epi16@plt>
add    $0xffffffff,%r12d
and    %r12d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 17, i32* %6
store volatile i32 42, i32* %7
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 2
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 3
%19 = call i32 @_mm_setr_epi32(i32 %12, i32 %14, i32 %16, i32 %18)
store i32 %19, i32* %8
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 3
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 2
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
%26 = load i32, i32* %4
%27 = call i32 @_mm_setr_epi32(i32 %21, i32 %23, i32 %25, i32 %26)
store i32 %27, i32* %9
%28 = load volatile i32, i32* %7
%29 = load volatile i32, i32* %6
%30 = call i32 @_mm_setr_epi32(i32 %28, i32 0, i32 %29, i32 0)
store i32 %30, i32* %10
%31 = load volatile i32, i32* %7
%32 = sitofp i32 %31 to double
%33 = load volatile i32, i32* %6
%34 = sitofp i32 %33 to double
%35 = call i32 @_mm_set_pd(double %32, double %34)
store i32 %35, i32* %11
%36 = load i32, i32* %10
%37 = call i32 @_mm_setr_epi32(i32 2, i32 0, i32 0, i32 0)
%38 = call i32 @_mm_srl_epi64(i32 %36, i32 %37)
store i32 %38, i32* %10
%39 = load i32, i32* %8
%40 = load i32, i32* %9
%41 = call i32 @_mm_mullo_epi16(i32 %39, i32 %40)
store i32 %41, i32* %8
%42 = load i32, i32* %8
%43 = call i32 @_mm_slli_epi64(i32 %42, i32 1)
store i32 %43, i32* %8
%44 = load i32, i32* %9
%45 = load i32, i32* %8
%46 = load i32, i32* %9
%47 = call i32 @_mm_unpacklo_epi32(i32 %45, i32 %46)
%48 = call i32 @_mm_xor_si128(i32 %44, i32 %47)
store i32 %48, i32* %8
%49 = load i32, i32* %8
%50 = call i32 @_mm_srli_epi64(i32 %49, i32 1)
store i32 %50, i32* %8
%51 = load i32, i32* %8
%52 = load i32, i32* %9
%53 = call i32 @_mm_mullo_epi16(i32 %51, i32 %52)
store i32 %53, i32* %8
%54 = load i32, i32* %8
%55 = call i32 @_mm_shuffle_epi32(i32 %54, i32 78)
store i32 %55, i32* %8
%56 = load i32, i32* %9
%57 = load i32, i32* %8
%58 = load i32, i32* %9
%59 = call i32 @_mm_unpacklo_epi32(i32 %57, i32 %58)
%60 = call i32 @_mm_xor_si128(i32 %56, i32 %59)
store i32 %60, i32* %8
%61 = load i32, i32* %8
%62 = call i32 @_mm_srli_si128(i32 %61, i32 1)
store i32 %62, i32* %8
%63 = load i32, i32* %8
%64 = load i32, i32* %10
%65 = call i32 @_mm_xor_si128(i32 %63, i32 %64)
store i32 %65, i32* %8
%66 = load i32, i32* %8
%67 = call i32 @_mm_extract_epi16(i32 %66, i32 0)
%68 = load i32, i32* %4
%69 = sub nsw i32 %68, 1
%70 = and i32 %67, %69
ret i32 %70
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store volatile i32 17, i32* %3
%6 = bitcast i32* %4 to i8*
store volatile i32 42, i32* %4
%7 = add nsw i32 %0, 1
%8 = add nsw i32 %0, 2
%9 = add nsw i32 %0, 3
%10 = tail call i32 @_mm_setr_epi32(i32 %0, i32 %7, i32 %8, i32 %9)
%11 = tail call i32 @_mm_setr_epi32(i32 %9, i32 %8, i32 %7, i32 %0)
%12 = load volatile i32, i32* %4
%13 = load volatile i32, i32* %3
%14 = tail call i32 @_mm_setr_epi32(i32 %12, i32 0, i32 %13, i32 0)
%15 = load volatile i32, i32* %4
%16 = sitofp i32 %15 to double
%17 = load volatile i32, i32* %3
%18 = sitofp i32 %17 to double
%19 = tail call i32 @_mm_set_pd(double %16, double %18)
%20 = tail call i32 @_mm_setr_epi32(i32 2, i32 0, i32 0, i32 0)
%21 = tail call i32 @_mm_srl_epi64(i32 %14, i32 %20)
%22 = tail call i32 @_mm_mullo_epi16(i32 %10, i32 %11)
%23 = tail call i32 @_mm_slli_epi64(i32 %22, i32 1)
%24 = tail call i32 @_mm_unpacklo_epi32(i32 %23, i32 %11)
%25 = tail call i32 @_mm_xor_si128(i32 %11, i32 %24)
%26 = tail call i32 @_mm_srli_epi64(i32 %25, i32 1)
%27 = tail call i32 @_mm_mullo_epi16(i32 %26, i32 %11)
%28 = tail call i32 @_mm_shuffle_epi32(i32 %27, i32 78)
%29 = tail call i32 @_mm_unpacklo_epi32(i32 %28, i32 %11)
%30 = tail call i32 @_mm_xor_si128(i32 %11, i32 %29)
%31 = tail call i32 @_mm_srli_si128(i32 %30, i32 1)
%32 = tail call i32 @_mm_xor_si128(i32 %31, i32 %21)
%33 = tail call i32 @_mm_extract_epi16(i32 %32, i32 0)
%34 = add nsw i32 %0, -1
%35 = and i32 %33, %34
ret i32 %35
}