#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 uint;

/* Variables and functions */
int /*<<< orphan*/ neoscrypt_blkcpy(int *, int *, int);
int /*<<< orphan*/ neoscrypt_blkswp(int *, int *, int);
int /*<<< orphan*/ neoscrypt_blkxor(int *, int *, int);
int /*<<< orphan*/ neoscrypt_chacha(int *, int);
int /*<<< orphan*/ neoscrypt_salsa(int *, int);
void neoscrypt_blkmix(uint *X, uint *Y, uint r, uint mixmode) {
  uint i, mixer, rounds;
  mixer = mixmode >> 8;
  rounds = mixmode & 0xFF;
  if (r == 1) {
    neoscrypt_blkxor(&X[0], &X[16], 64);
    if (mixer)
      neoscrypt_chacha(&X[0], rounds);
    else
      neoscrypt_salsa(&X[0], rounds);
    neoscrypt_blkxor(&X[16], &X[0], 64);
    if (mixer)
      neoscrypt_chacha(&X[16], rounds);
    else
      neoscrypt_salsa(&X[16], rounds);
    return;
  }
  if (r == 2) {
    neoscrypt_blkxor(&X[0], &X[48], 64);
    if (mixer)
      neoscrypt_chacha(&X[0], rounds);
    else
      neoscrypt_salsa(&X[0], rounds);
    neoscrypt_blkxor(&X[16], &X[0], 64);
    if (mixer)
      neoscrypt_chacha(&X[16], rounds);
    else
      neoscrypt_salsa(&X[16], rounds);
    neoscrypt_blkxor(&X[32], &X[16], 64);
    if (mixer)
      neoscrypt_chacha(&X[32], rounds);
    else
      neoscrypt_salsa(&X[32], rounds);
    neoscrypt_blkxor(&X[48], &X[32], 64);
    if (mixer)
      neoscrypt_chacha(&X[48], rounds);
    else
      neoscrypt_salsa(&X[48], rounds);
    neoscrypt_blkswp(&X[16], &X[32], 64);
    return;
  }
  for (i = 0; i < 2 * r; i++) {
    if (i)
      neoscrypt_blkxor(&X[16 * i], &X[16 * (i - 1)], 64);
    else
      neoscrypt_blkxor(&X[0], &X[16 * (2 * r - 1)], 64);
    if (mixer)
      neoscrypt_chacha(&X[16 * i], rounds);
    else
      neoscrypt_salsa(&X[16 * i], rounds);
    neoscrypt_blkcpy(&Y[16 * i], &X[16 * i], 64);
  }
  for (i = 0; i < r; i++)
    neoscrypt_blkcpy(&X[16 * i], &Y[16 * 2 * i], 64);
  for (i = 0; i < r; i++)
    neoscrypt_blkcpy(&X[16 * (i + r)], &Y[16 * (2 * i + 1)], 64);
}


