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

/* Variables and functions */
int /*<<< orphan*/ _mm_load_si128(int /*<<< orphan*/ *);
int /*<<< orphan*/ _mm_set_epi32(int, int, int, int);
int /*<<< orphan*/ _mm_set_epi8(int, int, int, int, int, int, int, int, int,
                                int, int, int, int, int, int, int);
int /*<<< orphan*/ _mm_setzero_si128();
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ morus_stateupdate(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ **);
void morus_initialization(const uint8_t *key, const uint8_t *iv,
                          __m128i (*state)[2]) {
  int i;
  __m128i tmp[2];
  tmp[0] = _mm_setzero_si128();
  tmp[1] = _mm_setzero_si128();
  state[0][0] = _mm_load_si128((__m128i *)iv);
  state[0][1] = _mm_setzero_si128();
  state[1][0] = _mm_load_si128((__m128i *)key);
  state[1][1] = _mm_load_si128((__m128i *)key);
  state[2][0] = _mm_set_epi32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff);
  state[2][1] = _mm_set_epi32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff);
  state[3][0] = _mm_setzero_si128();
  state[3][1] = _mm_setzero_si128();
  state[4][0] = _mm_set_epi8(0x62, 0x79, 0xe9, 0x90, 0x59, 0x37, 0x22, 0x15,
                             0x0d, 0x08, 0x05, 0x03, 0x02, 0x01, 0x1, 0x0);
  state[4][1] = _mm_set_epi8(0xdd, 0x28, 0xb5, 0x73, 0x42, 0x31, 0x11, 0x20,
                             0xf1, 0x2f, 0xc2, 0x6d, 0x55, 0x18, 0x3d, 0xdb);
  for (i = 0; i < 16; i++)
    morus_stateupdate(tmp, state);
  state[1][0] = _mm_xor_si128((state[1][0]), (_mm_load_si128((__m128i *)key)));
  state[1][1] = _mm_xor_si128((state[1][1]), (_mm_load_si128((__m128i *)key)));
}


