#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 */

/* Variables and functions */
int /*<<< orphan*/ neoscrypt_blkcpy(unsigned int *, unsigned int *, int);
int /*<<< orphan*/ neoscrypt_blkswp(unsigned int *, unsigned int *, int);
int /*<<< orphan*/ neoscrypt_blkxor(unsigned int *, unsigned int *, int);
int /*<<< orphan*/ neoscrypt_chacha(unsigned int *, unsigned int);
int /*<<< orphan*/ neoscrypt_salsa(unsigned int *, unsigned int);
void neoscrypt_blkmix(unsigned int *X, unsigned int *Y, unsigned int r,
                      unsigned int mixmode) {
  unsigned int i, mixer, rounds;
  mixer = mixmode >> 8;
  rounds = mixmode & 0xFF;
  if (r == 1) {
    if (mixer) {
      neoscrypt_blkxor(&X[0], &X[16], 64);
      neoscrypt_chacha(&X[0], rounds);
      neoscrypt_blkxor(&X[16], &X[0], 64);
      neoscrypt_chacha(&X[16], rounds);
    } else {
      neoscrypt_blkxor(&X[0], &X[16], 64);
      neoscrypt_salsa(&X[0], rounds);
      neoscrypt_blkxor(&X[16], &X[0], 64);
      neoscrypt_salsa(&X[16], rounds);
    }
    return;
  }
  if (r == 2) {
    if (mixer) {
      neoscrypt_blkxor(&X[0], &X[48], 64);
      neoscrypt_chacha(&X[0], rounds);
      neoscrypt_blkxor(&X[16], &X[0], 64);
      neoscrypt_chacha(&X[16], rounds);
      neoscrypt_blkxor(&X[32], &X[16], 64);
      neoscrypt_chacha(&X[32], rounds);
      neoscrypt_blkxor(&X[48], &X[32], 64);
      neoscrypt_chacha(&X[48], rounds);
      neoscrypt_blkswp(&X[16], &X[32], 64);
    } else {
      neoscrypt_blkxor(&X[0], &X[48], 64);
      neoscrypt_salsa(&X[0], rounds);
      neoscrypt_blkxor(&X[16], &X[0], 64);
      neoscrypt_salsa(&X[16], rounds);
      neoscrypt_blkxor(&X[32], &X[16], 64);
      neoscrypt_salsa(&X[32], rounds);
      neoscrypt_blkxor(&X[48], &X[32], 64);
      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
shr    $0x8,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1228 <neoscrypt_blkmix+0xd8>
cmpl   $0x0,-0x20(%rbp)
je     11db <neoscrypt_blkmix+0x8b>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x40,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    1223 <neoscrypt_blkmix+0xd3>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x40,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
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>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x24(%rbp),%esi
call   1070 <neoscrypt_salsa@plt>
jmp    158b <neoscrypt_blkmix+0x43b>
cmpl   $0x2,-0x14(%rbp)
jne    13dc <neoscrypt_blkmix+0x28c>
cmpl   $0x0,-0x20(%rbp)
je     130c <neoscrypt_blkmix+0x1bc>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0xc0,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
mov    -0x8(%rbp),%rdi
add    $0x80,%rdi
mov    -0x8(%rbp),%rsi
add    $0x40,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    -0x8(%rbp),%rdi
add    $0x80,%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
mov    -0x8(%rbp),%rdi
add    $0xc0,%rdi
mov    -0x8(%rbp),%rsi
add    $0x80,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    -0x8(%rbp),%rdi
add    $0xc0,%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rsi
add    $0x80,%rsi
mov    $0x40,%edx
call   1030 <neoscrypt_blkswp@plt>
jmp    13d7 <neoscrypt_blkmix+0x287>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0xc0,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
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>
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>
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>
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    158b <neoscrypt_blkmix+0x43b>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jae    14e0 <neoscrypt_blkmix+0x390>
cmpl   $0x0,-0x1c(%rbp)
je     1436 <neoscrypt_blkmix+0x2e6>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
mov    %eax,%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
shl    $0x4,%eax
mov    %eax,%eax
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
jmp    145d <neoscrypt_blkmix+0x30d>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
shl    $0x4,%eax
mov    %eax,%eax
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x0,-0x20(%rbp)
je     1487 <neoscrypt_blkmix+0x337>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
mov    %eax,%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    14a2 <neoscrypt_blkmix+0x352>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
mov    %eax,%eax
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
mov    %eax,%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
mov    %eax,%eax
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    13e3 <neoscrypt_blkmix+0x293>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1531 <neoscrypt_blkmix+0x3e1>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
mov    %eax,%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%eax
shl    $0x5,%eax
mov    %eax,%eax
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    14e7 <neoscrypt_blkmix+0x397>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    158b <neoscrypt_blkmix+0x43b>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
shl    $0x4,%eax
mov    %eax,%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
shl    $0x4,%eax
mov    %eax,%eax
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    1538 <neoscrypt_blkmix+0x3e8>
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,%rbx
mov    %ecx,0xc(%rsp)
movzbl %cl,%eax
mov    %eax,0x8(%rsp)
cmp    $0x1,%edx
je     1214 <neoscrypt_blkmix+0xc4>
mov    %edx,%r13d
cmp    $0x2,%edx
jne    126f <neoscrypt_blkmix+0x11f>
lea    0xc0(%rbx),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x100,0xc(%rsp)
jae    12c4 <neoscrypt_blkmix+0x174>
mov    %rbx,%rdi
mov    0x8(%rsp),%r14d
mov    %r14d,%esi
call   1070 <neoscrypt_salsa@plt>
lea    0x40(%rbx),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
call   1070 <neoscrypt_salsa@plt>
sub    $0xffffffffffffff80,%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1070 <neoscrypt_salsa@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %r15,%rdi
mov    %r14d,%esi
call   1070 <neoscrypt_salsa@plt>
jmp    132d <neoscrypt_blkmix+0x1dd>
lea    0x40(%rbx),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
cmpl   $0x100,0xc(%rsp)
jae    134b <neoscrypt_blkmix+0x1fb>
mov    %rbx,%rdi
mov    0x8(%rsp),%r14d
mov    %r14d,%esi
call   1070 <neoscrypt_salsa@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <neoscrypt_salsa@plt>
mov    %rsi,%rbp
mov    %rbx,0x10(%rsp)
mov    %r13d,%ebx
add    %r13d,%ebx
je     1420 <neoscrypt_blkmix+0x2d0>
mov    %r13d,%eax
shl    $0x5,%eax
add    $0xfffffff0,%eax
mov    0x10(%rsp),%r15
lea    (%r15,%rax,4),%rsi
mov    %r15,%rdi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %ebx,%r14d
cmpl   $0x100,0xc(%rsp)
jae    1384 <neoscrypt_blkmix+0x234>
mov    %r15,%rdi
mov    0x8(%rsp),%esi
call   1070 <neoscrypt_salsa@plt>
jmp    1390 <neoscrypt_blkmix+0x240>
mov    %rbx,%rdi
mov    0x8(%rsp),%r14d
mov    %r14d,%esi
call   1040 <neoscrypt_chacha@plt>
lea    0x40(%rbx),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
call   1040 <neoscrypt_chacha@plt>
sub    $0xffffffffffffff80,%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <neoscrypt_chacha@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %r15,%rdi
mov    %r14d,%esi
call   1040 <neoscrypt_chacha@plt>
mov    %rbp,%rdi
mov    %rbx,%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    %rbx,%rdi
mov    0x8(%rsp),%r14d
mov    %r14d,%esi
call   1040 <neoscrypt_chacha@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <neoscrypt_chacha@plt>
mov    %r15,%rdi
mov    0x8(%rsp),%esi
call   1040 <neoscrypt_chacha@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
add    $0xffffffffffffffff,%r14
mov    $0x10,%r12d
jmp    13de <neoscrypt_blkmix+0x28e>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    0x8(%rsp),%esi
call   1070 <neoscrypt_salsa@plt>
lea    0x0(,%r15,4),%rdi
add    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
add    $0x10,%r12
add    $0xffffffffffffffff,%r14
je     1420 <neoscrypt_blkmix+0x2d0>
mov    %r12d,%eax
mov    0x10(%rsp),%rbx
lea    (%rbx,%rax,4),%rdi
lea    -0x10(%r12),%eax
lea    (%rbx,%rax,4),%rsi
mov    $0x40,%edx
call   1050 <neoscrypt_blkxor@plt>
mov    %r12d,%r15d
and    $0xfffffff0,%r15d
lea    (%rbx,%r15,4),%rbx
cmpl   $0x100,0xc(%rsp)
jb     13b0 <neoscrypt_blkmix+0x260>
mov    %rbx,%rdi
mov    0x8(%rsp),%esi
call   1040 <neoscrypt_chacha@plt>
jmp    13bc <neoscrypt_blkmix+0x26c>
test   %r13d,%r13d
mov    0x10(%rsp),%r15
je     149e <neoscrypt_blkmix+0x34e>
mov    %r13d,%r14d
xor    %ebx,%ebx
nop
mov    %ebx,%eax
shl    $0x4,%eax
lea    (%r15,%rax,4),%rdi
mov    %ebx,%eax
shl    $0x5,%eax
lea    0x0(,%rax,4),%rsi
add    %rbp,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
add    $0x1,%rbx
cmp    %r14,%rbx
jne    1430 <neoscrypt_blkmix+0x2e0>
test   %r13d,%r13d
je     149e <neoscrypt_blkmix+0x34e>
shl    $0x4,%r13d
shl    $0x5,%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r13d,%eax
lea    (%r15,%rax,4),%rdi
mov    %ebx,%eax
and    $0xffffffe0,%eax
lea    0x40(,%rax,4),%rsi
add    %rbp,%rsi
mov    $0x40,%edx
call   1060 <neoscrypt_blkcpy@plt>
add    $0x20,%rbx
add    $0x10,%r13d
cmp    %rbx,%r14
jne    1470 <neoscrypt_blkmix+0x320>
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 = lshr 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 %60
18: ; preds = %4
%19 = load i32, i32* %10
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %40
21: ; preds = %18
%22 = load i32*, i32** %5
%23 = getelementptr inbounds i32, i32* %22, i64 0
%24 = load i32*, i32** %5
%25 = getelementptr inbounds i32, i32* %24, i64 16
%26 = call i32 @neoscrypt_blkxor(i32* %23, i32* %25, i32 64)
%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)
%31 = load i32*, i32** %5
%32 = getelementptr inbounds i32, i32* %31, i64 16
%33 = load i32*, i32** %5
%34 = getelementptr inbounds i32, i32* %33, i64 0
%35 = call i32 @neoscrypt_blkxor(i32* %32, i32* %34, i32 64)
%36 = load i32*, i32** %5
%37 = getelementptr inbounds i32, i32* %36, i64 16
%38 = load i32, i32* %11
%39 = call i32 @neoscrypt_chacha(i32* %37, i32 %38)
br label %59
40: ; preds = %18
%41 = load i32*, i32** %5
%42 = getelementptr inbounds i32, i32* %41, i64 0
%43 = load i32*, i32** %5
%44 = getelementptr inbounds i32, i32* %43, i64 16
%45 = call i32 @neoscrypt_blkxor(i32* %42, i32* %44, i32 64)
%46 = load i32*, i32** %5
%47 = getelementptr inbounds i32, i32* %46, i64 0
%48 = load i32, i32* %11
%49 = call i32 @neoscrypt_salsa(i32* %47, i32 %48)
%50 = load i32*, i32** %5
%51 = getelementptr inbounds i32, i32* %50, i64 16
%52 = load i32*, i32** %5
%53 = getelementptr inbounds i32, i32* %52, i64 0
%54 = call i32 @neoscrypt_blkxor(i32* %51, i32* %53, i32 64)
%55 = load i32*, i32** %5
%56 = getelementptr inbounds i32, i32* %55, i64 16
%57 = load i32, i32* %11
%58 = call i32 @neoscrypt_salsa(i32* %56, i32 %57)
br label %59
59: ; preds = %40, %21
br label %262
60: ; preds = %4
%61 = load i32, i32* %7
%62 = icmp eq i32 %61, 2
br i1 %62, label %63, label %151
63: ; preds = %60
%64 = load i32, i32* %10
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %108
66: ; preds = %63
%67 = load i32*, i32** %5
%68 = getelementptr inbounds i32, i32* %67, i64 0
%69 = load i32*, i32** %5
%70 = getelementptr inbounds i32, i32* %69, i64 48
%71 = call i32 @neoscrypt_blkxor(i32* %68, i32* %70, i32 64)
%72 = load i32*, i32** %5
%73 = getelementptr inbounds i32, i32* %72, i64 0
%74 = load i32, i32* %11
%75 = call i32 @neoscrypt_chacha(i32* %73, i32 %74)
%76 = load i32*, i32** %5
%77 = getelementptr inbounds i32, i32* %76, i64 16
%78 = load i32*, i32** %5
%79 = getelementptr inbounds i32, i32* %78, i64 0
%80 = call i32 @neoscrypt_blkxor(i32* %77, i32* %79, i32 64)
%81 = load i32*, i32** %5
%82 = getelementptr inbounds i32, i32* %81, i64 16
%83 = load i32, i32* %11
%84 = call i32 @neoscrypt_chacha(i32* %82, i32 %83)
%85 = load i32*, i32** %5
%86 = getelementptr inbounds i32, i32* %85, i64 32
%87 = load i32*, i32** %5
%88 = getelementptr inbounds i32, i32* %87, i64 16
%89 = call i32 @neoscrypt_blkxor(i32* %86, i32* %88, i32 64)
%90 = load i32*, i32** %5
%91 = getelementptr inbounds i32, i32* %90, i64 32
%92 = load i32, i32* %11
%93 = call i32 @neoscrypt_chacha(i32* %91, i32 %92)
%94 = load i32*, i32** %5
%95 = getelementptr inbounds i32, i32* %94, i64 48
%96 = load i32*, i32** %5
%97 = getelementptr inbounds i32, i32* %96, i64 32
%98 = call i32 @neoscrypt_blkxor(i32* %95, i32* %97, i32 64)
%99 = load i32*, i32** %5
%100 = getelementptr inbounds i32, i32* %99, i64 48
%101 = load i32, i32* %11
%102 = call i32 @neoscrypt_chacha(i32* %100, i32 %101)
%103 = load i32*, i32** %5
%104 = getelementptr inbounds i32, i32* %103, i64 16
%105 = load i32*, i32** %5
%106 = getelementptr inbounds i32, i32* %105, i64 32
%107 = call i32 @neoscrypt_blkswp(i32* %104, i32* %106, i32 64)
br label %150
108: ; preds = %63
%109 = load i32*, i32** %5
%110 = getelementptr inbounds i32, i32* %109, i64 0
%111 = load i32*, i32** %5
%112 = getelementptr inbounds i32, i32* %111, i64 48
%113 = call i32 @neoscrypt_blkxor(i32* %110, i32* %112, i32 64)
%114 = load i32*, i32** %5
%115 = getelementptr inbounds i32, i32* %114, i64 0
%116 = load i32, i32* %11
%117 = call i32 @neoscrypt_salsa(i32* %115, i32 %116)
%118 = load i32*, i32** %5
%119 = getelementptr inbounds i32, i32* %118, i64 16
%120 = load i32*, i32** %5
%121 = getelementptr inbounds i32, i32* %120, i64 0
%122 = call i32 @neoscrypt_blkxor(i32* %119, i32* %121, i32 64)
%123 = load i32*, i32** %5
%124 = getelementptr inbounds i32, i32* %123, i64 16
%125 = load i32, i32* %11
%126 = call i32 @neoscrypt_salsa(i32* %124, i32 %125)
%127 = load i32*, i32** %5
%128 = getelementptr inbounds i32, i32* %127, i64 32
%129 = load i32*, i32** %5
%130 = getelementptr inbounds i32, i32* %129, i64 16
%131 = call i32 @neoscrypt_blkxor(i32* %128, i32* %130, i32 64)
%132 = load i32*, i32** %5
%133 = getelementptr inbounds i32, i32* %132, i64 32
%134 = load i32, i32* %11
%135 = call i32 @neoscrypt_salsa(i32* %133, i32 %134)
%136 = load i32*, i32** %5
%137 = getelementptr inbounds i32, i32* %136, i64 48
%138 = load i32*, i32** %5
%139 = getelementptr inbounds i32, i32* %138, i64 32
%140 = call i32 @neoscrypt_blkxor(i32* %137, i32* %139, i32 64)
%141 = load i32*, i32** %5
%142 = getelementptr inbounds i32, i32* %141, i64 48
%143 = load i32, i32* %11
%144 = call i32 @neoscrypt_salsa(i32* %142, i32 %143)
%145 = load i32*, i32** %5
%146 = getelementptr inbounds i32, i32* %145, i64 16
%147 = load i32*, i32** %5
%148 = getelementptr inbounds i32, i32* %147, i64 32
%149 = call i32 @neoscrypt_blkswp(i32* %146, i32* %148, i32 64)
br label %150
150: ; preds = %108, %66
br label %262
151: ; preds = %60
store i32 0, i32* %9
br label %152
152: ; preds = %215, %151
%153 = load i32, i32* %9
%154 = load i32, i32* %7
%155 = mul i32 2, %154
%156 = icmp ult i32 %153, %155
br i1 %156, label %157, label %218
157: ; preds = %152
%158 = load i32, i32* %9
%159 = icmp ne i32 %158, 0
br i1 %159, label %160, label %173
160: ; preds = %157
%161 = load i32*, i32** %5
%162 = load i32, i32* %9
%163 = mul i32 16, %162
%164 = zext i32 %163 to i64
%165 = getelementptr inbounds i32, i32* %161, i64 %164
%166 = load i32*, i32** %5
%167 = load i32, i32* %9
%168 = sub i32 %167, 1
%169 = mul i32 16, %168
%170 = zext i32 %169 to i64
%171 = getelementptr inbounds i32, i32* %166, i64 %170
%172 = call i32 @neoscrypt_blkxor(i32* %165, i32* %171, i32 64)
br label %184
173: ; preds = %157
%174 = load i32*, i32** %5
%175 = getelementptr inbounds i32, i32* %174, i64 0
%176 = load i32*, i32** %5
%177 = load i32, i32* %7
%178 = mul i32 2, %177
%179 = sub i32 %178, 1
%180 = mul i32 16, %179
%181 = zext i32 %180 to i64
%182 = getelementptr inbounds i32, i32* %176, i64 %181
%183 = call i32 @neoscrypt_blkxor(i32* %175, i32* %182, i32 64)
br label %184
184: ; preds = %173, %160
%185 = load i32, i32* %10
%186 = icmp ne i32 %185, 0
br i1 %186, label %187, label %195
187: ; preds = %184
%188 = load i32*, i32** %5
%189 = load i32, i32* %9
%190 = mul i32 16, %189
%191 = zext i32 %190 to i64
%192 = getelementptr inbounds i32, i32* %188, i64 %191
%193 = load i32, i32* %11
%194 = call i32 @neoscrypt_chacha(i32* %192, i32 %193)
br label %203
195: ; preds = %184
%196 = load i32*, i32** %5
%197 = load i32, i32* %9
%198 = mul i32 16, %197
%199 = zext i32 %198 to i64
%200 = getelementptr inbounds i32, i32* %196, i64 %199
%201 = load i32, i32* %11
%202 = call i32 @neoscrypt_salsa(i32* %200, i32 %201)
br label %203
203: ; preds = %195, %187
%204 = load i32*, i32** %6
%205 = load i32, i32* %9
%206 = mul i32 16, %205
%207 = zext i32 %206 to i64
%208 = getelementptr inbounds i32, i32* %204, i64 %207
%209 = load i32*, i32** %5
%210 = load i32, i32* %9
%211 = mul i32 16, %210
%212 = zext i32 %211 to i64
%213 = getelementptr inbounds i32, i32* %209, i64 %212
%214 = call i32 @neoscrypt_blkcpy(i32* %208, i32* %213, i32 64)
br label %215
215: ; preds = %203
%216 = load i32, i32* %9
%217 = add i32 %216, 1
store i32 %217, i32* %9
br label %152
218: ; preds = %152
store i32 0, i32* %9
br label %219
219: ; preds = %235, %218
%220 = load i32, i32* %9
%221 = load i32, i32* %7
%222 = icmp ult i32 %220, %221
br i1 %222, label %223, label %238
223: ; preds = %219
%224 = load i32*, i32** %5
%225 = load i32, i32* %9
%226 = mul i32 16, %225
%227 = zext i32 %226 to i64
%228 = getelementptr inbounds i32, i32* %224, i64 %227
%229 = load i32*, i32** %6
%230 = load i32, i32* %9
%231 = mul i32 32, %230
%232 = zext i32 %231 to i64
%233 = getelementptr inbounds i32, i32* %229, i64 %232
%234 = call i32 @neoscrypt_blkcpy(i32* %228, i32* %233, i32 64)
br label %235
235: ; preds = %223
%236 = load i32, i32* %9
%237 = add i32 %236, 1
store i32 %237, i32* %9
br label %219
238: ; preds = %219
store i32 0, i32* %9
br label %239
239: ; preds = %259, %238
%240 = load i32, i32* %9
%241 = load i32, i32* %7
%242 = icmp ult i32 %240, %241
br i1 %242, label %243, label %262
243: ; preds = %239
%244 = load i32*, i32** %5
%245 = load i32, i32* %9
%246 = load i32, i32* %7
%247 = add i32 %245, %246
%248 = mul i32 16, %247
%249 = zext i32 %248 to i64
%250 = getelementptr inbounds i32, i32* %244, i64 %249
%251 = load i32*, i32** %6
%252 = load i32, i32* %9
%253 = mul i32 2, %252
%254 = add i32 %253, 1
%255 = mul i32 16, %254
%256 = zext i32 %255 to i64
%257 = getelementptr inbounds i32, i32* %251, i64 %256
%258 = call i32 @neoscrypt_blkcpy(i32* %250, i32* %257, i32 64)
br label %259
259: ; preds = %243
%260 = load i32, i32* %9
%261 = add i32 %260, 1
store i32 %261, i32* %9
br label %239
262: ; preds = %59, %150, %239
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 %23
i32 2, label %35
]
6: ; preds = %4
%7 = shl i32 %2, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %61, label %9
9: ; preds = %6
%10 = icmp ult i32 %3, 256
%11 = zext i32 %7 to i64
%12 = shl i32 %2, 5
%13 = add i32 %12, -16
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = tail call i32 @neoscrypt_blkxor(i32* %0, i32* %15, i32 64)
br i1 %10, label %19, label %17
17: ; preds = %9
%18 = tail call i32 @neoscrypt_chacha(i32* %0, i32 %5)
br label %21
19: ; preds = %9
%20 = tail call i32 @neoscrypt_salsa(i32* %0, i32 %5)
br label %21
21: ; preds = %17, %19
%22 = tail call i32 @neoscrypt_blkcpy(i32* %1, i32* %0, i32 64)
br label %65
23: ; preds = %4
%24 = icmp ult i32 %3, 256
%25 = getelementptr inbounds i32, i32* %0, i64 16
%26 = tail call i32 @neoscrypt_blkxor(i32* %0, i32* %25, i32 64)
br i1 %24, label %31, label %27
27: ; preds = %23
%28 = tail call i32 @neoscrypt_chacha(i32* %0, i32 %5)
%29 = tail call i32 @neoscrypt_blkxor(i32* %25, i32* %0, i32 64)
%30 = tail call i32 @neoscrypt_chacha(i32* %25, i32 %5)
br label %116
31: ; preds = %23
%32 = tail call i32 @neoscrypt_salsa(i32* %0, i32 %5)
%33 = tail call i32 @neoscrypt_blkxor(i32* %25, i32* %0, i32 64)
%34 = tail call i32 @neoscrypt_salsa(i32* %25, i32 %5)
br label %116
35: ; preds = %4
%36 = icmp ult i32 %3, 256
%37 = getelementptr inbounds i32, i32* %0, i64 48
%38 = tail call i32 @neoscrypt_blkxor(i32* %0, i32* %37, i32 64)
br i1 %36, label %50, label %39
39: ; preds = %35
%40 = tail call i32 @neoscrypt_chacha(i32* %0, i32 %5)
%41 = getelementptr inbounds i32, i32* %0, i64 16
%42 = tail call i32 @neoscrypt_blkxor(i32* %41, i32* %0, i32 64)
%43 = tail call i32 @neoscrypt_chacha(i32* %41, i32 %5)
%44 = getelementptr inbounds i32, i32* %0, i64 32
%45 = tail call i32 @neoscrypt_blkxor(i32* %44, i32* %41, i32 64)
%46 = tail call i32 @neoscrypt_chacha(i32* %44, i32 %5)
%47 = tail call i32 @neoscrypt_blkxor(i32* %37, i32* %44, i32 64)
%48 = tail call i32 @neoscrypt_chacha(i32* %37, i32 %5)
%49 = tail call i32 @neoscrypt_blkswp(i32* %41, i32* %44, i32 64)
br label %116
50: ; preds = %35
%51 = tail call i32 @neoscrypt_salsa(i32* %0, i32 %5)
%52 = getelementptr inbounds i32, i32* %0, i64 16
%53 = tail call i32 @neoscrypt_blkxor(i32* %52, i32* %0, i32 64)
%54 = tail call i32 @neoscrypt_salsa(i32* %52, i32 %5)
%55 = getelementptr inbounds i32, i32* %0, i64 32
%56 = tail call i32 @neoscrypt_blkxor(i32* %55, i32* %52, i32 64)
%57 = tail call i32 @neoscrypt_salsa(i32* %55, i32 %5)
%58 = tail call i32 @neoscrypt_blkxor(i32* %37, i32* %55, i32 64)
%59 = tail call i32 @neoscrypt_salsa(i32* %37, i32 %5)
%60 = tail call i32 @neoscrypt_blkswp(i32* %52, i32* %55, i32 64)
br label %116
61: ; preds = %82, %6
%62 = icmp eq i32 %2, 0
br i1 %62, label %116, label %63
63: ; preds = %61
%64 = zext i32 %2 to i64
br label %91
65: ; preds = %21, %82
%66 = phi i64 [ 1, %21 ], [ %86, %82 ]
%67 = trunc i64 %66 to i32
%68 = shl i32 %67, 4
%69 = zext i32 %68 to i64
%70 = getelementptr inbounds i32, i32* %0, i64 %69
%71 = add i32 %68, -16
%72 = zext i32 %71 to i64
%73 = getelementptr inbounds i32, i32* %0, i64 %72
%74 = tail call i32 @neoscrypt_blkxor(i32* %70, i32* %73, i32 64)
%75 = shl i64 %66, 4
%76 = and i64 %75, 4294967280
%77 = getelementptr inbounds i32, i32* %0, i64 %76
br i1 %10, label %80, label %78
78: ; preds = %65
%79 = tail call i32 @neoscrypt_chacha(i32* %77, i32 %5)
br label %82
80: ; preds = %65
%81 = tail call i32 @neoscrypt_salsa(i32* %77, i32 %5)
br label %82
82: ; preds = %80, %78
%83 = getelementptr inbounds i32, i32* %1, i64 %76
%84 = getelementptr inbounds i32, i32* %0, i64 %76
%85 = tail call i32 @neoscrypt_blkcpy(i32* %83, i32* %84, i32 64)
%86 = add nuw nsw i64 %66, 1
%87 = icmp eq i64 %86, %11
br i1 %87, label %61, label %65
88: ; preds = %91
br i1 %62, label %116, label %89
89: ; preds = %88
%90 = zext i32 %2 to i64
br label %102
91: ; preds = %63, %91
%92 = phi i64 [ 0, %63 ], [ %100, %91 ]
%93 = shl i64 %92, 4
%94 = and i64 %93, 4294967280
%95 = getelementptr inbounds i32, i32* %0, i64 %94
%96 = shl i64 %92, 5
%97 = and i64 %96, 4294967264
%98 = getelementptr inbounds i32, i32* %1, i64 %97
%99 = tail call i32 @neoscrypt_blkcpy(i32* %95, i32* %98, i32 64)
%100 = add nuw nsw i64 %92, 1
%101 = icmp eq i64 %100, %64
br i1 %101, label %88, label %91
102: ; preds = %89, %102
%103 = phi i64 [ 0, %89 ], [ %114, %102 ]
%104 = trunc i64 %103 to i32
%105 = add i32 %104, %2
%106 = shl i32 %105, 4
%107 = zext i32 %106 to i64
%108 = getelementptr inbounds i32, i32* %0, i64 %107
%109 = shl i64 %103, 5
%110 = and i64 %109, 4294967264
%111 = or i64 %110, 16
%112 = getelementptr inbounds i32, i32* %1, i64 %111
%113 = tail call i32 @neoscrypt_blkcpy(i32* %108, i32* %112, i32 64)
%114 = add nuw nsw i64 %103, 1
%115 = icmp eq i64 %114, %90
br i1 %115, label %116, label %102
116: ; preds = %102, %61, %88, %39, %50, %27, %31
ret void
}