#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;
typedef int uint32_t;
typedef scalar_t__ scratchpad;

/* Variables and functions */
int /*<<< orphan*/ PBKDF2_SHA256(int /*<<< orphan*/ const *, int,
                                 int /*<<< orphan*/ const *, int, int,
                                 int /*<<< orphan*/ const *, int);
int le32dec(int /*<<< orphan*/ const *);
int /*<<< orphan*/ le32enc(int /*<<< orphan*/ const *, int);
int /*<<< orphan*/ memcpy(int *, int *, int);
int /*<<< orphan*/ xor_salsa8(int *, int *);
void scrypt_N_1_1_256_sp_generic(const char *input, char *output,
                                 char *scratchpad, unsigned char Nfactor) {
  uint8_t B[128];
  uint32_t X[32];
  uint32_t *V;
  uint32_t i, j, k, N;
  V = (uint32_t *)(((uintptr_t)(scratchpad) + 63) & ~(uintptr_t)(63));
  PBKDF2_SHA256((const uint8_t *)input, 80, (const uint8_t *)input, 80, 1, B,
                128);
  for (k = 0; k < 32; k++)
    X[k] = le32dec(&B[4 * k]);
  N = (1 << (Nfactor + 1));
  for (i = 0; i < N; i++) {
    memcpy(&V[i * 32], X, 128);
    xor_salsa8(&X[0], &X[16]);
    xor_salsa8(&X[16], &X[0]);
  }
  for (i = 0; i < N; i++) {
    j = 32 * (X[16] & (N - 1));
    for (k = 0; k < 32; k++)
      X[k] ^= V[j + k];
    xor_salsa8(&X[0], &X[16]);
    xor_salsa8(&X[16], &X[0]);
  }
  for (k = 0; k < 32; k++)
    le32enc(&B[4 * k], X[k]);
  PBKDF2_SHA256((const uint8_t *)input, 80, B, 128, 1, (uint8_t *)output, 32);
}


