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

/* Variables and functions */
int /*<<< orphan*/ _mm_blend_epi16(int /*<<< orphan*/, int /*<<< orphan*/, int);
int _mm_extract_epi16(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ xor_salsa_sidm(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int);
void scrypt_core_sidm(__m128i *X, uint32_t Loops, uint32_t double_rounds) {
  uint32_t i, j;
  __m128i scratch[Loops * 8];
  __m128i *calc_1 = (__m128i *)&X[0];
  __m128i *calc_2 = (__m128i *)&X[1];
  __m128i *calc_3 = (__m128i *)&X[2];
  __m128i *calc_4 = (__m128i *)&X[3];
  __m128i *calc_11 = (__m128i *)&X[4];
  __m128i *calc_21 = (__m128i *)&X[5];
  __m128i *calc_31 = (__m128i *)&X[6];
  __m128i *calc_41 = (__m128i *)&X[7];
  __m128i _calc5;
  __m128i _calc6;
  __m128i _calc7;
  __m128i _calc8;
  _calc5 = _mm_blend_epi16(*calc_11, *calc_31, 0xf0);
  _calc6 = _mm_blend_epi16(*calc_21, *calc_41, 0x0f);
  _calc7 = _mm_blend_epi16(*calc_31, *calc_11, 0xf0);
  _calc8 = _mm_blend_epi16(*calc_41, *calc_21, 0x0f);
  *calc_11 = _mm_blend_epi16(_calc5, _calc8, 0xcc);
  *calc_21 = _mm_blend_epi16(_calc6, _calc5, 0xcc);
  *calc_31 = _mm_blend_epi16(_calc7, _calc6, 0xcc);
  *calc_41 = _mm_blend_epi16(_calc8, _calc7, 0xcc);
  _calc5 = _mm_blend_epi16(*calc_1, *calc_3, 0xf0);
  _calc6 = _mm_blend_epi16(*calc_2, *calc_4, 0x0f);
  _calc7 = _mm_blend_epi16(*calc_3, *calc_1, 0xf0);
  _calc8 = _mm_blend_epi16(*calc_4, *calc_2, 0x0f);
  *calc_1 = _mm_blend_epi16(_calc5, _calc8, 0xcc);
  *calc_2 = _mm_blend_epi16(_calc6, _calc5, 0xcc);
  *calc_3 = _mm_blend_epi16(_calc7, _calc6, 0xcc);
  *calc_4 = _mm_blend_epi16(_calc8, _calc7, 0xcc);
  for (i = 0; i < Loops; i++) {
    scratch[i * 8 + 0] = *calc_1;
    scratch[i * 8 + 1] = *calc_2;
    scratch[i * 8 + 2] = *calc_3;
    scratch[i * 8 + 3] = *calc_4;
    scratch[i * 8 + 4] = *calc_11;
    scratch[i * 8 + 5] = *calc_21;
    scratch[i * 8 + 6] = *calc_31;
    scratch[i * 8 + 7] = *calc_41;
    xor_salsa_sidm(calc_1, calc_2, calc_3, calc_4, calc_11, calc_21, calc_31,
                   calc_41, double_rounds);
    xor_salsa_sidm(calc_11, calc_21, calc_31, calc_41, calc_1, calc_2, calc_3,
                   calc_4, double_rounds);
  }
  for (i = 0; i < Loops; i++) {
    j = 8 * (_mm_extract_epi16(*calc_11, 0x00) & (Loops - 1));
    *calc_1 = _mm_xor_si128(*calc_1, scratch[j]);
    *calc_2 = _mm_xor_si128(*calc_2, scratch[j + 1]);
    *calc_3 = _mm_xor_si128(*calc_3, scratch[j + 2]);
    *calc_4 = _mm_xor_si128(*calc_4, scratch[j + 3]);
    *calc_11 = _mm_xor_si128(*calc_11, scratch[j + 4]);
    *calc_21 = _mm_xor_si128(*calc_21, scratch[j + 5]);
    *calc_31 = _mm_xor_si128(*calc_31, scratch[j + 6]);
    *calc_41 = _mm_xor_si128(*calc_41, scratch[j + 7]);
    xor_salsa_sidm(calc_1, calc_2, calc_3, calc_4, calc_11, calc_21, calc_31,
                   calc_41, double_rounds);
    xor_salsa_sidm(calc_11, calc_21, calc_31, calc_41, calc_1, calc_2, calc_3,
                   calc_4, double_rounds);
  }
  _calc5 = _mm_blend_epi16(*calc_11, *calc_31, 0xf0);
  _calc6 = _mm_blend_epi16(*calc_21, *calc_41, 0x0f);
  _calc7 = _mm_blend_epi16(*calc_31, *calc_11, 0xf0);
  _calc8 = _mm_blend_epi16(*calc_41, *calc_21, 0x0f);
  *calc_11 = _mm_blend_epi16(_calc5, _calc8, 0xcc);
  *calc_21 = _mm_blend_epi16(_calc6, _calc5, 0xcc);
  *calc_31 = _mm_blend_epi16(_calc7, _calc6, 0xcc);
  *calc_41 = _mm_blend_epi16(_calc8, _calc7, 0xcc);
  _calc5 = _mm_blend_epi16(*calc_1, *calc_3, 0xf0);
  _calc6 = _mm_blend_epi16(*calc_2, *calc_4, 0x0f);
  _calc7 = _mm_blend_epi16(*calc_3, *calc_1, 0xf0);
  _calc8 = _mm_blend_epi16(*calc_4, *calc_2, 0x0f);
  *calc_1 = _mm_blend_epi16(_calc5, _calc8, 0xcc);
  *calc_2 = _mm_blend_epi16(_calc6, _calc5, 0xcc);
  *calc_3 = _mm_blend_epi16(_calc7, _calc6, 0xcc);
  *calc_4 = _mm_blend_epi16(_calc8, _calc7, 0xcc);
}


x86 assembly (clang, -O0):
<scrypt_core_sidm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
shl    $0x2,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1c,%rax
mov    %rax,-0x68(%rbp)
mov    -0x50(%rbp),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rax
mov    (%rax),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%rax
mov    (%rax),%edi
mov    -0x68(%rbp),%rax
mov    (%rax),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x70(%rbp)
mov    -0x60(%rbp),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rax
mov    (%rax),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x74(%rbp)
mov    -0x68(%rbp),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rax
mov    (%rax),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x78(%rbp)
mov    -0x6c(%rbp),%edi
mov    -0x78(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x70(%rbp),%edi
mov    -0x6c(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x74(%rbp),%edi
mov    -0x70(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x78(%rbp),%edi
mov    -0x74(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rax
mov    (%rax),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rax
mov    (%rax),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x70(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x74(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x78(%rbp)
mov    -0x6c(%rbp),%edi
mov    -0x78(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x70(%rbp),%edi
mov    -0x6c(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x74(%rbp),%edi
mov    -0x70(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x78(%rbp),%edi
mov    -0x74(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    14a5 <scrypt_core_sidm+0x365>
mov    -0x80(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rcx),%edx
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x38(%rbp),%rcx
mov    (%rcx),%edx
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x40(%rbp),%rcx
mov    (%rcx),%edx
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x48(%rbp),%rcx
mov    (%rcx),%edx
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x50(%rbp),%rcx
mov    (%rcx),%edx
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x58(%rbp),%rcx
mov    (%rcx),%edx
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x60(%rbp),%rcx
mov    (%rcx),%edx
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x68(%rbp),%rcx
mov    (%rcx),%edx
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    $0x7,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    -0x60(%rbp),%r11
mov    -0x68(%rbp),%r10
mov    -0x10(%rbp),%eax
sub    $0x20,%rsp
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1060 <xor_salsa_sidm@plt>
add    $0x20,%rsp
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    -0x40(%rbp),%r11
mov    -0x48(%rbp),%r10
mov    -0x10(%rbp),%eax
sub    $0x20,%rsp
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1060 <xor_salsa_sidm@plt>
add    $0x20,%rsp
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1365 <scrypt_core_sidm+0x225>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1670 <scrypt_core_sidm+0x530>
mov    -0x50(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <_mm_extract_epi16@plt>
mov    %eax,%ecx
mov    -0x80(%rbp),%rax
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
and    %edx,%ecx
shl    $0x3,%ecx
mov    %ecx,-0x18(%rbp)
mov    -0x30(%rbp),%rcx
mov    (%rcx),%edi
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%edx
mov    -0x80(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %edx,(%rcx)
mov    -0x38(%rbp),%rcx
mov    (%rcx),%edi
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%edx
mov    -0x80(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %edx,(%rcx)
mov    -0x40(%rbp),%rcx
mov    (%rcx),%edi
mov    -0x18(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%edx
mov    -0x80(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    %edx,(%rcx)
mov    -0x48(%rbp),%rcx
mov    (%rcx),%edi
mov    -0x18(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%edx
mov    -0x80(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %edx,(%rcx)
mov    -0x50(%rbp),%rcx
mov    (%rcx),%edi
mov    -0x18(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%edx
mov    -0x80(%rbp),%rax
mov    -0x50(%rbp),%rcx
mov    %edx,(%rcx)
mov    -0x58(%rbp),%rcx
mov    (%rcx),%edi
mov    -0x18(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%edx
mov    -0x80(%rbp),%rax
mov    -0x58(%rbp),%rcx
mov    %edx,(%rcx)
mov    -0x60(%rbp),%rcx
mov    (%rcx),%edi
mov    -0x18(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%edx
mov    -0x80(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    %edx,(%rcx)
mov    -0x68(%rbp),%rcx
mov    (%rcx),%edi
mov    -0x18(%rbp),%ecx
add    $0x7,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    -0x60(%rbp),%r11
mov    -0x68(%rbp),%r10
mov    -0x10(%rbp),%eax
sub    $0x20,%rsp
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1060 <xor_salsa_sidm@plt>
add    $0x20,%rsp
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    -0x40(%rbp),%r11
mov    -0x48(%rbp),%r10
mov    -0x10(%rbp),%eax
sub    $0x20,%rsp
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1060 <xor_salsa_sidm@plt>
add    $0x20,%rsp
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14ac <scrypt_core_sidm+0x36c>
mov    -0x50(%rbp),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rax
mov    (%rax),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x58(%rbp),%rax
mov    (%rax),%edi
mov    -0x68(%rbp),%rax
mov    (%rax),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x70(%rbp)
mov    -0x60(%rbp),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rax
mov    (%rax),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x74(%rbp)
mov    -0x68(%rbp),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rax
mov    (%rax),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x78(%rbp)
mov    -0x6c(%rbp),%edi
mov    -0x78(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x70(%rbp),%edi
mov    -0x6c(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x74(%rbp),%edi
mov    -0x70(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x78(%rbp),%edi
mov    -0x74(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rax
mov    (%rax),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rax
mov    (%rax),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x70(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x74(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x78(%rbp)
mov    -0x6c(%rbp),%edi
mov    -0x78(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x70(%rbp),%edi
mov    -0x6c(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x74(%rbp),%edi
mov    -0x70(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x78(%rbp),%edi
mov    -0x74(%rbp),%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrypt_core_sidm>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdx,-0x48(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdi,%r15
lea    0x0(,%rsi,8),%eax
mov    %rsp,%rbx
shl    $0x2,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x10(%rdi),%edi
mov    0x18(%r15),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r13d
mov    0x14(%r15),%edi
mov    0x1c(%r15),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r12d
mov    0x10(%r15),%esi
mov    0x18(%r15),%edi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x30(%rbp)
mov    0x14(%r15),%esi
mov    0x1c(%r15),%edi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r14d
mov    %r13d,%edi
mov    %eax,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x10(%r15)
mov    %r12d,%edi
mov    %r13d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x14(%r15)
mov    -0x30(%rbp),%r13d
mov    %r13d,%edi
mov    %r12d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x18(%r15)
mov    %r14d,%edi
mov    %r13d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x1c(%r15)
mov    (%r15),%edi
mov    0x8(%r15),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r13d
mov    0x4(%r15),%edi
mov    0xc(%r15),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r12d
mov    (%r15),%esi
mov    0x8(%r15),%edi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r14d
mov    0x4(%r15),%esi
mov    0xc(%r15),%edi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,-0x30(%rbp)
mov    %r13d,%edi
mov    %eax,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,(%r15)
mov    %r12d,%edi
mov    %r13d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x4(%r15)
mov    %r14d,%edi
mov    %r12d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x8(%r15)
mov    -0x30(%rbp),%edi
mov    -0x40(%rbp),%r13
mov    %r14d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %r15,-0x38(%rbp)
mov    %eax,0xc(%r15)
test   %r13d,%r13d
jle    1565 <scrypt_core_sidm+0x425>
mov    -0x38(%rbp),%rsi
lea    0x4(%rsi),%rcx
mov    %rcx,-0x50(%rbp)
lea    0x8(%rsi),%rdx
lea    0xc(%rsi),%rcx
mov    %rcx,-0x30(%rbp)
lea    0x10(%rsi),%r14
lea    0x14(%rsi),%r9
lea    0x18(%rsi),%r11
lea    0x1c(%rsi),%r15
mov    %r13d,%esi
shl    $0x5,%rsi
add    $0xffffffffffffffe0,%rsi
mov    %rsi,-0x58(%rbp)
xor    %r12d,%r12d
mov    -0x48(%rbp),%r10
mov    %rbx,-0x80(%rbp)
mov    %r14,-0x78(%rbp)
mov    %r9,-0x70(%rbp)
mov    %r11,-0x68(%rbp)
mov    %r15,-0x60(%rbp)
mov    %rdx,-0x88(%rbp)
mov    -0x38(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,(%rbx,%r12,1)
mov    0x4(%rsi),%ecx
mov    %ecx,0x4(%rbx,%r12,1)
mov    0x8(%rsi),%ecx
mov    %ecx,0x8(%rbx,%r12,1)
mov    %eax,0xc(%rbx,%r12,1)
movups 0x10(%rsi),%xmm0
mov    %rsi,%rdi
movaps %xmm0,0x10(%rbx,%r12,1)
sub    $0x8,%rsp
mov    -0x50(%rbp),%rsi
mov    -0x30(%rbp),%rcx
mov    %r14,%r8
mov    %r9,%rbx
push   %r10
push   %r15
push   %r11
mov    %r11,%r13
call   1060 <xor_salsa_sidm@plt>
add    $0x18,%rsp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    -0x88(%rbp),%rax
mov    -0x38(%rbp),%r8
mov    -0x50(%rbp),%r9
mov    -0x48(%rbp),%rbx
mov    %rbx,%r14
push   %rbx
push   -0x30(%rbp)
mov    %rax,%r13
push   %rax
call   1060 <xor_salsa_sidm@plt>
add    $0x20,%rsp
cmp    %r12,-0x58(%rbp)
je     13d2 <scrypt_core_sidm+0x292>
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
add    $0x20,%r12
mov    %r14,%r10
mov    -0x80(%rbp),%rbx
mov    %r13,%rdx
mov    -0x78(%rbp),%r14
mov    -0x70(%rbp),%r9
mov    -0x68(%rbp),%r11
mov    -0x60(%rbp),%r15
jmp    1320 <scrypt_core_sidm+0x1e0>
mov    -0x40(%rbp),%rax
test   %eax,%eax
mov    -0x50(%rbp),%r15
jle    1565 <scrypt_core_sidm+0x425>
lea    -0x1(%rax),%ecx
mov    %ecx,-0x58(%rbp)
mov    -0x38(%rbp),%r14
nopl   0x0(%rax)
mov    %rax,-0x40(%rbp)
mov    0x10(%r14),%edi
xor    %esi,%esi
call   1030 <_mm_extract_epi16@plt>
mov    %r15,%rbx
mov    %eax,%r12d
and    -0x58(%rbp),%r12d
lea    0x0(,%r12,8),%eax
mov    (%r14),%edi
cltq
mov    %r13,%r15
mov    -0x80(%rbp),%r13
mov    0x0(%r13,%rax,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,(%r14)
mov    0x4(%r14),%edi
lea    0x1(,%r12,8),%eax
cltq
mov    0x0(%r13,%rax,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,0x4(%r14)
mov    0x8(%r14),%edi
lea    0x2(,%r12,8),%eax
cltq
mov    0x0(%r13,%rax,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,0x8(%r14)
mov    0xc(%r14),%edi
lea    0x3(,%r12,8),%eax
cltq
mov    0x0(%r13,%rax,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,0xc(%r14)
mov    0x10(%r14),%edi
lea    0x4(,%r12,8),%eax
cltq
mov    0x0(%r13,%rax,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,0x10(%r14)
mov    0x14(%r14),%edi
lea    0x5(,%r12,8),%eax
cltq
mov    0x0(%r13,%rax,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,0x14(%r14)
mov    0x18(%r14),%edi
lea    0x6(,%r12,8),%eax
cltq
mov    0x0(%r13,%rax,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,0x18(%r14)
mov    0x1c(%r14),%edi
lea    0x7(,%r12,8),%eax
cltq
mov    0x0(%r13,%rax,4),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,0x1c(%r14)
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    -0x30(%rbp),%rcx
mov    -0x78(%rbp),%r15
mov    %r15,%r8
mov    -0x70(%rbp),%r13
mov    %r13,%r9
push   -0x48(%rbp)
mov    -0x60(%rbp),%r12
push   %r12
mov    -0x68(%rbp),%rbx
push   %rbx
call   1060 <xor_salsa_sidm@plt>
add    $0x18,%rsp
mov    %r15,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %r14,%r8
mov    -0x50(%rbp),%r9
mov    %r9,%r15
mov    -0x48(%rbp),%rax
push   %rax
mov    -0x30(%rbp),%rax
push   %rax
mov    -0x88(%rbp),%rax
mov    %rax,%r13
push   %rax
call   1060 <xor_salsa_sidm@plt>
mov    -0x40(%rbp),%rax
add    $0x20,%rsp
add    $0xffffffff,%eax
jne    13f0 <scrypt_core_sidm+0x2b0>
mov    -0x38(%rbp),%rbx
mov    0x10(%rbx),%edi
mov    0x18(%rbx),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r14d
mov    0x14(%rbx),%edi
mov    0x1c(%rbx),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r15d
mov    0x10(%rbx),%esi
mov    0x18(%rbx),%edi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r12d
mov    0x14(%rbx),%esi
mov    0x1c(%rbx),%edi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r13d
mov    %r14d,%edi
mov    %eax,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x10(%rbx)
mov    %r15d,%edi
mov    %r14d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x14(%rbx)
mov    %r12d,%edi
mov    %r15d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x18(%rbx)
mov    %r13d,%edi
mov    %r12d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x1c(%rbx)
mov    (%rbx),%edi
mov    0x8(%rbx),%esi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r14d
mov    0x4(%rbx),%edi
mov    0xc(%rbx),%esi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r15d
mov    (%rbx),%esi
mov    0x8(%rbx),%edi
mov    $0xf0,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r12d
mov    0x4(%rbx),%esi
mov    0xc(%rbx),%edi
mov    $0xf,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,%r13d
mov    %r14d,%edi
mov    %eax,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,(%rbx)
mov    %r15d,%edi
mov    %r14d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x4(%rbx)
mov    %r12d,%edi
mov    %r15d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0x8(%rbx)
mov    %r13d,%edi
mov    %r12d,%esi
mov    $0xcc,%edx
call   1040 <_mm_blend_epi16@plt>
mov    %eax,0xc(%rbx)
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @scrypt_core_sidm(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%23 = load i32, i32* %5
%24 = mul nsw i32 %23, 8
%25 = zext i32 %24 to i64
%26 = call i8* @llvm.stacksave()
store i8* %26, i8** %9
%27 = alloca i32, i64 %25
store i64 %25, i64* %10
%28 = load i32*, i32** %4
%29 = getelementptr inbounds i32, i32* %28, i64 0
store i32* %29, i32** %11
%30 = load i32*, i32** %4
%31 = getelementptr inbounds i32, i32* %30, i64 1
store i32* %31, i32** %12
%32 = load i32*, i32** %4
%33 = getelementptr inbounds i32, i32* %32, i64 2
store i32* %33, i32** %13
%34 = load i32*, i32** %4
%35 = getelementptr inbounds i32, i32* %34, i64 3
store i32* %35, i32** %14
%36 = load i32*, i32** %4
%37 = getelementptr inbounds i32, i32* %36, i64 4
store i32* %37, i32** %15
%38 = load i32*, i32** %4
%39 = getelementptr inbounds i32, i32* %38, i64 5
store i32* %39, i32** %16
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i64 6
store i32* %41, i32** %17
%42 = load i32*, i32** %4
%43 = getelementptr inbounds i32, i32* %42, i64 7
store i32* %43, i32** %18
%44 = load i32*, i32** %15
%45 = load i32, i32* %44
%46 = load i32*, i32** %17
%47 = load i32, i32* %46
%48 = call i32 @_mm_blend_epi16(i32 %45, i32 %47, i32 240)
store i32 %48, i32* %19
%49 = load i32*, i32** %16
%50 = load i32, i32* %49
%51 = load i32*, i32** %18
%52 = load i32, i32* %51
%53 = call i32 @_mm_blend_epi16(i32 %50, i32 %52, i32 15)
store i32 %53, i32* %20
%54 = load i32*, i32** %17
%55 = load i32, i32* %54
%56 = load i32*, i32** %15
%57 = load i32, i32* %56
%58 = call i32 @_mm_blend_epi16(i32 %55, i32 %57, i32 240)
store i32 %58, i32* %21
%59 = load i32*, i32** %18
%60 = load i32, i32* %59
%61 = load i32*, i32** %16
%62 = load i32, i32* %61
%63 = call i32 @_mm_blend_epi16(i32 %60, i32 %62, i32 15)
store i32 %63, i32* %22
%64 = load i32, i32* %19
%65 = load i32, i32* %22
%66 = call i32 @_mm_blend_epi16(i32 %64, i32 %65, i32 204)
%67 = load i32*, i32** %15
store i32 %66, i32* %67
%68 = load i32, i32* %20
%69 = load i32, i32* %19
%70 = call i32 @_mm_blend_epi16(i32 %68, i32 %69, i32 204)
%71 = load i32*, i32** %16
store i32 %70, i32* %71
%72 = load i32, i32* %21
%73 = load i32, i32* %20
%74 = call i32 @_mm_blend_epi16(i32 %72, i32 %73, i32 204)
%75 = load i32*, i32** %17
store i32 %74, i32* %75
%76 = load i32, i32* %22
%77 = load i32, i32* %21
%78 = call i32 @_mm_blend_epi16(i32 %76, i32 %77, i32 204)
%79 = load i32*, i32** %18
store i32 %78, i32* %79
%80 = load i32*, i32** %11
%81 = load i32, i32* %80
%82 = load i32*, i32** %13
%83 = load i32, i32* %82
%84 = call i32 @_mm_blend_epi16(i32 %81, i32 %83, i32 240)
store i32 %84, i32* %19
%85 = load i32*, i32** %12
%86 = load i32, i32* %85
%87 = load i32*, i32** %14
%88 = load i32, i32* %87
%89 = call i32 @_mm_blend_epi16(i32 %86, i32 %88, i32 15)
store i32 %89, i32* %20
%90 = load i32*, i32** %13
%91 = load i32, i32* %90
%92 = load i32*, i32** %11
%93 = load i32, i32* %92
%94 = call i32 @_mm_blend_epi16(i32 %91, i32 %93, i32 240)
store i32 %94, i32* %21
%95 = load i32*, i32** %14
%96 = load i32, i32* %95
%97 = load i32*, i32** %12
%98 = load i32, i32* %97
%99 = call i32 @_mm_blend_epi16(i32 %96, i32 %98, i32 15)
store i32 %99, i32* %22
%100 = load i32, i32* %19
%101 = load i32, i32* %22
%102 = call i32 @_mm_blend_epi16(i32 %100, i32 %101, i32 204)
%103 = load i32*, i32** %11
store i32 %102, i32* %103
%104 = load i32, i32* %20
%105 = load i32, i32* %19
%106 = call i32 @_mm_blend_epi16(i32 %104, i32 %105, i32 204)
%107 = load i32*, i32** %12
store i32 %106, i32* %107
%108 = load i32, i32* %21
%109 = load i32, i32* %20
%110 = call i32 @_mm_blend_epi16(i32 %108, i32 %109, i32 204)
%111 = load i32*, i32** %13
store i32 %110, i32* %111
%112 = load i32, i32* %22
%113 = load i32, i32* %21
%114 = call i32 @_mm_blend_epi16(i32 %112, i32 %113, i32 204)
%115 = load i32*, i32** %14
store i32 %114, i32* %115
store i32 0, i32* %7
br label %116
116: ; preds = %197, %3
%117 = load i32, i32* %7
%118 = load i32, i32* %5
%119 = icmp slt i32 %117, %118
br i1 %119, label %120, label %200
120: ; preds = %116
%121 = load i32*, i32** %11
%122 = load i32, i32* %121
%123 = load i32, i32* %7
%124 = mul nsw i32 %123, 8
%125 = add nsw i32 %124, 0
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i32, i32* %27, i64 %126
store i32 %122, i32* %127
%128 = load i32*, i32** %12
%129 = load i32, i32* %128
%130 = load i32, i32* %7
%131 = mul nsw i32 %130, 8
%132 = add nsw i32 %131, 1
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i32, i32* %27, i64 %133
store i32 %129, i32* %134
%135 = load i32*, i32** %13
%136 = load i32, i32* %135
%137 = load i32, i32* %7
%138 = mul nsw i32 %137, 8
%139 = add nsw i32 %138, 2
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i32, i32* %27, i64 %140
store i32 %136, i32* %141
%142 = load i32*, i32** %14
%143 = load i32, i32* %142
%144 = load i32, i32* %7
%145 = mul nsw i32 %144, 8
%146 = add nsw i32 %145, 3
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i32, i32* %27, i64 %147
store i32 %143, i32* %148
%149 = load i32*, i32** %15
%150 = load i32, i32* %149
%151 = load i32, i32* %7
%152 = mul nsw i32 %151, 8
%153 = add nsw i32 %152, 4
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i32, i32* %27, i64 %154
store i32 %150, i32* %155
%156 = load i32*, i32** %16
%157 = load i32, i32* %156
%158 = load i32, i32* %7
%159 = mul nsw i32 %158, 8
%160 = add nsw i32 %159, 5
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds i32, i32* %27, i64 %161
store i32 %157, i32* %162
%163 = load i32*, i32** %17
%164 = load i32, i32* %163
%165 = load i32, i32* %7
%166 = mul nsw i32 %165, 8
%167 = add nsw i32 %166, 6
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds i32, i32* %27, i64 %168
store i32 %164, i32* %169
%170 = load i32*, i32** %18
%171 = load i32, i32* %170
%172 = load i32, i32* %7
%173 = mul nsw i32 %172, 8
%174 = add nsw i32 %173, 7
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i32, i32* %27, i64 %175
store i32 %171, i32* %176
%177 = load i32*, i32** %11
%178 = load i32*, i32** %12
%179 = load i32*, i32** %13
%180 = load i32*, i32** %14
%181 = load i32*, i32** %15
%182 = load i32*, i32** %16
%183 = load i32*, i32** %17
%184 = load i32*, i32** %18
%185 = load i32, i32* %6
%186 = call i32 @xor_salsa_sidm(i32* %177, i32* %178, i32* %179, i32* %180, i32* %181, i32* %182, i32* %183, i32* %184, i32 %185)
%187 = load i32*, i32** %15
%188 = load i32*, i32** %16
%189 = load i32*, i32** %17
%190 = load i32*, i32** %18
%191 = load i32*, i32** %11
%192 = load i32*, i32** %12
%193 = load i32*, i32** %13
%194 = load i32*, i32** %14
%195 = load i32, i32* %6
%196 = call i32 @xor_salsa_sidm(i32* %187, i32* %188, i32* %189, i32* %190, i32* %191, i32* %192, i32* %193, i32* %194, i32 %195)
br label %197
197: ; preds = %120
%198 = load i32, i32* %7
%199 = add nsw i32 %198, 1
store i32 %199, i32* %7
br label %116
200: ; preds = %116
store i32 0, i32* %7
br label %201
201: ; preds = %304, %200
%202 = load i32, i32* %7
%203 = load i32, i32* %5
%204 = icmp slt i32 %202, %203
br i1 %204, label %205, label %307
205: ; preds = %201
%206 = load i32*, i32** %15
%207 = load i32, i32* %206
%208 = call i32 @_mm_extract_epi16(i32 %207, i32 0)
%209 = load i32, i32* %5
%210 = sub nsw i32 %209, 1
%211 = and i32 %208, %210
%212 = mul nsw i32 8, %211
store i32 %212, i32* %8
%213 = load i32*, i32** %11
%214 = load i32, i32* %213
%215 = load i32, i32* %8
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds i32, i32* %27, i64 %216
%218 = load i32, i32* %217
%219 = call i32 @_mm_xor_si128(i32 %214, i32 %218)
%220 = load i32*, i32** %11
store i32 %219, i32* %220
%221 = load i32*, i32** %12
%222 = load i32, i32* %221
%223 = load i32, i32* %8
%224 = add nsw i32 %223, 1
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds i32, i32* %27, i64 %225
%227 = load i32, i32* %226
%228 = call i32 @_mm_xor_si128(i32 %222, i32 %227)
%229 = load i32*, i32** %12
store i32 %228, i32* %229
%230 = load i32*, i32** %13
%231 = load i32, i32* %230
%232 = load i32, i32* %8
%233 = add nsw i32 %232, 2
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds i32, i32* %27, i64 %234
%236 = load i32, i32* %235
%237 = call i32 @_mm_xor_si128(i32 %231, i32 %236)
%238 = load i32*, i32** %13
store i32 %237, i32* %238
%239 = load i32*, i32** %14
%240 = load i32, i32* %239
%241 = load i32, i32* %8
%242 = add nsw i32 %241, 3
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds i32, i32* %27, i64 %243
%245 = load i32, i32* %244
%246 = call i32 @_mm_xor_si128(i32 %240, i32 %245)
%247 = load i32*, i32** %14
store i32 %246, i32* %247
%248 = load i32*, i32** %15
%249 = load i32, i32* %248
%250 = load i32, i32* %8
%251 = add nsw i32 %250, 4
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds i32, i32* %27, i64 %252
%254 = load i32, i32* %253
%255 = call i32 @_mm_xor_si128(i32 %249, i32 %254)
%256 = load i32*, i32** %15
store i32 %255, i32* %256
%257 = load i32*, i32** %16
%258 = load i32, i32* %257
%259 = load i32, i32* %8
%260 = add nsw i32 %259, 5
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds i32, i32* %27, i64 %261
%263 = load i32, i32* %262
%264 = call i32 @_mm_xor_si128(i32 %258, i32 %263)
%265 = load i32*, i32** %16
store i32 %264, i32* %265
%266 = load i32*, i32** %17
%267 = load i32, i32* %266
%268 = load i32, i32* %8
%269 = add nsw i32 %268, 6
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds i32, i32* %27, i64 %270
%272 = load i32, i32* %271
%273 = call i32 @_mm_xor_si128(i32 %267, i32 %272)
%274 = load i32*, i32** %17
store i32 %273, i32* %274
%275 = load i32*, i32** %18
%276 = load i32, i32* %275
%277 = load i32, i32* %8
%278 = add nsw i32 %277, 7
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds i32, i32* %27, i64 %279
%281 = load i32, i32* %280
%282 = call i32 @_mm_xor_si128(i32 %276, i32 %281)
%283 = load i32*, i32** %18
store i32 %282, i32* %283
%284 = load i32*, i32** %11
%285 = load i32*, i32** %12
%286 = load i32*, i32** %13
%287 = load i32*, i32** %14
%288 = load i32*, i32** %15
%289 = load i32*, i32** %16
%290 = load i32*, i32** %17
%291 = load i32*, i32** %18
%292 = load i32, i32* %6
%293 = call i32 @xor_salsa_sidm(i32* %284, i32* %285, i32* %286, i32* %287, i32* %288, i32* %289, i32* %290, i32* %291, i32 %292)
%294 = load i32*, i32** %15
%295 = load i32*, i32** %16
%296 = load i32*, i32** %17
%297 = load i32*, i32** %18
%298 = load i32*, i32** %11
%299 = load i32*, i32** %12
%300 = load i32*, i32** %13
%301 = load i32*, i32** %14
%302 = load i32, i32* %6
%303 = call i32 @xor_salsa_sidm(i32* %294, i32* %295, i32* %296, i32* %297, i32* %298, i32* %299, i32* %300, i32* %301, i32 %302)
br label %304
304: ; preds = %205
%305 = load i32, i32* %7
%306 = add nsw i32 %305, 1
store i32 %306, i32* %7
br label %201
307: ; preds = %201
%308 = load i32*, i32** %15
%309 = load i32, i32* %308
%310 = load i32*, i32** %17
%311 = load i32, i32* %310
%312 = call i32 @_mm_blend_epi16(i32 %309, i32 %311, i32 240)
store i32 %312, i32* %19
%313 = load i32*, i32** %16
%314 = load i32, i32* %313
%315 = load i32*, i32** %18
%316 = load i32, i32* %315
%317 = call i32 @_mm_blend_epi16(i32 %314, i32 %316, i32 15)
store i32 %317, i32* %20
%318 = load i32*, i32** %17
%319 = load i32, i32* %318
%320 = load i32*, i32** %15
%321 = load i32, i32* %320
%322 = call i32 @_mm_blend_epi16(i32 %319, i32 %321, i32 240)
store i32 %322, i32* %21
%323 = load i32*, i32** %18
%324 = load i32, i32* %323
%325 = load i32*, i32** %16
%326 = load i32, i32* %325
%327 = call i32 @_mm_blend_epi16(i32 %324, i32 %326, i32 15)
store i32 %327, i32* %22
%328 = load i32, i32* %19
%329 = load i32, i32* %22
%330 = call i32 @_mm_blend_epi16(i32 %328, i32 %329, i32 204)
%331 = load i32*, i32** %15
store i32 %330, i32* %331
%332 = load i32, i32* %20
%333 = load i32, i32* %19
%334 = call i32 @_mm_blend_epi16(i32 %332, i32 %333, i32 204)
%335 = load i32*, i32** %16
store i32 %334, i32* %335
%336 = load i32, i32* %21
%337 = load i32, i32* %20
%338 = call i32 @_mm_blend_epi16(i32 %336, i32 %337, i32 204)
%339 = load i32*, i32** %17
store i32 %338, i32* %339
%340 = load i32, i32* %22
%341 = load i32, i32* %21
%342 = call i32 @_mm_blend_epi16(i32 %340, i32 %341, i32 204)
%343 = load i32*, i32** %18
store i32 %342, i32* %343
%344 = load i32*, i32** %11
%345 = load i32, i32* %344
%346 = load i32*, i32** %13
%347 = load i32, i32* %346
%348 = call i32 @_mm_blend_epi16(i32 %345, i32 %347, i32 240)
store i32 %348, i32* %19
%349 = load i32*, i32** %12
%350 = load i32, i32* %349
%351 = load i32*, i32** %14
%352 = load i32, i32* %351
%353 = call i32 @_mm_blend_epi16(i32 %350, i32 %352, i32 15)
store i32 %353, i32* %20
%354 = load i32*, i32** %13
%355 = load i32, i32* %354
%356 = load i32*, i32** %11
%357 = load i32, i32* %356
%358 = call i32 @_mm_blend_epi16(i32 %355, i32 %357, i32 240)
store i32 %358, i32* %21
%359 = load i32*, i32** %14
%360 = load i32, i32* %359
%361 = load i32*, i32** %12
%362 = load i32, i32* %361
%363 = call i32 @_mm_blend_epi16(i32 %360, i32 %362, i32 15)
store i32 %363, i32* %22
%364 = load i32, i32* %19
%365 = load i32, i32* %22
%366 = call i32 @_mm_blend_epi16(i32 %364, i32 %365, i32 204)
%367 = load i32*, i32** %11
store i32 %366, i32* %367
%368 = load i32, i32* %20
%369 = load i32, i32* %19
%370 = call i32 @_mm_blend_epi16(i32 %368, i32 %369, i32 204)
%371 = load i32*, i32** %12
store i32 %370, i32* %371
%372 = load i32, i32* %21
%373 = load i32, i32* %20
%374 = call i32 @_mm_blend_epi16(i32 %372, i32 %373, i32 204)
%375 = load i32*, i32** %13
store i32 %374, i32* %375
%376 = load i32, i32* %22
%377 = load i32, i32* %21
%378 = call i32 @_mm_blend_epi16(i32 %376, i32 %377, i32 204)
%379 = load i32*, i32** %14
store i32 %378, i32* %379
%380 = load i8*, i8** %9
ret void
}

LLVM IR (-O2):
define void @scrypt_core_sidm(i32* %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 3
%5 = zext i32 %4 to i64
%6 = alloca i32, i64 %5
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = getelementptr inbounds i32, i32* %0, i64 3
%10 = getelementptr inbounds i32, i32* %0, i64 4
%11 = getelementptr inbounds i32, i32* %0, i64 5
%12 = getelementptr inbounds i32, i32* %0, i64 6
%13 = getelementptr inbounds i32, i32* %0, i64 7
%14 = load i32, i32* %10
%15 = load i32, i32* %12
%16 = tail call i32 @_mm_blend_epi16(i32 %14, i32 %15, i32 240)
%17 = load i32, i32* %11
%18 = load i32, i32* %13
%19 = tail call i32 @_mm_blend_epi16(i32 %17, i32 %18, i32 15)
%20 = load i32, i32* %12
%21 = load i32, i32* %10
%22 = tail call i32 @_mm_blend_epi16(i32 %20, i32 %21, i32 240)
%23 = load i32, i32* %13
%24 = load i32, i32* %11
%25 = tail call i32 @_mm_blend_epi16(i32 %23, i32 %24, i32 15)
%26 = tail call i32 @_mm_blend_epi16(i32 %16, i32 %25, i32 204)
store i32 %26, i32* %10
%27 = tail call i32 @_mm_blend_epi16(i32 %19, i32 %16, i32 204)
store i32 %27, i32* %11
%28 = tail call i32 @_mm_blend_epi16(i32 %22, i32 %19, i32 204)
store i32 %28, i32* %12
%29 = tail call i32 @_mm_blend_epi16(i32 %25, i32 %22, i32 204)
store i32 %29, i32* %13
%30 = load i32, i32* %0
%31 = load i32, i32* %8
%32 = tail call i32 @_mm_blend_epi16(i32 %30, i32 %31, i32 240)
%33 = load i32, i32* %7
%34 = load i32, i32* %9
%35 = tail call i32 @_mm_blend_epi16(i32 %33, i32 %34, i32 15)
%36 = load i32, i32* %8
%37 = load i32, i32* %0
%38 = tail call i32 @_mm_blend_epi16(i32 %36, i32 %37, i32 240)
%39 = load i32, i32* %9
%40 = load i32, i32* %7
%41 = tail call i32 @_mm_blend_epi16(i32 %39, i32 %40, i32 15)
%42 = tail call i32 @_mm_blend_epi16(i32 %32, i32 %41, i32 204)
store i32 %42, i32* %0
%43 = tail call i32 @_mm_blend_epi16(i32 %35, i32 %32, i32 204)
store i32 %43, i32* %7
%44 = tail call i32 @_mm_blend_epi16(i32 %38, i32 %35, i32 204)
store i32 %44, i32* %8
%45 = tail call i32 @_mm_blend_epi16(i32 %41, i32 %38, i32 204)
store i32 %45, i32* %9
%46 = icmp sgt i32 %1, 0
br i1 %46, label %47, label %134
47: ; preds = %3
%48 = zext i32 %1 to i64
%49 = bitcast i32* %10 to <4 x i32>*
br label %53
50: ; preds = %53
br i1 %46, label %51, label %134
51: ; preds = %50
%52 = add nsw i32 %1, -1
br label %77
53: ; preds = %75, %47
%54 = phi i32 [ %45, %47 ], [ %76, %75 ]
%55 = phi i64 [ 0, %47 ], [ %73, %75 ]
%56 = load i32, i32* %0
%57 = shl nsw i64 %55, 3
%58 = getelementptr inbounds i32, i32* %6, i64 %57
store i32 %56, i32* %58
%59 = load i32, i32* %7
%60 = or i64 %57, 1
%61 = getelementptr inbounds i32, i32* %6, i64 %60
store i32 %59, i32* %61
%62 = load i32, i32* %8
%63 = or i64 %57, 2
%64 = getelementptr inbounds i32, i32* %6, i64 %63
store i32 %62, i32* %64
%65 = or i64 %57, 3
%66 = getelementptr inbounds i32, i32* %6, i64 %65
store i32 %54, i32* %66
%67 = or i64 %57, 4
%68 = getelementptr inbounds i32, i32* %6, i64 %67
%69 = load <4 x i32>, <4 x i32>* %49
%70 = bitcast i32* %68 to <4 x i32>*
store <4 x i32> %69, <4 x i32>* %70
%71 = tail call i32 @xor_salsa_sidm(i32* %0, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32 %2)
%72 = tail call i32 @xor_salsa_sidm(i32* %10, i32* %11, i32* %12, i32* %13, i32* %0, i32* %7, i32* %8, i32* %9, i32 %2)
%73 = add nuw nsw i64 %55, 1
%74 = icmp eq i64 %73, %48
br i1 %74, label %50, label %75
75: ; preds = %53
%76 = load i32, i32* %9
br label %53
77: ; preds = %51, %77
%78 = phi i32 [ 0, %51 ], [ %132, %77 ]
%79 = load i32, i32* %10
%80 = tail call i32 @_mm_extract_epi16(i32 %79, i32 0)
%81 = and i32 %80, %52
%82 = shl nsw i32 %81, 3
%83 = load i32, i32* %0
%84 = sext i32 %82 to i64
%85 = getelementptr inbounds i32, i32* %6, i64 %84
%86 = load i32, i32* %85
%87 = tail call i32 @_mm_xor_si128(i32 %83, i32 %86)
store i32 %87, i32* %0
%88 = load i32, i32* %7
%89 = or i32 %82, 1
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i32, i32* %6, i64 %90
%92 = load i32, i32* %91
%93 = tail call i32 @_mm_xor_si128(i32 %88, i32 %92)
store i32 %93, i32* %7
%94 = load i32, i32* %8
%95 = or i32 %82, 2
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i32, i32* %6, i64 %96
%98 = load i32, i32* %97
%99 = tail call i32 @_mm_xor_si128(i32 %94, i32 %98)
store i32 %99, i32* %8
%100 = load i32, i32* %9
%101 = or i32 %82, 3
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i32, i32* %6, i64 %102
%104 = load i32, i32* %103
%105 = tail call i32 @_mm_xor_si128(i32 %100, i32 %104)
store i32 %105, i32* %9
%106 = load i32, i32* %10
%107 = or i32 %82, 4
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i32, i32* %6, i64 %108
%110 = load i32, i32* %109
%111 = tail call i32 @_mm_xor_si128(i32 %106, i32 %110)
store i32 %111, i32* %10
%112 = load i32, i32* %11
%113 = or i32 %82, 5
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i32, i32* %6, i64 %114
%116 = load i32, i32* %115
%117 = tail call i32 @_mm_xor_si128(i32 %112, i32 %116)
store i32 %117, i32* %11
%118 = load i32, i32* %12
%119 = or i32 %82, 6
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds i32, i32* %6, i64 %120
%122 = load i32, i32* %121
%123 = tail call i32 @_mm_xor_si128(i32 %118, i32 %122)
store i32 %123, i32* %12
%124 = load i32, i32* %13
%125 = or i32 %82, 7
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i32, i32* %6, i64 %126
%128 = load i32, i32* %127
%129 = tail call i32 @_mm_xor_si128(i32 %124, i32 %128)
store i32 %129, i32* %13
%130 = tail call i32 @xor_salsa_sidm(i32* %0, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32 %2)
%131 = tail call i32 @xor_salsa_sidm(i32* %10, i32* %11, i32* %12, i32* %13, i32* %0, i32* %7, i32* %8, i32* %9, i32 %2)
%132 = add nuw nsw i32 %78, 1
%133 = icmp eq i32 %132, %1
br i1 %133, label %134, label %77
134: ; preds = %77, %3, %50
%135 = load i32, i32* %10
%136 = load i32, i32* %12
%137 = tail call i32 @_mm_blend_epi16(i32 %135, i32 %136, i32 240)
%138 = load i32, i32* %11
%139 = load i32, i32* %13
%140 = tail call i32 @_mm_blend_epi16(i32 %138, i32 %139, i32 15)
%141 = load i32, i32* %12
%142 = load i32, i32* %10
%143 = tail call i32 @_mm_blend_epi16(i32 %141, i32 %142, i32 240)
%144 = load i32, i32* %13
%145 = load i32, i32* %11
%146 = tail call i32 @_mm_blend_epi16(i32 %144, i32 %145, i32 15)
%147 = tail call i32 @_mm_blend_epi16(i32 %137, i32 %146, i32 204)
store i32 %147, i32* %10
%148 = tail call i32 @_mm_blend_epi16(i32 %140, i32 %137, i32 204)
store i32 %148, i32* %11
%149 = tail call i32 @_mm_blend_epi16(i32 %143, i32 %140, i32 204)
store i32 %149, i32* %12
%150 = tail call i32 @_mm_blend_epi16(i32 %146, i32 %143, i32 204)
store i32 %150, i32* %13
%151 = load i32, i32* %0
%152 = load i32, i32* %8
%153 = tail call i32 @_mm_blend_epi16(i32 %151, i32 %152, i32 240)
%154 = load i32, i32* %7
%155 = load i32, i32* %9
%156 = tail call i32 @_mm_blend_epi16(i32 %154, i32 %155, i32 15)
%157 = load i32, i32* %8
%158 = load i32, i32* %0
%159 = tail call i32 @_mm_blend_epi16(i32 %157, i32 %158, i32 240)
%160 = load i32, i32* %9
%161 = load i32, i32* %7
%162 = tail call i32 @_mm_blend_epi16(i32 %160, i32 %161, i32 15)
%163 = tail call i32 @_mm_blend_epi16(i32 %153, i32 %162, i32 204)
store i32 %163, i32* %0
%164 = tail call i32 @_mm_blend_epi16(i32 %156, i32 %153, i32 204)
store i32 %164, i32* %7
%165 = tail call i32 @_mm_blend_epi16(i32 %159, i32 %156, i32 204)
store i32 %165, i32* %8
%166 = tail call i32 @_mm_blend_epi16(i32 %162, i32 %159, i32 204)
store i32 %166, i32* %9
ret void
}