x86 assembly (clang, -O0):
<morus_initialization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <_mm_setzero_si128@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1040 <_mm_setzero_si128@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <_mm_setzero_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    $0xffffffff,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1050 <_mm_set_epi32@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    $0xffffffff,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1050 <_mm_set_epi32@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    $0x0,%al
call   1040 <_mm_setzero_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    $0x0,%al
call   1040 <_mm_setzero_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    $0x62,%edi
mov    $0x79,%esi
mov    $0xe9,%edx
mov    $0x90,%ecx
mov    $0x59,%r8d
mov    $0x37,%r9d
xor    %eax,%eax
movl   $0x22,(%rsp)
movl   $0x15,0x8(%rsp)
movl   $0xd,0x10(%rsp)
movl   $0x8,0x18(%rsp)
movl   $0x5,0x20(%rsp)
movl   $0x3,0x28(%rsp)
movl   $0x2,0x30(%rsp)
movl   $0x1,0x38(%rsp)
movl   $0x1,0x40(%rsp)
movl   $0x0,0x48(%rsp)
call   1060 <_mm_set_epi8@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    $0xdd,%edi
mov    $0x28,%esi
mov    $0xb5,%edx
mov    $0x73,%ecx
mov    $0x42,%r8d
mov    $0x31,%r9d
movl   $0x11,(%rsp)
movl   $0x20,0x8(%rsp)
movl   $0xf1,0x10(%rsp)
movl   $0x2f,0x18(%rsp)
movl   $0xc2,0x20(%rsp)
movl   $0x6d,0x28(%rsp)
movl   $0x55,0x30(%rsp)
movl   $0x18,0x38(%rsp)
movl   $0x3d,0x40(%rsp)
movl   $0xdb,0x48(%rsp)
call   1060 <_mm_set_epi8@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x24(%rax)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    134a <morus_initialization+0x1ea>
lea    -0x24(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <morus_stateupdate@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1325 <morus_initialization+0x1c5>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_mm_load_si128@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
call   1070 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_mm_load_si128@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%esi
call   1070 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<morus_initialization>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <_mm_setzero_si128@plt>
mov    %eax,(%rsp)
xor    %eax,%eax
call   1040 <_mm_setzero_si128@plt>
mov    %eax,0x4(%rsp)
mov    %r15,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1040 <_mm_setzero_si128@plt>
mov    %eax,0x4(%rbx)
mov    %r14,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,0x8(%rbx)
mov    %r14,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,0xc(%rbx)
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
call   1050 <_mm_set_epi32@plt>
mov    %eax,0x10(%rbx)
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
call   1050 <_mm_set_epi32@plt>
mov    %eax,0x14(%rbx)
xor    %eax,%eax
call   1040 <_mm_setzero_si128@plt>
mov    %eax,0x18(%rbx)
xor    %eax,%eax
call   1040 <_mm_setzero_si128@plt>
mov    %eax,0x1c(%rbx)
mov    $0x62,%edi
mov    $0x79,%esi
mov    $0xe9,%edx
mov    $0x90,%ecx
mov    $0x59,%r8d
mov    $0x37,%r9d
push   $0x0
push   $0x1
push   $0x1
push   $0x2
push   $0x3
push   $0x5
push   $0x8
push   $0xd
push   $0x15
push   $0x22
call   1060 <_mm_set_epi8@plt>
add    $0x50,%rsp
mov    %eax,0x20(%rbx)
mov    $0xdd,%edi
mov    $0x28,%esi
mov    $0xb5,%edx
mov    $0x73,%ecx
mov    $0x42,%r8d
mov    $0x31,%r9d
push   $0xdb
push   $0x3d
push   $0x18
push   $0x55
push   $0x6d
push   $0xc2
push   $0x2f
push   $0xf1
push   $0x20
push   $0x11
call   1060 <_mm_set_epi8@plt>
add    $0x50,%rsp
mov    %eax,0x24(%rbx)
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <morus_stateupdate@plt>
mov    0x8(%rbx),%ebp
mov    %r14,%rdi
call   1030 <_mm_load_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1070 <_mm_xor_si128@plt>
mov    %eax,0x8(%rbx)
mov    0xc(%rbx),%ebp
mov    %r14,%rdi
call   1030 <_mm_load_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1070 <_mm_xor_si128@plt>
mov    %eax,0xc(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @morus_initialization(i32* %0, i32* %1, [2 x i32]* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca [2 x i32]*
%7 = alloca i32
%8 = alloca [2 x i32]
store i32* %0, i32** %4
store i32* %1, i32** %5
store [2 x i32]* %2, [2 x i32]** %6
%9 = call i32 (...) @_mm_setzero_si128()
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
store i32 %9, i32* %10
%11 = call i32 (...) @_mm_setzero_si128()
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
store i32 %11, i32* %12
%13 = load i32*, i32** %5
%14 = call i32 @_mm_load_si128(i32* %13)
%15 = load [2 x i32]*, [2 x i32]** %6
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 0
store i32 %14, i32* %17
%18 = call i32 (...) @_mm_setzero_si128()
%19 = load [2 x i32]*, [2 x i32]** %6
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %20, i64 0, i64 1
store i32 %18, i32* %21
%22 = load i32*, i32** %4
%23 = call i32 @_mm_load_si128(i32* %22)
%24 = load [2 x i32]*, [2 x i32]** %6
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %24, i64 1
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %25, i64 0, i64 0
store i32 %23, i32* %26
%27 = load i32*, i32** %4
%28 = call i32 @_mm_load_si128(i32* %27)
%29 = load [2 x i32]*, [2 x i32]** %6
%30 = getelementptr inbounds [2 x i32], [2 x i32]* %29, i64 1
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 1
store i32 %28, i32* %31
%32 = call i32 @_mm_set_epi32(i32 -1, i32 -1, i32 -1, i32 -1)
%33 = load [2 x i32]*, [2 x i32]** %6
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %33, i64 2
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %34, i64 0, i64 0
store i32 %32, i32* %35
%36 = call i32 @_mm_set_epi32(i32 -1, i32 -1, i32 -1, i32 -1)
%37 = load [2 x i32]*, [2 x i32]** %6
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %37, i64 2
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %38, i64 0, i64 1
store i32 %36, i32* %39
%40 = call i32 (...) @_mm_setzero_si128()
%41 = load [2 x i32]*, [2 x i32]** %6
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %41, i64 3
%43 = getelementptr inbounds [2 x i32], [2 x i32]* %42, i64 0, i64 0
store i32 %40, i32* %43
%44 = call i32 (...) @_mm_setzero_si128()
%45 = load [2 x i32]*, [2 x i32]** %6
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %45, i64 3
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %46, i64 0, i64 1
store i32 %44, i32* %47
%48 = call i32 @_mm_set_epi8(i32 98, i32 121, i32 233, i32 144, i32 89, i32 55, i32 34, i32 21, i32 13, i32 8, i32 5, i32 3, i32 2, i32 1, i32 1, i32 0)
%49 = load [2 x i32]*, [2 x i32]** %6
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %49, i64 4
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %50, i64 0, i64 0
store i32 %48, i32* %51
%52 = call i32 @_mm_set_epi8(i32 221, i32 40, i32 181, i32 115, i32 66, i32 49, i32 17, i32 32, i32 241, i32 47, i32 194, i32 109, i32 85, i32 24, i32 61, i32 219)
%53 = load [2 x i32]*, [2 x i32]** %6
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %53, i64 4
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %54, i64 0, i64 1
store i32 %52, i32* %55
store i32 0, i32* %7
br label %56
56: ; preds = %64, %3
%57 = load i32, i32* %7
%58 = icmp slt i32 %57, 16
br i1 %58, label %59, label %67
59: ; preds = %56
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%61 = load [2 x i32]*, [2 x i32]** %6
%62 = bitcast [2 x i32]* %61 to i32**
%63 = call i32 @morus_stateupdate(i32* %60, i32** %62)
br label %64
64: ; preds = %59
%65 = load i32, i32* %7
%66 = add nsw i32 %65, 1
store i32 %66, i32* %7
br label %56
67: ; preds = %56
%68 = load [2 x i32]*, [2 x i32]** %6
%69 = getelementptr inbounds [2 x i32], [2 x i32]* %68, i64 1
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %69, i64 0, i64 0
%71 = load i32, i32* %70
%72 = load i32*, i32** %4
%73 = call i32 @_mm_load_si128(i32* %72)
%74 = call i32 @_mm_xor_si128(i32 %71, i32 %73)
%75 = load [2 x i32]*, [2 x i32]** %6
%76 = getelementptr inbounds [2 x i32], [2 x i32]* %75, i64 1
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %76, i64 0, i64 0
store i32 %74, i32* %77
%78 = load [2 x i32]*, [2 x i32]** %6
%79 = getelementptr inbounds [2 x i32], [2 x i32]* %78, i64 1
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %79, i64 0, i64 1
%81 = load i32, i32* %80
%82 = load i32*, i32** %4
%83 = call i32 @_mm_load_si128(i32* %82)
%84 = call i32 @_mm_xor_si128(i32 %81, i32 %83)
%85 = load [2 x i32]*, [2 x i32]** %6
%86 = getelementptr inbounds [2 x i32], [2 x i32]* %85, i64 1
%87 = getelementptr inbounds [2 x i32], [2 x i32]* %86, i64 0, i64 1
store i32 %84, i32* %87
ret void
}

LLVM IR (-O2):
define void @morus_initialization(i32* %0, i32* %1, [2 x i32]* %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = tail call i32 (...) @_mm_setzero_si128()
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %6, i32* %7
%8 = tail call i32 (...) @_mm_setzero_si128()
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %8, i32* %9
%10 = tail call i32 @_mm_load_si128(i32* %1)
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 %10, i32* %11
%12 = tail call i32 (...) @_mm_setzero_si128()
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32 %12, i32* %13
%14 = tail call i32 @_mm_load_si128(i32* %0)
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 1, i64 0
store i32 %14, i32* %15
%16 = tail call i32 @_mm_load_si128(i32* %0)
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 1, i64 1
store i32 %16, i32* %17
%18 = tail call i32 @_mm_set_epi32(i32 -1, i32 -1, i32 -1, i32 -1)
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 2, i64 0
store i32 %18, i32* %19
%20 = tail call i32 @_mm_set_epi32(i32 -1, i32 -1, i32 -1, i32 -1)
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 2, i64 1
store i32 %20, i32* %21
%22 = tail call i32 (...) @_mm_setzero_si128()
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 3, i64 0
store i32 %22, i32* %23
%24 = tail call i32 (...) @_mm_setzero_si128()
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 3, i64 1
store i32 %24, i32* %25
%26 = tail call i32 @_mm_set_epi8(i32 98, i32 121, i32 233, i32 144, i32 89, i32 55, i32 34, i32 21, i32 13, i32 8, i32 5, i32 3, i32 2, i32 1, i32 1, i32 0)
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 4, i64 0
store i32 %26, i32* %27
%28 = tail call i32 @_mm_set_epi8(i32 221, i32 40, i32 181, i32 115, i32 66, i32 49, i32 17, i32 32, i32 241, i32 47, i32 194, i32 109, i32 85, i32 24, i32 61, i32 219)
%29 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 4, i64 1
store i32 %28, i32* %29
%30 = bitcast [2 x i32]* %2 to i32**
%31 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%32 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%33 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%34 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%35 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%36 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%37 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%38 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%39 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%40 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%41 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%42 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%43 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%44 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%45 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%46 = call i32 @morus_stateupdate(i32* %7, i32** %30)
%47 = load i32, i32* %15
%48 = call i32 @_mm_load_si128(i32* %0)
%49 = call i32 @_mm_xor_si128(i32 %47, i32 %48)
store i32 %49, i32* %15
%50 = load i32, i32* %17
%51 = call i32 @_mm_load_si128(i32* %0)
%52 = call i32 @_mm_xor_si128(i32 %50, i32 %51)
store i32 %52, i32* %17
ret void
}