#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_1024_1_1_256_sp(const char *input, char *output, char *scratchpad) {
  uint8_t B[128];
  uint32_t X[32];
  uint32_t *V;
  uint32_t i, j, k;
  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]);
  for (i = 0; i < 1024; i++) {
    memcpy(&V[i * 32], X, 128);
    xor_salsa8(&X[0], &X[16]);
    xor_salsa8(&X[16], &X[0]);
  }
  for (i = 0; i < 1024; i++) {
    j = 32 * (X[16] & 1023);
    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_1024_1_1_256_sp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2c0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%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    11fb <scrypt_1024_1_1_256_sp+0xab>
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    11ac <scrypt_1024_1_1_256_sp+0x5c>
movl   $0x0,-0x2ac(%rbp)
cmpl   $0x400,-0x2ac(%rbp)
jge    1281 <scrypt_1024_1_1_256_sp+0x131>
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    1205 <scrypt_1024_1_1_256_sp+0xb5>
movl   $0x0,-0x2ac(%rbp)
cmpl   $0x400,-0x2ac(%rbp)
jge    134a <scrypt_1024_1_1_256_sp+0x1fa>
mov    -0x260(%rbp),%eax
and    $0x3ff,%eax
shl    $0x5,%eax
mov    %eax,-0x2b0(%rbp)
movl   $0x0,-0x2b4(%rbp)
cmpl   $0x20,-0x2b4(%rbp)
jge    1308 <scrypt_1024_1_1_256_sp+0x1b8>
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    12b9 <scrypt_1024_1_1_256_sp+0x169>
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    128b <scrypt_1024_1_1_256_sp+0x13b>
movl   $0x0,-0x2b4(%rbp)
cmpl   $0x20,-0x2b4(%rbp)
jge    13a1 <scrypt_1024_1_1_256_sp+0x251>
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    1354 <scrypt_1024_1_1_256_sp+0x204>
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_1024_1_1_256_sp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2a8,%rsp
mov    %rdx,%r15
mov    %rsi,0x18(%rsp)
add    $0x3f,%r15
and    $0xffffffffffffffc0,%r15
movl   $0x80,(%rsp)
lea    0xa0(%rsp),%rbx
mov    $0x50,%esi
mov    %rdi,0x10(%rsp)
mov    %rdi,%rdx
mov    $0x50,%ecx
mov    $0x1,%r8d
mov    %rbx,%r9
call   1030 <PBKDF2_SHA256@plt>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <le32dec@plt>
mov    %eax,0x20(%rsp,%rbp,4)
add    $0x1,%rbp
add    $0x10,%rbx
cmp    $0x20,%rbp
jne    11b0 <scrypt_1024_1_1_256_sp+0x60>
lea    0x60(%rsp),%r12
xor    %ebx,%ebx
lea    0x20(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
lea    (%r15,%rbx,1),%rdi
mov    %r13,%rsi
mov    $0x80,%edx
call   1050 <memcpy@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1070 <xor_salsa8@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1070 <xor_salsa8@plt>
sub    $0xffffffffffffff80,%rbx
cmp    $0x20000,%rbx
jne    11e0 <scrypt_1024_1_1_256_sp+0x90>
lea    0x80(%r15),%r14
lea    0x4(%r15),%rbp
xor    %ebx,%ebx
jmp    1307 <scrypt_1024_1_1_256_sp+0x1b7>
cs nopw 0x0(%rax,%rax,1)
movaps 0x20(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
movaps 0x40(%rsp),%xmm2
xorps  (%r15,%rax,4),%xmm0
movaps 0x50(%rsp),%xmm3
shl    $0x2,%rax
movaps %xmm0,0x20(%rsp)
mov    %rax,%rcx
or     $0x10,%rcx
xorps  (%r15,%rcx,1),%xmm1
movaps %xmm1,0x30(%rsp)
mov    %rax,%rcx
or     $0x20,%rcx
xorps  (%r15,%rcx,1),%xmm2
movaps %xmm2,0x40(%rsp)
mov    %rax,%rcx
or     $0x30,%rcx
xorps  (%r15,%rcx,1),%xmm3
movaps %xmm3,0x50(%rsp)
mov    %rax,%rcx
or     $0x40,%rcx
movaps 0x60(%rsp),%xmm0
xorps  (%r15,%rcx,1),%xmm0
movaps %xmm0,0x60(%rsp)
mov    %rax,%rcx
or     $0x50,%rcx
movaps 0x70(%rsp),%xmm0
xorps  (%r15,%rcx,1),%xmm0
movaps %xmm0,0x70(%rsp)
mov    %rax,%rcx
or     $0x60,%rcx
movaps 0x80(%rsp),%xmm0
xorps  (%r15,%rcx,1),%xmm0
movaps %xmm0,0x80(%rsp)
or     $0x70,%rax
movaps 0x90(%rsp),%xmm0
xorps  (%r15,%rax,1),%xmm0
movaps %xmm0,0x90(%rsp)
mov    %r13,%rdi
mov    %r12,%rsi
call   1070 <xor_salsa8@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1070 <xor_salsa8@plt>
add    $0x1,%ebx
cmp    $0x400,%ebx
je     136e <scrypt_1024_1_1_256_sp+0x21e>
mov    0x60(%rsp),%eax
shl    $0x5,%eax
and    $0x7fe0,%eax
lea    (%r14,%rax,4),%rcx
cmp    %rcx,%r13
jae    1230 <scrypt_1024_1_1_256_sp+0xe0>
lea    (%r15,%rax,4),%rcx
lea    0xa0(%rsp),%rdx
cmp    %rdx,%rcx
jae    1230 <scrypt_1024_1_1_256_sp+0xe0>
lea    0x0(,%rax,4),%rax
add    %rbp,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x4(%rax,%rcx,4),%edx
xor    %edx,0x20(%rsp,%rcx,4)
mov    (%rax,%rcx,4),%edx
xor    %edx,0x24(%rsp,%rcx,4)
add    $0x2,%rcx
cmp    $0x20,%rcx
jne    1350 <scrypt_1024_1_1_256_sp+0x200>
jmp    12e6 <scrypt_1024_1_1_256_sp+0x196>
lea    0xa0(%rsp),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    0x20(%rsp,%rbp,4),%esi
mov    %rbx,%rdi
call   1060 <le32enc@plt>
add    $0x1,%rbp
add    $0x10,%rbx
cmp    $0x20,%rbp
jne    1380 <scrypt_1024_1_1_256_sp+0x230>
movl   $0x20,(%rsp)
lea    0xa0(%rsp),%rdx
mov    0x10(%rsp),%rdi
mov    $0x50,%esi
mov    $0x80,%ecx
mov    $0x1,%r8d
mov    0x18(%rsp),%r9
call   1030 <PBKDF2_SHA256@plt>
add    $0x2a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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