#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*/ memcpy(unsigned char *, unsigned char const *, int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, size_t);
unsigned char rotl8(unsigned char const, int);
int /*<<< orphan*/ sub_9E9D8(unsigned char *, unsigned char *);
int encrypt(const unsigned char *input, size_t input_size,
            const unsigned char *iv, size_t iv_size, unsigned char *output,
            size_t *output_size) {
  unsigned char arr2[256];
  unsigned char arr3[256];
  size_t roundedsize, totalsize;
  if (iv_size != 32) {
    return -1;
  }
  roundedsize = input_size + (256 - (input_size % 256));
  totalsize = roundedsize + 32;
  if (output == NULL) {
    *output_size = totalsize;
    return 0;
  }
  if (*output_size < totalsize) {
    *output_size = totalsize;
    return -1;
  }
  for (int j = 0; j < 8; j++) {
    for (int i = 0; i < 32; i++) {
      arr2[32 * j + i] = rotl8(iv[i], j);
    }
  }
  memcpy(output, iv, 32);
  memcpy(output + 32, input, input_size);
  if (roundedsize > input_size) {
    memset(output + 32 + input_size, 0, roundedsize - input_size);
  }
  output[totalsize - 1] = 256 - (input_size % 256);
  for (size_t offset = 32; offset < totalsize; offset += 256) {
    for (int i = 0; i < 256; i++) {
      output[offset + i] ^= arr2[i];
    }
    sub_9E9D8(output + offset, arr3);
    memcpy(arr2, arr3, 256);
    memcpy(output + offset, arr3, 256);
  }
  *output_size = totalsize;
  return 0;
}


