#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) {
    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
sar    $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
jge    14e0 <neoscrypt_blkmix+0x390>
cmpl   $0x0,-0x1c(%rbp)
je     1436 <neoscrypt_blkmix+0x2e6>
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    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
cltq
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
cltq
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
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    13e3 <neoscrypt_blkmix+0x293>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1531 <neoscrypt_blkmix+0x3e1>
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    14e7 <neoscrypt_blkmix+0x397>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    158b <neoscrypt_blkmix+0x43b>
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    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,%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 %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 nsw i32 2, %154
%156 = icmp slt 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 nsw i32 16, %162
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds i32, i32* %161, i64 %164
%166 = load i32*, i32** %5
%167 = load i32, i32* %9
%168 = sub nsw i32 %167, 1
%169 = mul nsw i32 16, %168
%170 = sext 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 nsw i32 2, %177
%179 = sub nsw i32 %178, 1
%180 = mul nsw i32 16, %179
%181 = sext 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 nsw i32 16, %189
%191 = sext 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 nsw i32 16, %197
%199 = sext 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 nsw i32 16, %205
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds i32, i32* %204, i64 %207
%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 = call i32 @neoscrypt_blkcpy(i32* %208, i32* %213, i32 64)
br label %215
215: ; preds = %203
%216 = load i32, i32* %9
%217 = add nsw 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 slt 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 nsw i32 16, %225
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds i32, i32* %224, i64 %227
%229 = load i32*, i32** %6
%230 = load i32, i32* %9
%231 = mul nsw i32 32, %230
%232 = sext 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 nsw 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 slt 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 nsw i32 %245, %246
%248 = mul nsw i32 16, %247
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds i32, i32* %244, i64 %249
%251 = load i32*, i32** %6
%252 = load i32, i32* %9
%253 = mul nsw i32 2, %252
%254 = add nsw i32 %253, 1
%255 = mul nsw i32 16, %254
%256 = sext 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 nsw 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 %25
i32 2, label %37
]
6: ; preds = %4
%7 = icmp sgt i32 %2, 0
br i1 %7, label %8, label %115
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 %64, label %66
25: ; preds = %4
%26 = icmp ult i32 %3, 256
%27 = getelementptr inbounds i32, i32* %0, i64 16
%28 = tail call i32 @neoscrypt_blkxor(i32* %0, i32* %27, i32 64)
br i1 %26, label %33, label %29
29: ; preds = %25
%30 = tail call i32 @neoscrypt_chacha(i32* %0, i32 %5)
%31 = tail call i32 @neoscrypt_blkxor(i32* %27, i32* %0, i32 64)
%32 = tail call i32 @neoscrypt_chacha(i32* %27, i32 %5)
br label %115
33: ; preds = %25
%34 = tail call i32 @neoscrypt_salsa(i32* %0, i32 %5)
%35 = tail call i32 @neoscrypt_blkxor(i32* %27, i32* %0, i32 64)
%36 = tail call i32 @neoscrypt_salsa(i32* %27, i32 %5)
br label %115
37: ; preds = %4
%38 = icmp ult i32 %3, 256
%39 = getelementptr inbounds i32, i32* %0, i64 48
%40 = tail call i32 @neoscrypt_blkxor(i32* %0, i32* %39, i32 64)
br i1 %38, label %52, 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* %39, i32* %46, i32 64)
%50 = tail call i32 @neoscrypt_chacha(i32* %39, i32 %5)
%51 = tail call i32 @neoscrypt_blkswp(i32* %43, i32* %46, i32 64)
br label %115
52: ; preds = %37
%53 = tail call i32 @neoscrypt_salsa(i32* %0, i32 %5)
%54 = getelementptr inbounds i32, i32* %0, i64 16
%55 = tail call i32 @neoscrypt_blkxor(i32* %54, i32* %0, i32 64)
%56 = tail call i32 @neoscrypt_salsa(i32* %54, i32 %5)
%57 = getelementptr inbounds i32, i32* %0, i64 32
%58 = tail call i32 @neoscrypt_blkxor(i32* %57, i32* %54, i32 64)
%59 = tail call i32 @neoscrypt_salsa(i32* %57, i32 %5)
%60 = tail call i32 @neoscrypt_blkxor(i32* %39, i32* %57, i32 64)
%61 = tail call i32 @neoscrypt_salsa(i32* %39, i32 %5)
%62 = tail call i32 @neoscrypt_blkswp(i32* %54, i32* %57, i32 64)
br label %115
63: ; preds = %83
br i1 %7, label %64, label %115
64: ; preds = %22, %63
%65 = zext i32 %2 to i64
br label %92
66: ; preds = %22, %83
%67 = phi i64 [ %87, %83 ], [ 1, %22 ]
%68 = trunc i64 %67 to i32
%69 = shl nsw i32 %68, 4
%70 = zext i32 %69 to i64
%71 = getelementptr inbounds i32, i32* %0, i64 %70
%72 = add nsw i32 %69, -16
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i32, i32* %0, i64 %73
%75 = tail call i32 @neoscrypt_blkxor(i32* %71, i32* %74, i32 64)
%76 = shl i64 %67, 4
%77 = and i64 %76, 4294967280
%78 = getelementptr inbounds i32, i32* %0, i64 %77
br i1 %10, label %81, label %79
79: ; preds = %66
%80 = tail call i32 @neoscrypt_chacha(i32* %78, i32 %5)
br label %83
81: ; preds = %66
%82 = tail call i32 @neoscrypt_salsa(i32* %78, i32 %5)
br label %83
83: ; preds = %81, %79
%84 = getelementptr inbounds i32, i32* %1, i64 %77
%85 = getelementptr inbounds i32, i32* %0, i64 %77
%86 = tail call i32 @neoscrypt_blkcpy(i32* %84, i32* %85, i32 64)
%87 = add nuw nsw i64 %67, 1
%88 = icmp eq i64 %87, %12
br i1 %88, label %63, label %66
89: ; preds = %92
br i1 %7, label %90, label %115
90: ; preds = %89
%91 = zext i32 %2 to i64
br label %101
92: ; preds = %64, %92
%93 = phi i64 [ 0, %64 ], [ %99, %92 ]
%94 = shl nsw i64 %93, 4
%95 = getelementptr inbounds i32, i32* %0, i64 %94
%96 = shl nsw i64 %93, 5
%97 = getelementptr inbounds i32, i32* %1, i64 %96
%98 = tail call i32 @neoscrypt_blkcpy(i32* %95, i32* %97, i32 64)
%99 = add nuw nsw i64 %93, 1
%100 = icmp eq i64 %99, %65
br i1 %100, label %89, label %92
101: ; preds = %90, %101
%102 = phi i64 [ 0, %90 ], [ %113, %101 ]
%103 = trunc i64 %102 to i32
%104 = add nsw i32 %103, %2
%105 = shl nsw i32 %104, 4
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i32, i32* %0, i64 %106
%108 = shl i32 %103, 5
%109 = or i32 %108, 16
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i32, i32* %1, i64 %110
%112 = tail call i32 @neoscrypt_blkcpy(i32* %107, i32* %111, i32 64)
%113 = add nuw nsw i64 %102, 1
%114 = icmp eq i64 %113, %91
br i1 %114, label %115, label %101
115: ; preds = %101, %6, %63, %89, %41, %52, %29, %33
ret void
}