x86 assembly (clang, -O0):
<scrypt_N_1_1_256_sp_generic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2c0,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
add    $0x3f,%rax
and    $0xffffffffffffffc0,%rax
mov    %rax,-0x2a8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    -0x220(%rbp),%r9
mov    $0x50,%ecx
mov    $0x1,%r8d
mov    %ecx,%esi
movl   $0x80,(%rsp)
call   1030 <PBKDF2_SHA256@plt>
movl   $0x0,-0x2b4(%rbp)
cmpl   $0x20,-0x2b4(%rbp)
jge    1200 <scrypt_N_1_1_256_sp_generic+0xb0>
mov    -0x2b4(%rbp),%eax
shl    $0x2,%eax
cltq
lea    -0x220(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
call   1040 <le32dec@plt>
mov    %eax,%ecx
movslq -0x2b4(%rbp),%rax
mov    %ecx,-0x2a0(%rbp,%rax,4)
mov    -0x2b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2b4(%rbp)
jmp    11b1 <scrypt_N_1_1_256_sp_generic+0x61>
movzbl -0x19(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x2b8(%rbp)
movl   $0x0,-0x2ac(%rbp)
mov    -0x2ac(%rbp),%eax
cmp    -0x2b8(%rbp),%eax
jge    129c <scrypt_N_1_1_256_sp_generic+0x14c>
mov    -0x2a8(%rbp),%rdi
mov    -0x2ac(%rbp),%eax
shl    $0x5,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x2a0(%rbp),%rsi
mov    $0x80,%edx
call   1050 <memcpy@plt>
lea    -0x2a0(%rbp),%rdi
lea    -0x2a0(%rbp),%rsi
add    $0x40,%rsi
call   1070 <xor_salsa8@plt>
lea    -0x2a0(%rbp),%rdi
add    $0x40,%rdi
lea    -0x2a0(%rbp),%rsi
call   1070 <xor_salsa8@plt>
mov    -0x2ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2ac(%rbp)
jmp    121e <scrypt_N_1_1_256_sp_generic+0xce>
movl   $0x0,-0x2ac(%rbp)
mov    -0x2ac(%rbp),%eax
cmp    -0x2b8(%rbp),%eax
jge    136d <scrypt_N_1_1_256_sp_generic+0x21d>
mov    -0x260(%rbp),%eax
mov    -0x2b8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
shl    $0x5,%eax
mov    %eax,-0x2b0(%rbp)
movl   $0x0,-0x2b4(%rbp)
cmpl   $0x20,-0x2b4(%rbp)
jge    132b <scrypt_N_1_1_256_sp_generic+0x1db>
mov    -0x2a8(%rbp),%rax
mov    -0x2b0(%rbp),%ecx
add    -0x2b4(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x2b4(%rbp),%rax
xor    -0x2a0(%rbp,%rax,4),%ecx
mov    %ecx,-0x2a0(%rbp,%rax,4)
mov    -0x2b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2b4(%rbp)
jmp    12dc <scrypt_N_1_1_256_sp_generic+0x18c>
lea    -0x2a0(%rbp),%rdi
lea    -0x2a0(%rbp),%rsi
add    $0x40,%rsi
call   1070 <xor_salsa8@plt>
lea    -0x2a0(%rbp),%rdi
add    $0x40,%rdi
lea    -0x2a0(%rbp),%rsi
call   1070 <xor_salsa8@plt>
mov    -0x2ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2ac(%rbp)
jmp    12a6 <scrypt_N_1_1_256_sp_generic+0x156>
movl   $0x0,-0x2b4(%rbp)
cmpl   $0x20,-0x2b4(%rbp)
jge    13c4 <scrypt_N_1_1_256_sp_generic+0x274>
mov    -0x2b4(%rbp),%eax
shl    $0x2,%eax
cltq
lea    -0x220(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
movslq -0x2b4(%rbp),%rax
mov    -0x2a0(%rbp,%rax,4),%esi
call   1060 <le32enc@plt>
mov    -0x2b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2b4(%rbp)
jmp    1377 <scrypt_N_1_1_256_sp_generic+0x227>
mov    -0x8(%rbp),%rdi
lea    -0x220(%rbp),%rdx
mov    -0x10(%rbp),%r9
mov    $0x50,%esi
mov    $0x80,%ecx
mov    $0x1,%r8d
movl   $0x20,(%rsp)
call   1030 <PBKDF2_SHA256@plt>
add    $0x2c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrypt_N_1_1_256_sp_generic>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2b8,%rsp
mov    %ecx,%r12d
mov    %rdx,%r14
mov    %rsi,0x20(%rsp)
add    $0x3f,%r14
and    $0xffffffffffffffc0,%r14
movl   $0x80,(%rsp)
lea    0xb0(%rsp),%rbp
mov    $0x50,%esi
mov    %rdi,0x18(%rsp)
mov    %rdi,%rdx
mov    $0x50,%ecx
mov    $0x1,%r8d
mov    %rbp,%r9
call   1030 <PBKDF2_SHA256@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
call   1040 <le32dec@plt>
mov    %eax,0x30(%rsp,%rbx,4)
add    $0x1,%rbx
add    $0x10,%rbp
cmp    $0x20,%rbx
jne    11b0 <scrypt_N_1_1_256_sp_generic+0x60>
mov    $0x2,%eax
mov    %r12d,%ecx
shl    %cl,%eax
mov    %eax,0x14(%rsp)
test   %eax,%eax
jle    13ae <scrypt_N_1_1_256_sp_generic+0x25e>
lea    0x70(%rsp),%r13
mov    0x14(%rsp),%ebp
lea    0x30(%rsp),%r12
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x80,%edx
call   1050 <memcpy@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1070 <xor_salsa8@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1070 <xor_salsa8@plt>
sub    $0xffffffffffffff80,%rbx
add    $0xffffffffffffffff,%rbp
jne    1200 <scrypt_N_1_1_256_sp_generic+0xb0>
cmpl   $0x0,0x14(%rsp)
jle    13ae <scrypt_N_1_1_256_sp_generic+0x25e>
movslq 0x14(%rsp),%rbx
add    $0xffffffffffffffff,%rbx
lea    0x80(%r14),%rbp
lea    0x4(%r14),%rax
mov    %rax,0x28(%rsp)
xor    %r13d,%r13d
jmp    1342 <scrypt_N_1_1_256_sp_generic+0x1f2>
nopl   0x0(%rax)
movaps 0x30(%rsp),%xmm0
movaps 0x40(%rsp),%xmm1
movaps 0x50(%rsp),%xmm2
xorps  (%r14,%rax,4),%xmm0
movaps 0x60(%rsp),%xmm3
shl    $0x2,%rax
movaps %xmm0,0x30(%rsp)
mov    %rax,%rcx
or     $0x10,%rcx
xorps  (%r14,%rcx,1),%xmm1
movaps %xmm1,0x40(%rsp)
mov    %rax,%rcx
or     $0x20,%rcx
xorps  (%r14,%rcx,1),%xmm2
movaps %xmm2,0x50(%rsp)
mov    %rax,%rcx
or     $0x30,%rcx
xorps  (%r14,%rcx,1),%xmm3
movaps %xmm3,0x60(%rsp)
mov    %rax,%rcx
or     $0x40,%rcx
movaps 0x70(%rsp),%xmm0
xorps  (%r14,%rcx,1),%xmm0
movaps %xmm0,0x70(%rsp)
mov    %rax,%rcx
or     $0x50,%rcx
movaps 0x80(%rsp),%xmm0
xorps  (%r14,%rcx,1),%xmm0
movaps %xmm0,0x80(%rsp)
mov    %rax,%rcx
or     $0x60,%rcx
movaps 0x90(%rsp),%xmm0
xorps  (%r14,%rcx,1),%xmm0
movaps %xmm0,0x90(%rsp)
or     $0x70,%rax
movaps 0xa0(%rsp),%xmm0
xorps  (%r14,%rax,1),%xmm0
movaps %xmm0,0xa0(%rsp)
mov    %r12,%rdi
lea    0x70(%rsp),%r15
mov    %r15,%rsi
call   1070 <xor_salsa8@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <xor_salsa8@plt>
add    $0x1,%r13d
cmp    0x14(%rsp),%r13d
je     13ae <scrypt_N_1_1_256_sp_generic+0x25e>
movslq 0x70(%rsp),%rcx
and    %rbx,%rcx
mov    %rcx,%rax
shl    $0x5,%rax
shl    $0x7,%rcx
lea    (%rcx,%rbp,1),%rdx
cmp    %rdx,%r12
jae    1260 <scrypt_N_1_1_256_sp_generic+0x110>
add    %r14,%rcx
lea    0xb0(%rsp),%rdx
cmp    %rdx,%rcx
jae    1260 <scrypt_N_1_1_256_sp_generic+0x110>
mov    0x28(%rsp),%rcx
lea    (%rcx,%rax,4),%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rax,%rcx,4),%edx
xor    %edx,0x30(%rsp,%rcx,4)
mov    (%rax,%rcx,4),%edx
xor    %edx,0x34(%rsp,%rcx,4)
add    $0x2,%rcx
cmp    $0x20,%rcx
jne    1390 <scrypt_N_1_1_256_sp_generic+0x240>
jmp    131c <scrypt_N_1_1_256_sp_generic+0x1cc>
lea    0xb0(%rsp),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    0x30(%rsp,%rbp,4),%esi
mov    %rbx,%rdi
call   1060 <le32enc@plt>
add    $0x1,%rbp
add    $0x10,%rbx
cmp    $0x20,%rbp
jne    13c0 <scrypt_N_1_1_256_sp_generic+0x270>
movl   $0x20,(%rsp)
lea    0xb0(%rsp),%rdx
mov    0x18(%rsp),%rdi
mov    $0x50,%esi
mov    $0x80,%ecx
mov    $0x1,%r8d
mov    0x20(%rsp),%r9
call   1030 <PBKDF2_SHA256@plt>
add    $0x2b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @scrypt_N_1_1_256_sp_generic(i8* %0, i8* %1, i8* %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8
%9 = alloca [128 x i32]
%10 = alloca [32 x i32]
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8 %3, i8* %8
%16 = load i8*, i8** %7
%17 = ptrtoint i8* %16 to i64
%18 = add i64 %17, 63
%19 = and i64 %18, -64
%20 = inttoptr i64 %19 to i32*
store i32* %20, i32** %11
%21 = load i8*, i8** %5
%22 = bitcast i8* %21 to i32*
%23 = load i8*, i8** %5
%24 = bitcast i8* %23 to i32*
%25 = getelementptr inbounds [128 x i32], [128 x i32]* %9, i64 0, i64 0
%26 = call i32 @PBKDF2_SHA256(i32* %22, i32 80, i32* %24, i32 80, i32 1, i32* %25, i32 128)
store i32 0, i32* %14
br label %27
27: ; preds = %39, %4
%28 = load i32, i32* %14
%29 = icmp slt i32 %28, 32
br i1 %29, label %30, label %42
30: ; preds = %27
%31 = load i32, i32* %14
%32 = mul nsw i32 4, %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [128 x i32], [128 x i32]* %9, i64 0, i64 %33
%35 = call i32 @le32dec(i32* %34)
%36 = load i32, i32* %14
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 %37
store i32 %35, i32* %38
br label %39
39: ; preds = %30
%40 = load i32, i32* %14
%41 = add nsw i32 %40, 1
store i32 %41, i32* %14
br label %27
42: ; preds = %27
%43 = load i8, i8* %8
%44 = zext i8 %43 to i32
%45 = add nsw i32 %44, 1
%46 = shl i32 1, %45
store i32 %46, i32* %15
store i32 0, i32* %12
br label %47
47: ; preds = %65, %42
%48 = load i32, i32* %12
%49 = load i32, i32* %15
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %68
51: ; preds = %47
%52 = load i32*, i32** %11
%53 = load i32, i32* %12
%54 = mul nsw i32 %53, 32
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %52, i64 %55
%57 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 0
%58 = call i32 @memcpy(i32* %56, i32* %57, i32 128)
%59 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 0
%60 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 16
%61 = call i32 @xor_salsa8(i32* %59, i32* %60)
%62 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 16
%63 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 0
%64 = call i32 @xor_salsa8(i32* %62, i32* %63)
br label %65
65: ; preds = %51
%66 = load i32, i32* %12
%67 = add nsw i32 %66, 1
store i32 %67, i32* %12
br label %47
68: ; preds = %47
store i32 0, i32* %12
br label %69
69: ; preds = %106, %68
%70 = load i32, i32* %12
%71 = load i32, i32* %15
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %109
73: ; preds = %69
%74 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 16
%75 = load i32, i32* %74
%76 = load i32, i32* %15
%77 = sub nsw i32 %76, 1
%78 = and i32 %75, %77
%79 = mul nsw i32 32, %78
store i32 %79, i32* %13
store i32 0, i32* %14
br label %80
80: ; preds = %96, %73
%81 = load i32, i32* %14
%82 = icmp slt i32 %81, 32
br i1 %82, label %83, label %99
83: ; preds = %80
%84 = load i32*, i32** %11
%85 = load i32, i32* %13
%86 = load i32, i32* %14
%87 = add nsw i32 %85, %86
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32, i32* %84, i64 %88
%90 = load i32, i32* %89
%91 = load i32, i32* %14
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 %92
%94 = load i32, i32* %93
%95 = xor i32 %94, %90
store i32 %95, i32* %93
br label %96
96: ; preds = %83
%97 = load i32, i32* %14
%98 = add nsw i32 %97, 1
store i32 %98, i32* %14
br label %80
99: ; preds = %80
%100 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 0
%101 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 16
%102 = call i32 @xor_salsa8(i32* %100, i32* %101)
%103 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 16
%104 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 0
%105 = call i32 @xor_salsa8(i32* %103, i32* %104)
br label %106
106: ; preds = %99
%107 = load i32, i32* %12
%108 = add nsw i32 %107, 1
store i32 %108, i32* %12
br label %69
109: ; preds = %69
store i32 0, i32* %14
br label %110
110: ; preds = %123, %109
%111 = load i32, i32* %14
%112 = icmp slt i32 %111, 32
br i1 %112, label %113, label %126
113: ; preds = %110
%114 = load i32, i32* %14
%115 = mul nsw i32 4, %114
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [128 x i32], [128 x i32]* %9, i64 0, i64 %116
%118 = load i32, i32* %14
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 %119
%121 = load i32, i32* %120
%122 = call i32 @le32enc(i32* %117, i32 %121)
br label %123
123: ; preds = %113
%124 = load i32, i32* %14
%125 = add nsw i32 %124, 1
store i32 %125, i32* %14
br label %110
126: ; preds = %110
%127 = load i8*, i8** %5
%128 = bitcast i8* %127 to i32*
%129 = getelementptr inbounds [128 x i32], [128 x i32]* %9, i64 0, i64 0
%130 = load i8*, i8** %6
%131 = bitcast i8* %130 to i32*
%132 = call i32 @PBKDF2_SHA256(i32* %128, i32 80, i32* %129, i32 128, i32 1, i32* %131, i32 32)
ret void
}

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