x86 assembly (clang, -O0):
<encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
cmpq   $0x20,-0x28(%rbp)
je     117a <encrypt+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1403 <encrypt+0x2c3>
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rdx
and    $0xff,%rdx
mov    $0x100,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x248(%rbp)
mov    -0x248(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x250(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11d2 <encrypt+0x92>
mov    -0x250(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1403 <encrypt+0x2c3>
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
cmp    -0x250(%rbp),%rax
jae    1200 <encrypt+0xc0>
mov    -0x250(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1403 <encrypt+0x2c3>
movl   $0x0,-0x254(%rbp)
cmpl   $0x8,-0x254(%rbp)
jge    1291 <encrypt+0x151>
movl   $0x0,-0x258(%rbp)
cmpl   $0x20,-0x258(%rbp)
jge    1278 <encrypt+0x138>
mov    -0x20(%rbp),%rax
movslq -0x258(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x254(%rbp),%esi
movzbl %al,%edi
call   1060 <rotl8@plt>
mov    %al,%cl
mov    -0x254(%rbp),%eax
shl    $0x5,%eax
add    -0x258(%rbp),%eax
cltq
mov    %cl,-0x140(%rbp,%rax,1)
mov    -0x258(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x258(%rbp)
jmp    1221 <encrypt+0xe1>
jmp    127d <encrypt+0x13d>
mov    -0x254(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x254(%rbp)
jmp    120a <encrypt+0xca>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x20,%edx
call   1050 <memcpy@plt>
mov    -0x30(%rbp),%rdi
add    $0x20,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    -0x248(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    12e9 <encrypt+0x1a9>
mov    -0x30(%rbp),%rdi
add    $0x20,%rdi
add    -0x18(%rbp),%rdi
mov    -0x248(%rbp),%rdx
sub    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rcx
and    $0xff,%rcx
mov    $0x100,%eax
sub    %rcx,%rax
mov    %al,%dl
mov    -0x30(%rbp),%rax
mov    -0x250(%rbp),%rcx
sub    $0x1,%rcx
mov    %dl,(%rax,%rcx,1)
movq   $0x20,-0x260(%rbp)
mov    -0x260(%rbp),%rax
cmp    -0x250(%rbp),%rax
jae    13ee <encrypt+0x2ae>
movl   $0x0,-0x264(%rbp)
cmpl   $0x100,-0x264(%rbp)
jge    138a <encrypt+0x24a>
movslq -0x264(%rbp),%rax
movzbl -0x140(%rbp,%rax,1),%esi
ff
mov    -0x30(%rbp),%rax
mov    -0x260(%rbp),%rcx
movslq -0x264(%rbp),%rdx
add    %rdx,%rcx
movzbl (%rax,%rcx,1),%edx
xor    %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x264(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x264(%rbp)
jmp    1339 <encrypt+0x1f9>
mov    -0x30(%rbp),%rdi
add    -0x260(%rbp),%rdi
lea    -0x240(%rbp),%rsi
call   1040 <sub_9E9D8@plt>
lea    -0x140(%rbp),%rdi
lea    -0x240(%rbp),%rsi
mov    $0x100,%edx
call   1050 <memcpy@plt>
mov    -0x30(%rbp),%rdi
add    -0x260(%rbp),%rdi
lea    -0x240(%rbp),%rsi
mov    $0x100,%edx
call   1050 <memcpy@plt>
mov    -0x260(%rbp),%rax
add    $0x100,%rax
mov    %rax,-0x260(%rbp)
jmp    131b <encrypt+0x1db>
mov    -0x250(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x228,%rsp
mov    $0xffffffff,%r14d
cmp    $0x20,%rcx
jne    1519 <encrypt+0x3d9>
mov    %r8,%rbx
mov    %rsi,%r15
movzbl %r15b,%eax
mov    $0x100,%ecx
sub    %rax,%rcx
lea    (%rcx,%rsi,1),%r13
add    $0x20,%r13
test   %r8,%r8
je     1513 <encrypt+0x3d3>
mov    $0xffffffff,%r14d
cmp    %r13,(%r9)
jb     1516 <encrypt+0x3d6>
mov    %rdx,%r12
mov    %rdi,0x18(%rsp)
mov    %r9,(%rsp)
mov    %rcx,%rax
mov    %rcx,0x8(%rsp)
lea    (%rcx,%r15,1),%rax
mov    %rax,0x10(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r12,%rbp,1),%edi
xor    %esi,%esi
call   1060 <rotl8@plt>
mov    %al,0x20(%rsp,%rbp,1)
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    11c0 <encrypt+0x80>
xor    %r14d,%r14d
nopl   (%rax)
movzbl (%r12,%r14,1),%edi
mov    $0x1,%esi
call   1060 <rotl8@plt>
mov    %al,0x40(%rsp,%r14,1)
add    $0x1,%r14
cmp    $0x20,%r14
jne    11e0 <encrypt+0xa0>
xor    %ebp,%ebp
movzbl (%r12,%rbp,1),%edi
mov    $0x2,%esi
call   1060 <rotl8@plt>
mov    %al,0x60(%rsp,%rbp,1)
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    1200 <encrypt+0xc0>
xor    %ebp,%ebp
mov    0x10(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%r12,%rbp,1),%edi
mov    $0x3,%esi
call   1060 <rotl8@plt>
mov    %al,0x80(%rsp,%rbp,1)
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    1230 <encrypt+0xf0>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r12,%rbp,1),%edi
mov    $0x4,%esi
call   1060 <rotl8@plt>
mov    %al,0xa0(%rsp,%rbp,1)
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    1260 <encrypt+0x120>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r12,%rbp,1),%edi
mov    $0x5,%esi
call   1060 <rotl8@plt>
mov    %al,0xc0(%rsp,%rbp,1)
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    1290 <encrypt+0x150>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r12,%rbp,1),%edi
mov    $0x6,%esi
call   1060 <rotl8@plt>
mov    %al,0xe0(%rsp,%rbp,1)
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    12c0 <encrypt+0x180>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r12,%rbp,1),%edi
mov    $0x7,%esi
call   1060 <rotl8@plt>
mov    %al,0x100(%rsp,%rbp,1)
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    12f0 <encrypt+0x1b0>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x20,%edx
call   1050 <memcpy@plt>
lea    0x20(%rbx),%rbp
mov    %rbp,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
call   1050 <memcpy@plt>
cmp    %r15,%r14
jbe    134b <encrypt+0x20b>
add    %r15,%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    0x8(%rsp),%rdx
call   1030 <memset@plt>
mov    0x8(%rsp),%rax
mov    %al,0x1f(%r14,%rbx,1)
xor    %r14d,%r14d
cmp    $0x21,%r13
jb     150d <encrypt+0x3cd>
mov    $0x20,%r15d
lea    0x120(%rsp),%r12
lea    (%rbx,%r15,1),%rbp
movups (%rbx,%r15,1),%xmm0
movups 0x10(%rbx,%r15,1),%xmm1
movups 0x20(%rbx,%r15,1),%xmm2
movups 0x30(%rbx,%r15,1),%xmm3
xorps  0x20(%rsp),%xmm0
xorps  0x30(%rsp),%xmm1
movups %xmm0,(%rbx,%r15,1)
movups %xmm1,0x10(%rbx,%r15,1)
xorps  0x40(%rsp),%xmm2
xorps  0x50(%rsp),%xmm3
movups %xmm2,0x20(%rbx,%r15,1)
movups %xmm3,0x30(%rbx,%r15,1)
movups 0x40(%rbx,%r15,1),%xmm0
movups 0x50(%rbx,%r15,1),%xmm1
xorps  0x60(%rsp),%xmm0
xorps  0x70(%rsp),%xmm1
movups %xmm0,0x40(%rbx,%r15,1)
movups %xmm1,0x50(%rbx,%r15,1)
movups 0x60(%rbx,%r15,1),%xmm0
movups 0x70(%rbx,%r15,1),%xmm1
xorps  0x80(%rsp),%xmm0
xorps  0x90(%rsp),%xmm1
movups %xmm0,0x60(%rbx,%r15,1)
movups %xmm1,0x70(%rbx,%r15,1)
movups 0x80(%rbx,%r15,1),%xmm0
movups 0x90(%rbx,%r15,1),%xmm1
xorps  0xa0(%rsp),%xmm0
xorps  0xb0(%rsp),%xmm1
movups %xmm0,0x80(%rbx,%r15,1)
movups %xmm1,0x90(%rbx,%r15,1)
movups 0xa0(%rbx,%r15,1),%xmm0
movups 0xb0(%rbx,%r15,1),%xmm1
xorps  0xc0(%rsp),%xmm0
xorps  0xd0(%rsp),%xmm1
movups %xmm0,0xa0(%rbx,%r15,1)
movups %xmm1,0xb0(%rbx,%r15,1)
movups 0xc0(%rbx,%r15,1),%xmm0
movups 0xd0(%rbx,%r15,1),%xmm1
xorps  0xe0(%rsp),%xmm0
xorps  0xf0(%rsp),%xmm1
movups %xmm0,0xc0(%rbx,%r15,1)
movups %xmm1,0xd0(%rbx,%r15,1)
movups 0xe0(%rbx,%r15,1),%xmm0
movups 0xf0(%rbx,%r15,1),%xmm1
xorps  0x100(%rsp),%xmm0
xorps  0x110(%rsp),%xmm1
movups %xmm0,0xe0(%rbx,%r15,1)
movups %xmm1,0xf0(%rbx,%r15,1)
mov    %rbp,%rdi
mov    %r12,%rsi
call   1040 <sub_9E9D8@plt>
lea    0x20(%rsp),%rdi
mov    %r12,%rsi
mov    $0x100,%edx
call   1050 <memcpy@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    $0x100,%edx
call   1050 <memcpy@plt>
add    $0x100,%r15
cmp    %r13,%r15
jb     1370 <encrypt+0x230>
mov    (%rsp),%r9
jmp    1516 <encrypt+0x3d6>
xor    %r14d,%r14d
mov    %r13,(%r9)
mov    %r14d,%eax
add    $0x228,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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