x86 assembly (clang, -O0):
<neoscrypt_blkmix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    120b <neoscrypt_blkmix+0xbb>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x40,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x0,-0x20(%rbp)
je     11b5 <neoscrypt_blkmix+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    11c1 <neoscrypt_blkmix+0x71>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1070 <neoscrypt_salsa@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x0,-0x20(%rbp)
je     11f6 <neoscrypt_blkmix+0xa6>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    1206 <neoscrypt_blkmix+0xb6>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x24(%rbp),%esi
call   1070 <neoscrypt_salsa@plt>
jmp    1512 <neoscrypt_blkmix+0x3c2>
cmpl   $0x2,-0x14(%rbp)
jne    1363 <neoscrypt_blkmix+0x213>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0xc0,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x0,-0x20(%rbp)
je     1249 <neoscrypt_blkmix+0xf9>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    1255 <neoscrypt_blkmix+0x105>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1070 <neoscrypt_salsa@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x0,-0x20(%rbp)
je     128a <neoscrypt_blkmix+0x13a>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    129a <neoscrypt_blkmix+0x14a>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x24(%rbp),%esi
call   1070 <neoscrypt_salsa@plt>
mov    -0x8(%rbp),%rdi
add    $0x80,%rdi
mov    -0x8(%rbp),%rsi
add    $0x40,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x0,-0x20(%rbp)
je     12d9 <neoscrypt_blkmix+0x189>
mov    -0x8(%rbp),%rdi
add    $0x80,%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    12ec <neoscrypt_blkmix+0x19c>
mov    -0x8(%rbp),%rdi
add    $0x80,%rdi
mov    -0x24(%rbp),%esi
call   1070 <neoscrypt_salsa@plt>
mov    -0x8(%rbp),%rdi
add    $0xc0,%rdi
mov    -0x8(%rbp),%rsi
add    $0x80,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x0,-0x20(%rbp)
je     132e <neoscrypt_blkmix+0x1de>
mov    -0x8(%rbp),%rdi
add    $0xc0,%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    1341 <neoscrypt_blkmix+0x1f1>
mov    -0x8(%rbp),%rdi
add    $0xc0,%rdi
mov    -0x24(%rbp),%esi
call   1070 <neoscrypt_salsa@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rsi
add    $0x80,%rsi
mov    $0x40,%edx
call   1030 <neoscrypt_blkswp@plt>
jmp    1512 <neoscrypt_blkmix+0x3c2>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1467 <neoscrypt_blkmix+0x317>
cmpl   $0x0,-0x1c(%rbp)
je     13bd <neoscrypt_blkmix+0x26d>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
jmp    13e4 <neoscrypt_blkmix+0x294>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x0,-0x20(%rbp)
je     140e <neoscrypt_blkmix+0x2be>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    1429 <neoscrypt_blkmix+0x2d9>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%esi
call   1070 <neoscrypt_salsa@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    136a <neoscrypt_blkmix+0x21a>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    14b8 <neoscrypt_blkmix+0x368>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%eax
shl    $0x5,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    146e <neoscrypt_blkmix+0x31e>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1512 <neoscrypt_blkmix+0x3c2>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    14bf <neoscrypt_blkmix+0x36f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neoscrypt_blkmix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r13
mov    %ecx,0xc(%rsp)
movzbl %cl,%eax
mov    %eax,0x8(%rsp)
cmp    $0x1,%edx
je     120f <neoscrypt_blkmix+0xbf>
mov    %edx,%r14d
cmp    $0x2,%edx
jne    1267 <neoscrypt_blkmix+0x117>
lea    0xc0(%r13),%r15
mov    %r13,%rdi
mov    %r15,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x100,0xc(%rsp)
jae    12c6 <neoscrypt_blkmix+0x176>
mov    %r13,%rdi
mov    0x8(%rsp),%ebx
mov    %ebx,%esi
call   1070 <neoscrypt_salsa@plt>
lea    0x40(%r13),%rbp
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
call   1070 <neoscrypt_salsa@plt>
sub    $0xffffffffffffff80,%r13
mov    %r13,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %r13,%rdi
mov    %ebx,%esi
call   1070 <neoscrypt_salsa@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <neoscrypt_salsa@plt>
jmp    132a <neoscrypt_blkmix+0x1da>
lea    0x40(%r13),%rbp
mov    %r13,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x100,0xc(%rsp)
jae    1348 <neoscrypt_blkmix+0x1f8>
mov    %r13,%rdi
mov    0x8(%rsp),%ebx
mov    %ebx,%esi
call   1070 <neoscrypt_salsa@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <neoscrypt_salsa@plt>
test   %r14d,%r14d
jle    14d5 <neoscrypt_blkmix+0x385>
mov    %rsi,%rbp
lea    (%r14,%r14,1),%r15d
cmp    $0x2,%r15d
mov    $0x1,%ebx
cmovge %r15d,%ebx
mov    %r14d,%eax
shl    $0x5,%eax
add    $0xfffffff0,%eax
cltq
lea    0x0(,%rax,4),%rsi
add    %r13,%rsi
mov    %r13,%rdi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x100,0xc(%rsp)
jae    137e <neoscrypt_blkmix+0x22e>
mov    %r13,%rdi
mov    0x8(%rsp),%esi
call   1070 <neoscrypt_salsa@plt>
jmp    138a <neoscrypt_blkmix+0x23a>
mov    %r13,%rdi
mov    0x8(%rsp),%ebx
mov    %ebx,%esi
call   1040 <neoscrypt_chacha@plt>
lea    0x40(%r13),%rbp
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
call   1040 <neoscrypt_chacha@plt>
sub    $0xffffffffffffff80,%r13
mov    %r13,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %r13,%rdi
mov    %ebx,%esi
call   1040 <neoscrypt_chacha@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <neoscrypt_chacha@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x40,%edx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <neoscrypt_blkswp@plt>
mov    %r13,%rdi
mov    0x8(%rsp),%ebx
mov    %ebx,%esi
call   1040 <neoscrypt_chacha@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <neoscrypt_chacha@plt>
mov    %r13,%rdi
mov    0x8(%rsp),%esi
call   1040 <neoscrypt_chacha@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
cmp    $0x2,%r15d
mov    %rbp,0x10(%rsp)
jl     144d <neoscrypt_blkmix+0x2fd>
add    $0xffffffffffffffff,%rbx
mov    $0x10,%r15d
jmp    13ec <neoscrypt_blkmix+0x29c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
mov    0x8(%rsp),%esi
call   1070 <neoscrypt_salsa@plt>
mov    0x10(%rsp),%rax
lea    (%rax,%r12,4),%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
add    $0x10,%r15
add    $0xffffffffffffffff,%rbx
je     143f <neoscrypt_blkmix+0x2ef>
mov    %r15d,%eax
lea    0x0(,%rax,4),%rdi
add    %r13,%rdi
lea    -0x10(%r15),%eax
cltq
lea    0x0(,%rax,4),%rsi
add    %r13,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %r15d,%r12d
and    $0xfffffff0,%r12d
lea    0x0(,%r12,4),%rbp
add    %r13,%rbp
cmpl   $0x100,0xc(%rsp)
jb     13c0 <neoscrypt_blkmix+0x270>
mov    %rbp,%rdi
mov    0x8(%rsp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    13cc <neoscrypt_blkmix+0x27c>
test   %r14d,%r14d
mov    0x10(%rsp),%rbp
jle    14d5 <neoscrypt_blkmix+0x385>
mov    %r14d,%r12d
mov    %r12,%r15
mov    %rbp,%rbx
mov    %r13,%rbp
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
add    $0x40,%rbp
sub    $0xffffffffffffff80,%rbx
add    $0xffffffffffffffff,%r15
jne    1460 <neoscrypt_blkmix+0x310>
test   %r14d,%r14d
mov    0x10(%rsp),%rbp
jle    14d5 <neoscrypt_blkmix+0x385>
shl    $0x4,%r14d
shl    $0x5,%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %r14d,%r14
lea    0x0(,%r14,4),%rdi
add    %r13,%rdi
lea    0x10(%rbx),%eax
cltq
lea    0x0(,%rax,4),%rsi
add    %rbp,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
add    $0x20,%rbx
add    $0x10,%r14d
cmp    %rbx,%r12
jne    14a0 <neoscrypt_blkmix+0x350>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @neoscrypt_blkmix(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %8
%13 = ashr i32 %12, 8
store i32 %13, i32* %10
%14 = load i32, i32* %8
%15 = and i32 %14, 255
store i32 %15, i32* %11
%16 = load i32, i32* %7
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %55
18: ; preds = %4
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 16
%23 = call i32 @neoscrypt_blkxor(i32* %20, i32* %22, i32 64)
%24 = load i32, i32* %10
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %18
%27 = load i32*, i32** %5
%28 = getelementptr inbounds i32, i32* %27, i64 0
%29 = load i32, i32* %11
%30 = call i32 @neoscrypt_chacha(i32* %28, i32 %29)
br label %36
31: ; preds = %18
%32 = load i32*, i32** %5
%33 = getelementptr inbounds i32, i32* %32, i64 0
%34 = load i32, i32* %11
%35 = call i32 @neoscrypt_salsa(i32* %33, i32 %34)
br label %36
36: ; preds = %31, %26
%37 = load i32*, i32** %5
%38 = getelementptr inbounds i32, i32* %37, i64 16
%39 = load i32*, i32** %5
%40 = getelementptr inbounds i32, i32* %39, i64 0
%41 = call i32 @neoscrypt_blkxor(i32* %38, i32* %40, i32 64)
%42 = load i32, i32* %10
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %49
44: ; preds = %36
%45 = load i32*, i32** %5
%46 = getelementptr inbounds i32, i32* %45, i64 16
%47 = load i32, i32* %11
%48 = call i32 @neoscrypt_chacha(i32* %46, i32 %47)
br label %54
49: ; preds = %36
%50 = load i32*, i32** %5
%51 = getelementptr inbounds i32, i32* %50, i64 16
%52 = load i32, i32* %11
%53 = call i32 @neoscrypt_salsa(i32* %51, i32 %52)
br label %54
54: ; preds = %49, %44
br label %247
55: ; preds = %4
%56 = load i32, i32* %7
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %136
58: ; preds = %55
%59 = load i32*, i32** %5
%60 = getelementptr inbounds i32, i32* %59, i64 0
%61 = load i32*, i32** %5
%62 = getelementptr inbounds i32, i32* %61, i64 48
%63 = call i32 @neoscrypt_blkxor(i32* %60, i32* %62, i32 64)
%64 = load i32, i32* %10
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %71
66: ; preds = %58
%67 = load i32*, i32** %5
%68 = getelementptr inbounds i32, i32* %67, i64 0
%69 = load i32, i32* %11
%70 = call i32 @neoscrypt_chacha(i32* %68, i32 %69)
br label %76
71: ; preds = %58
%72 = load i32*, i32** %5
%73 = getelementptr inbounds i32, i32* %72, i64 0
%74 = load i32, i32* %11
%75 = call i32 @neoscrypt_salsa(i32* %73, i32 %74)
br label %76
76: ; preds = %71, %66
%77 = load i32*, i32** %5
%78 = getelementptr inbounds i32, i32* %77, i64 16
%79 = load i32*, i32** %5
%80 = getelementptr inbounds i32, i32* %79, i64 0
%81 = call i32 @neoscrypt_blkxor(i32* %78, i32* %80, i32 64)
%82 = load i32, i32* %10
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %89
84: ; preds = %76
%85 = load i32*, i32** %5
%86 = getelementptr inbounds i32, i32* %85, i64 16
%87 = load i32, i32* %11
%88 = call i32 @neoscrypt_chacha(i32* %86, i32 %87)
br label %94
89: ; preds = %76
%90 = load i32*, i32** %5
%91 = getelementptr inbounds i32, i32* %90, i64 16
%92 = load i32, i32* %11
%93 = call i32 @neoscrypt_salsa(i32* %91, i32 %92)
br label %94
94: ; preds = %89, %84
%95 = load i32*, i32** %5
%96 = getelementptr inbounds i32, i32* %95, i64 32
%97 = load i32*, i32** %5
%98 = getelementptr inbounds i32, i32* %97, i64 16
%99 = call i32 @neoscrypt_blkxor(i32* %96, i32* %98, i32 64)
%100 = load i32, i32* %10
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %107
102: ; preds = %94
%103 = load i32*, i32** %5
%104 = getelementptr inbounds i32, i32* %103, i64 32
%105 = load i32, i32* %11
%106 = call i32 @neoscrypt_chacha(i32* %104, i32 %105)
br label %112
107: ; preds = %94
%108 = load i32*, i32** %5
%109 = getelementptr inbounds i32, i32* %108, i64 32
%110 = load i32, i32* %11
%111 = call i32 @neoscrypt_salsa(i32* %109, i32 %110)
br label %112
112: ; preds = %107, %102
%113 = load i32*, i32** %5
%114 = getelementptr inbounds i32, i32* %113, i64 48
%115 = load i32*, i32** %5
%116 = getelementptr inbounds i32, i32* %115, i64 32
%117 = call i32 @neoscrypt_blkxor(i32* %114, i32* %116, i32 64)
%118 = load i32, i32* %10
%119 = icmp ne i32 %118, 0
br i1 %119, label %120, label %125
120: ; preds = %112
%121 = load i32*, i32** %5
%122 = getelementptr inbounds i32, i32* %121, i64 48
%123 = load i32, i32* %11
%124 = call i32 @neoscrypt_chacha(i32* %122, i32 %123)
br label %130
125: ; preds = %112
%126 = load i32*, i32** %5
%127 = getelementptr inbounds i32, i32* %126, i64 48
%128 = load i32, i32* %11
%129 = call i32 @neoscrypt_salsa(i32* %127, i32 %128)
br label %130
130: ; preds = %125, %120
%131 = load i32*, i32** %5
%132 = getelementptr inbounds i32, i32* %131, i64 16
%133 = load i32*, i32** %5
%134 = getelementptr inbounds i32, i32* %133, i64 32
%135 = call i32 @neoscrypt_blkswp(i32* %132, i32* %134, i32 64)
br label %247
136: ; preds = %55
store i32 0, i32* %9
br label %137
137: ; preds = %200, %136
%138 = load i32, i32* %9
%139 = load i32, i32* %7
%140 = mul nsw i32 2, %139
%141 = icmp slt i32 %138, %140
br i1 %141, label %142, label %203
142: ; preds = %137
%143 = load i32, i32* %9
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %158
145: ; preds = %142
%146 = load i32*, i32** %5
%147 = load i32, i32* %9
%148 = mul nsw i32 16, %147
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i32, i32* %146, i64 %149
%151 = load i32*, i32** %5
%152 = load i32, i32* %9
%153 = sub nsw i32 %152, 1
%154 = mul nsw i32 16, %153
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i32, i32* %151, i64 %155
%157 = call i32 @neoscrypt_blkxor(i32* %150, i32* %156, i32 64)
br label %169
158: ; preds = %142
%159 = load i32*, i32** %5
%160 = getelementptr inbounds i32, i32* %159, i64 0
%161 = load i32*, i32** %5
%162 = load i32, i32* %7
%163 = mul nsw i32 2, %162
%164 = sub nsw i32 %163, 1
%165 = mul nsw i32 16, %164
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds i32, i32* %161, i64 %166
%168 = call i32 @neoscrypt_blkxor(i32* %160, i32* %167, i32 64)
br label %169
169: ; preds = %158, %145
%170 = load i32, i32* %10
%171 = icmp ne i32 %170, 0
br i1 %171, label %172, label %180
172: ; preds = %169
%173 = load i32*, i32** %5
%174 = load i32, i32* %9
%175 = mul nsw i32 16, %174
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds i32, i32* %173, i64 %176
%178 = load i32, i32* %11
%179 = call i32 @neoscrypt_chacha(i32* %177, i32 %178)
br label %188
180: ; preds = %169
%181 = load i32*, i32** %5
%182 = load i32, i32* %9
%183 = mul nsw i32 16, %182
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i32, i32* %181, i64 %184
%186 = load i32, i32* %11
%187 = call i32 @neoscrypt_salsa(i32* %185, i32 %186)
br label %188
188: ; preds = %180, %172
%189 = load i32*, i32** %6
%190 = load i32, i32* %9
%191 = mul nsw i32 16, %190
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds i32, i32* %189, i64 %192
%194 = load i32*, i32** %5
%195 = load i32, i32* %9
%196 = mul nsw i32 16, %195
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds i32, i32* %194, i64 %197
%199 = call i32 @neoscrypt_blkcpy(i32* %193, i32* %198, i32 64)
br label %200
200: ; preds = %188
%201 = load i32, i32* %9
%202 = add nsw i32 %201, 1
store i32 %202, i32* %9
br label %137
203: ; preds = %137
store i32 0, i32* %9
br label %204
204: ; preds = %220, %203
%205 = load i32, i32* %9
%206 = load i32, i32* %7
%207 = icmp slt i32 %205, %206
br i1 %207, label %208, label %223
208: ; preds = %204
%209 = load i32*, i32** %5
%210 = load i32, i32* %9
%211 = mul nsw i32 16, %210
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds i32, i32* %209, i64 %212
%214 = load i32*, i32** %6
%215 = load i32, i32* %9
%216 = mul nsw i32 32, %215
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds i32, i32* %214, i64 %217
%219 = call i32 @neoscrypt_blkcpy(i32* %213, i32* %218, i32 64)
br label %220
220: ; preds = %208
%221 = load i32, i32* %9
%222 = add nsw i32 %221, 1
store i32 %222, i32* %9
br label %204
223: ; preds = %204
store i32 0, i32* %9
br label %224
224: ; preds = %244, %223
%225 = load i32, i32* %9
%226 = load i32, i32* %7
%227 = icmp slt i32 %225, %226
br i1 %227, label %228, label %247
228: ; preds = %224
%229 = load i32*, i32** %5
%230 = load i32, i32* %9
%231 = load i32, i32* %7
%232 = add nsw i32 %230, %231
%233 = mul nsw i32 16, %232
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds i32, i32* %229, i64 %234
%236 = load i32*, i32** %6
%237 = load i32, i32* %9
%238 = mul nsw i32 2, %237
%239 = add nsw i32 %238, 1
%240 = mul nsw i32 16, %239
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds i32, i32* %236, i64 %241
%243 = call i32 @neoscrypt_blkcpy(i32* %235, i32* %242, i32 64)
br label %244
244: ; preds = %228
%245 = load i32, i32* %9
%246 = add nsw i32 %245, 1
store i32 %246, i32* %9
br label %224
247: ; preds = %54, %130, %224
ret void
}

LLVM IR (-O2):
define void @neoscrypt_blkmix(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = and i32 %3, 255
switch i32 %2, label %6 [
i32 1, label %25
i32 2, label %37
]
6: ; preds = %4
%7 = icmp sgt i32 %2, 0
br i1 %7, label %8, label %117
8: ; preds = %6
%9 = shl nuw i32 %2, 1
%10 = icmp ult i32 %3, 256
%11 = call i32 @llvm.smax.i32(i32 %9, i32 1)
%12 = zext i32 %11 to i64
%13 = shl i32 %2, 5
%14 = add i32 %13, -16
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %0, i64 %15
%17 = tail call i32 @neoscrypt_blkxor(i32* %0, i32* %16, i32 64)
br i1 %10, label %20, label %18
18: ; preds = %8
%19 = tail call i32 @neoscrypt_chacha(i32* %0, i32 %5)
br label %22
20: ; preds = %8
%21 = tail call i32 @neoscrypt_salsa(i32* %0, i32 %5)
br label %22
22: ; preds = %20, %18
%23 = tail call i32 @neoscrypt_blkcpy(i32* %1, i32* %0, i32 64)
%24 = icmp slt i32 %9, 2
br i1 %24, label %66, label %68
25: ; preds = %4
%26 = getelementptr inbounds i32, i32* %0, i64 16
%27 = tail call i32 @neoscrypt_blkxor(i32* %0, i32* %26, i32 64)
%28 = icmp ult i32 %3, 256
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = tail call i32 @neoscrypt_chacha(i32* %0, i32 %5)
%31 = tail call i32 @neoscrypt_blkxor(i32* %26, i32* %0, i32 64)
%32 = tail call i32 @neoscrypt_chacha(i32* %26, i32 %5)
br label %117
33: ; preds = %25
%34 = tail call i32 @neoscrypt_salsa(i32* %0, i32 %5)
%35 = tail call i32 @neoscrypt_blkxor(i32* %26, i32* %0, i32 64)
%36 = tail call i32 @neoscrypt_salsa(i32* %26, i32 %5)
br label %117
37: ; preds = %4
%38 = getelementptr inbounds i32, i32* %0, i64 48
%39 = tail call i32 @neoscrypt_blkxor(i32* %0, i32* %38, i32 64)
%40 = icmp ult i32 %3, 256
br i1 %40, label %51, label %41
41: ; preds = %37
%42 = tail call i32 @neoscrypt_chacha(i32* %0, i32 %5)
%43 = getelementptr inbounds i32, i32* %0, i64 16
%44 = tail call i32 @neoscrypt_blkxor(i32* %43, i32* %0, i32 64)
%45 = tail call i32 @neoscrypt_chacha(i32* %43, i32 %5)
%46 = getelementptr inbounds i32, i32* %0, i64 32
%47 = tail call i32 @neoscrypt_blkxor(i32* %46, i32* %43, i32 64)
%48 = tail call i32 @neoscrypt_chacha(i32* %46, i32 %5)
%49 = tail call i32 @neoscrypt_blkxor(i32* %38, i32* %46, i32 64)
%50 = tail call i32 @neoscrypt_chacha(i32* %38, i32 %5)
br label %61
51: ; preds = %37
%52 = tail call i32 @neoscrypt_salsa(i32* %0, i32 %5)
%53 = getelementptr inbounds i32, i32* %0, i64 16
%54 = tail call i32 @neoscrypt_blkxor(i32* %53, i32* %0, i32 64)
%55 = tail call i32 @neoscrypt_salsa(i32* %53, i32 %5)
%56 = getelementptr inbounds i32, i32* %0, i64 32
%57 = tail call i32 @neoscrypt_blkxor(i32* %56, i32* %53, i32 64)
%58 = tail call i32 @neoscrypt_salsa(i32* %56, i32 %5)
%59 = tail call i32 @neoscrypt_blkxor(i32* %38, i32* %56, i32 64)
%60 = tail call i32 @neoscrypt_salsa(i32* %38, i32 %5)
br label %61
61: ; preds = %51, %41
%62 = phi i32* [ %53, %51 ], [ %43, %41 ]
%63 = phi i32* [ %56, %51 ], [ %46, %41 ]
%64 = tail call i32 @neoscrypt_blkswp(i32* %62, i32* %63, i32 64)
br label %117
65: ; preds = %85
br i1 %7, label %66, label %117
66: ; preds = %22, %65
%67 = zext i32 %2 to i64
br label %94
68: ; preds = %22, %85
%69 = phi i64 [ %89, %85 ], [ 1, %22 ]
%70 = trunc i64 %69 to i32
%71 = shl nsw i32 %70, 4
%72 = zext i32 %71 to i64
%73 = getelementptr inbounds i32, i32* %0, i64 %72
%74 = add nsw i32 %71, -16
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i32, i32* %0, i64 %75
%77 = tail call i32 @neoscrypt_blkxor(i32* %73, i32* %76, i32 64)
%78 = shl i64 %69, 4
%79 = and i64 %78, 4294967280
%80 = getelementptr inbounds i32, i32* %0, i64 %79
br i1 %10, label %83, label %81
81: ; preds = %68
%82 = tail call i32 @neoscrypt_chacha(i32* %80, i32 %5)
br label %85
83: ; preds = %68
%84 = tail call i32 @neoscrypt_salsa(i32* %80, i32 %5)
br label %85
85: ; preds = %83, %81
%86 = getelementptr inbounds i32, i32* %1, i64 %79
%87 = getelementptr inbounds i32, i32* %0, i64 %79
%88 = tail call i32 @neoscrypt_blkcpy(i32* %86, i32* %87, i32 64)
%89 = add nuw nsw i64 %69, 1
%90 = icmp eq i64 %89, %12
br i1 %90, label %65, label %68
91: ; preds = %94
br i1 %7, label %92, label %117
92: ; preds = %91
%93 = zext i32 %2 to i64
br label %103
94: ; preds = %66, %94
%95 = phi i64 [ 0, %66 ], [ %101, %94 ]
%96 = shl nsw i64 %95, 4
%97 = getelementptr inbounds i32, i32* %0, i64 %96
%98 = shl nsw i64 %95, 5
%99 = getelementptr inbounds i32, i32* %1, i64 %98
%100 = tail call i32 @neoscrypt_blkcpy(i32* %97, i32* %99, i32 64)
%101 = add nuw nsw i64 %95, 1
%102 = icmp eq i64 %101, %67
br i1 %102, label %91, label %94
103: ; preds = %92, %103
%104 = phi i64 [ 0, %92 ], [ %115, %103 ]
%105 = trunc i64 %104 to i32
%106 = add nsw i32 %105, %2
%107 = shl nsw i32 %106, 4
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i32, i32* %0, i64 %108
%110 = shl i32 %105, 5
%111 = or i32 %110, 16
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i32, i32* %1, i64 %112
%114 = tail call i32 @neoscrypt_blkcpy(i32* %109, i32* %113, i32 64)
%115 = add nuw nsw i64 %104, 1
%116 = icmp eq i64 %115, %93
br i1 %116, label %117, label %103
117: ; preds = %103, %6, %65, %91, %29, %33, %61
ret void
}