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

/* Variables and functions */
int /*<<< orphan*/ RC2_encrypt(unsigned long *, int /*<<< orphan*/ *);
void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length,
                       RC2_KEY *schedule, unsigned char *ivec, int *num,
                       int encrypt) {
  register unsigned long v0, v1, t;
  register int n = *num;
  register long l = length;
  unsigned long ti[2];
  unsigned char *iv, c, cc;
  iv = (unsigned char *)ivec;
  if (encrypt) {
    while (l--) {
      if (n == 0) {
        (v0 = ((unsigned long)(*((iv)++))),
         v0 |= ((unsigned long)(*((iv)++))) << 8L,
         v0 |= ((unsigned long)(*((iv)++))) << 16L,
         v0 |= ((unsigned long)(*((iv)++))) << 24L);
        ti[0] = v0;
        (v1 = ((unsigned long)(*((iv)++))),
         v1 |= ((unsigned long)(*((iv)++))) << 8L,
         v1 |= ((unsigned long)(*((iv)++))) << 16L,
         v1 |= ((unsigned long)(*((iv)++))) << 24L);
        ti[1] = v1;
        RC2_encrypt((unsigned long *)ti, schedule);
        iv = (unsigned char *)ivec;
        t = ti[0];
        (*((iv)++) = (unsigned char)(((t)) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 24L) & 0xff));
        t = ti[1];
        (*((iv)++) = (unsigned char)(((t)) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 24L) & 0xff));
        iv = (unsigned char *)ivec;
      }
      c = *(in++) ^ iv[n];
      *(out++) = c;
      iv[n] = c;
      n = (n + 1) & 0x07;
    }
  } else {
    while (l--) {
      if (n == 0) {
        (v0 = ((unsigned long)(*((iv)++))),
         v0 |= ((unsigned long)(*((iv)++))) << 8L,
         v0 |= ((unsigned long)(*((iv)++))) << 16L,
         v0 |= ((unsigned long)(*((iv)++))) << 24L);
        ti[0] = v0;
        (v1 = ((unsigned long)(*((iv)++))),
         v1 |= ((unsigned long)(*((iv)++))) << 8L,
         v1 |= ((unsigned long)(*((iv)++))) << 16L,
         v1 |= ((unsigned long)(*((iv)++))) << 24L);
        ti[1] = v1;
        RC2_encrypt((unsigned long *)ti, schedule);
        iv = (unsigned char *)ivec;
        t = ti[0];
        (*((iv)++) = (unsigned char)(((t)) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 24L) & 0xff));
        t = ti[1];
        (*((iv)++) = (unsigned char)(((t)) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 24L) & 0xff));
        iv = (unsigned char *)ivec;
      }
      cc = *(in++);
      c = iv[n];
      iv[n] = cc;
      *(out++) = c ^ cc;
      n = (n + 1) & 0x07;
    }
  }
  v0 = v1 = ti[0] = ti[1] = t = c = cc = 0;
  *num = n;
}


x86 assembly (clang, -O0):
<RC2_cfb64_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x78(%rbp)
cmpl   $0x0,0x10(%rbp)
je     13f9 <RC2_cfb64_encrypt+0x2e9>
jmp    115e <RC2_cfb64_encrypt+0x4e>
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x58(%rbp)
cmp    $0x0,%rax
je     13f4 <RC2_cfb64_encrypt+0x2e4>
cmpl   $0x0,-0x4c(%rbp)
jne    139e <RC2_cfb64_encrypt+0x28e>
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
mov    %rax,-0x38(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x8,%rax
or     -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x10,%rax
or     -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x18,%rax
or     -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
mov    %rax,-0x40(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x8,%rax
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x10,%rax
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x18,%rax
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <RC2_encrypt@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x68(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    -0x78(%rbp),%rcx
movslq -0x4c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x79(%rbp),%dl
mov    -0x78(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
and    $0x7,%eax
mov    %eax,-0x4c(%rbp)
jmp    115e <RC2_cfb64_encrypt+0x4e>
jmp    16a1 <RC2_cfb64_encrypt+0x591>
jmp    13fe <RC2_cfb64_encrypt+0x2ee>
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x58(%rbp)
cmp    $0x0,%rax
je     169c <RC2_cfb64_encrypt+0x58c>
cmpl   $0x0,-0x4c(%rbp)
jne    163e <RC2_cfb64_encrypt+0x52e>
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
mov    %rax,-0x38(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x8,%rax
or     -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x10,%rax
or     -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x18,%rax
or     -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
mov    %rax,-0x40(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x8,%rax
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x10,%rax
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x18,%rax
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <RC2_encrypt@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x68(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x7a(%rbp)
mov    -0x78(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x79(%rbp)
mov    -0x7a(%rbp),%dl
mov    -0x78(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movzbl -0x79(%rbp),%eax
movzbl -0x7a(%rbp),%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
and    $0x7,%eax
mov    %eax,-0x4c(%rbp)
jmp    13fe <RC2_cfb64_encrypt+0x2ee>
jmp    16a1 <RC2_cfb64_encrypt+0x591>
movb   $0x0,-0x7a(%rbp)
movb   $0x0,-0x79(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x68(%rbp)
movq   $0x0,-0x70(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RC2_cfb64_encrypt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%rbx
mov    %rcx,0x18(%rsp)
mov    %rdx,%r12
mov    %rdi,%r13
mov    %r9,0x20(%rsp)
mov    (%r9),%r14d
cmpl   $0x0,0x60(%rsp)
mov    %rsi,0x10(%rsp)
je     11aa <RC2_cfb64_encrypt+0x9a>
test   %r12,%r12
je     121a <RC2_cfb64_encrypt+0x10a>
xor    %ebp,%ebp
mov    %rsp,%r15
jmp    1177 <RC2_cfb64_encrypt+0x67>
movslq %r14d,%rax
movzbl (%rbx,%rax,1),%ecx
xor    0x0(%r13,%rbp,1),%cl
mov    %cl,(%rsi,%rbp,1)
mov    %cl,(%rbx,%rax,1)
add    $0x1,%r14d
and    $0x7,%r14d
add    $0x1,%rbp
cmp    %rbp,%r12
je     121a <RC2_cfb64_encrypt+0x10a>
test   %r14d,%r14d
jne    1150 <RC2_cfb64_encrypt+0x40>
mov    (%rbx),%eax
mov    %rax,(%rsp)
mov    0x4(%rbx),%eax
mov    %rax,0x8(%rsp)
mov    %r15,%rdi
mov    0x18(%rsp),%rsi
call   1030 <RC2_encrypt@plt>
mov    0x10(%rsp),%rsi
mov    (%rsp),%eax
mov    %eax,(%rbx)
mov    0x8(%rsp),%eax
mov    %eax,0x4(%rbx)
jmp    1150 <RC2_cfb64_encrypt+0x40>
test   %r12,%r12
je     121a <RC2_cfb64_encrypt+0x10a>
xor    %r15d,%r15d
mov    %rsp,%rbp
jmp    11e7 <RC2_cfb64_encrypt+0xd7>
nopw   0x0(%rax,%rax,1)
movzbl 0x0(%r13,%r15,1),%eax
movslq %r14d,%rcx
movzbl (%rbx,%rcx,1),%edx
xor    %al,%dl
mov    %al,(%rbx,%rcx,1)
mov    %dl,(%rsi,%r15,1)
add    $0x1,%r14d
and    $0x7,%r14d
add    $0x1,%r15
cmp    %r15,%r12
je     121a <RC2_cfb64_encrypt+0x10a>
test   %r14d,%r14d
jne    11c0 <RC2_cfb64_encrypt+0xb0>
mov    (%rbx),%eax
mov    %rax,(%rsp)
mov    0x4(%rbx),%eax
mov    %rax,0x8(%rsp)
mov    %rbp,%rdi
mov    0x18(%rsp),%rsi
call   1030 <RC2_encrypt@plt>
mov    0x10(%rsp),%rsi
mov    (%rsp),%eax
mov    %eax,(%rbx)
mov    0x8(%rsp),%eax
mov    %eax,0x4(%rbx)
jmp    11c0 <RC2_cfb64_encrypt+0xb0>
mov    0x20(%rsp),%rax
mov    %r14d,(%rax)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @RC2_cfb64_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i32
%19 = alloca i64
%20 = alloca [2 x i64]
%21 = alloca i8*
%22 = alloca i8
%23 = alloca i8
store i8* %0, i8** %8
store i8* %1, i8** %9
store i64 %2, i64* %10
store i32* %3, i32** %11
store i8* %4, i8** %12
store i32* %5, i32** %13
store i32 %6, i32* %14
%24 = load i32*, i32** %13
%25 = load i32, i32* %24
store i32 %25, i32* %18
%26 = load i64, i64* %10
store i64 %26, i64* %19
%27 = load i8*, i8** %12
store i8* %27, i8** %21
%28 = load i32, i32* %14
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %173
30: ; preds = %7
br label %31
31: ; preds = %148, %30
%32 = load i64, i64* %19
%33 = add nsw i64 %32, -1
store i64 %33, i64* %19
%34 = icmp ne i64 %32, 0
br i1 %34, label %35, label %172
35: ; preds = %31
%36 = load i32, i32* %18
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %148
38: ; preds = %35
%39 = load i8*, i8** %21
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %21
%41 = load i8, i8* %39
%42 = zext i8 %41 to i64
store i64 %42, i64* %15
%43 = load i8*, i8** %21
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %21
%45 = load i8, i8* %43
%46 = zext i8 %45 to i64
%47 = shl i64 %46, 8
%48 = load i64, i64* %15
%49 = or i64 %48, %47
store i64 %49, i64* %15
%50 = load i8*, i8** %21
%51 = getelementptr inbounds i8, i8* %50, i32 1
store i8* %51, i8** %21
%52 = load i8, i8* %50
%53 = zext i8 %52 to i64
%54 = shl i64 %53, 16
%55 = load i64, i64* %15
%56 = or i64 %55, %54
store i64 %56, i64* %15
%57 = load i8*, i8** %21
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %21
%59 = load i8, i8* %57
%60 = zext i8 %59 to i64
%61 = shl i64 %60, 24
%62 = load i64, i64* %15
%63 = or i64 %62, %61
store i64 %63, i64* %15
%64 = load i64, i64* %15
%65 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 0
store i64 %64, i64* %65
%66 = load i8*, i8** %21
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %21
%68 = load i8, i8* %66
%69 = zext i8 %68 to i64
store i64 %69, i64* %16
%70 = load i8*, i8** %21
%71 = getelementptr inbounds i8, i8* %70, i32 1
store i8* %71, i8** %21
%72 = load i8, i8* %70
%73 = zext i8 %72 to i64
%74 = shl i64 %73, 8
%75 = load i64, i64* %16
%76 = or i64 %75, %74
store i64 %76, i64* %16
%77 = load i8*, i8** %21
%78 = getelementptr inbounds i8, i8* %77, i32 1
store i8* %78, i8** %21
%79 = load i8, i8* %77
%80 = zext i8 %79 to i64
%81 = shl i64 %80, 16
%82 = load i64, i64* %16
%83 = or i64 %82, %81
store i64 %83, i64* %16
%84 = load i8*, i8** %21
%85 = getelementptr inbounds i8, i8* %84, i32 1
store i8* %85, i8** %21
%86 = load i8, i8* %84
%87 = zext i8 %86 to i64
%88 = shl i64 %87, 24
%89 = load i64, i64* %16
%90 = or i64 %89, %88
store i64 %90, i64* %16
%91 = load i64, i64* %16
%92 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 1
store i64 %91, i64* %92
%93 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 0
%94 = load i32*, i32** %11
%95 = call i32 @RC2_encrypt(i64* %93, i32* %94)
%96 = load i8*, i8** %12
store i8* %96, i8** %21
%97 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 0
%98 = load i64, i64* %97
store i64 %98, i64* %17
%99 = load i64, i64* %17
%100 = and i64 %99, 255
%101 = trunc i64 %100 to i8
%102 = load i8*, i8** %21
%103 = getelementptr inbounds i8, i8* %102, i32 1
store i8* %103, i8** %21
store i8 %101, i8* %102
%104 = load i64, i64* %17
%105 = lshr i64 %104, 8
%106 = and i64 %105, 255
%107 = trunc i64 %106 to i8
%108 = load i8*, i8** %21
%109 = getelementptr inbounds i8, i8* %108, i32 1
store i8* %109, i8** %21
store i8 %107, i8* %108
%110 = load i64, i64* %17
%111 = lshr i64 %110, 16
%112 = and i64 %111, 255
%113 = trunc i64 %112 to i8
%114 = load i8*, i8** %21
%115 = getelementptr inbounds i8, i8* %114, i32 1
store i8* %115, i8** %21
store i8 %113, i8* %114
%116 = load i64, i64* %17
%117 = lshr i64 %116, 24
%118 = and i64 %117, 255
%119 = trunc i64 %118 to i8
%120 = load i8*, i8** %21
%121 = getelementptr inbounds i8, i8* %120, i32 1
store i8* %121, i8** %21
store i8 %119, i8* %120
%122 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 1
%123 = load i64, i64* %122
store i64 %123, i64* %17
%124 = load i64, i64* %17
%125 = and i64 %124, 255
%126 = trunc i64 %125 to i8
%127 = load i8*, i8** %21
%128 = getelementptr inbounds i8, i8* %127, i32 1
store i8* %128, i8** %21
store i8 %126, i8* %127
%129 = load i64, i64* %17
%130 = lshr i64 %129, 8
%131 = and i64 %130, 255
%132 = trunc i64 %131 to i8
%133 = load i8*, i8** %21
%134 = getelementptr inbounds i8, i8* %133, i32 1
store i8* %134, i8** %21
store i8 %132, i8* %133
%135 = load i64, i64* %17
%136 = lshr i64 %135, 16
%137 = and i64 %136, 255
%138 = trunc i64 %137 to i8
%139 = load i8*, i8** %21
%140 = getelementptr inbounds i8, i8* %139, i32 1
store i8* %140, i8** %21
store i8 %138, i8* %139
%141 = load i64, i64* %17
%142 = lshr i64 %141, 24
%143 = and i64 %142, 255
%144 = trunc i64 %143 to i8
%145 = load i8*, i8** %21
%146 = getelementptr inbounds i8, i8* %145, i32 1
store i8* %146, i8** %21
store i8 %144, i8* %145
%147 = load i8*, i8** %12
store i8* %147, i8** %21
br label %148
148: ; preds = %38, %35
%149 = load i8*, i8** %8
%150 = getelementptr inbounds i8, i8* %149, i32 1
store i8* %150, i8** %8
%151 = load i8, i8* %149
%152 = zext i8 %151 to i32
%153 = load i8*, i8** %21
%154 = load i32, i32* %18
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8, i8* %153, i64 %155
%157 = load i8, i8* %156
%158 = zext i8 %157 to i32
%159 = xor i32 %152, %158
%160 = trunc i32 %159 to i8
store i8 %160, i8* %22
%161 = load i8, i8* %22
%162 = load i8*, i8** %9
%163 = getelementptr inbounds i8, i8* %162, i32 1
store i8* %163, i8** %9
store i8 %161, i8* %162
%164 = load i8, i8* %22
%165 = load i8*, i8** %21
%166 = load i32, i32* %18
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds i8, i8* %165, i64 %167
store i8 %164, i8* %168
%169 = load i32, i32* %18
%170 = add nsw i32 %169, 1
%171 = and i32 %170, 7
store i32 %171, i32* %18
br label %31
172: ; preds = %31
br label %317
173: ; preds = %7
br label %174
174: ; preds = %291, %173
%175 = load i64, i64* %19
%176 = add nsw i64 %175, -1
store i64 %176, i64* %19
%177 = icmp ne i64 %175, 0
br i1 %177, label %178, label %316
178: ; preds = %174
%179 = load i32, i32* %18
%180 = icmp eq i32 %179, 0
br i1 %180, label %181, label %291
181: ; preds = %178
%182 = load i8*, i8** %21
%183 = getelementptr inbounds i8, i8* %182, i32 1
store i8* %183, i8** %21
%184 = load i8, i8* %182
%185 = zext i8 %184 to i64
store i64 %185, i64* %15
%186 = load i8*, i8** %21
%187 = getelementptr inbounds i8, i8* %186, i32 1
store i8* %187, i8** %21
%188 = load i8, i8* %186
%189 = zext i8 %188 to i64
%190 = shl i64 %189, 8
%191 = load i64, i64* %15
%192 = or i64 %191, %190
store i64 %192, i64* %15
%193 = load i8*, i8** %21
%194 = getelementptr inbounds i8, i8* %193, i32 1
store i8* %194, i8** %21
%195 = load i8, i8* %193
%196 = zext i8 %195 to i64
%197 = shl i64 %196, 16
%198 = load i64, i64* %15
%199 = or i64 %198, %197
store i64 %199, i64* %15
%200 = load i8*, i8** %21
%201 = getelementptr inbounds i8, i8* %200, i32 1
store i8* %201, i8** %21
%202 = load i8, i8* %200
%203 = zext i8 %202 to i64
%204 = shl i64 %203, 24
%205 = load i64, i64* %15
%206 = or i64 %205, %204
store i64 %206, i64* %15
%207 = load i64, i64* %15
%208 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 0
store i64 %207, i64* %208
%209 = load i8*, i8** %21
%210 = getelementptr inbounds i8, i8* %209, i32 1
store i8* %210, i8** %21
%211 = load i8, i8* %209
%212 = zext i8 %211 to i64
store i64 %212, i64* %16
%213 = load i8*, i8** %21
%214 = getelementptr inbounds i8, i8* %213, i32 1
store i8* %214, i8** %21
%215 = load i8, i8* %213
%216 = zext i8 %215 to i64
%217 = shl i64 %216, 8
%218 = load i64, i64* %16
%219 = or i64 %218, %217
store i64 %219, i64* %16
%220 = load i8*, i8** %21
%221 = getelementptr inbounds i8, i8* %220, i32 1
store i8* %221, i8** %21
%222 = load i8, i8* %220
%223 = zext i8 %222 to i64
%224 = shl i64 %223, 16
%225 = load i64, i64* %16
%226 = or i64 %225, %224
store i64 %226, i64* %16
%227 = load i8*, i8** %21
%228 = getelementptr inbounds i8, i8* %227, i32 1
store i8* %228, i8** %21
%229 = load i8, i8* %227
%230 = zext i8 %229 to i64
%231 = shl i64 %230, 24
%232 = load i64, i64* %16
%233 = or i64 %232, %231
store i64 %233, i64* %16
%234 = load i64, i64* %16
%235 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 1
store i64 %234, i64* %235
%236 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 0
%237 = load i32*, i32** %11
%238 = call i32 @RC2_encrypt(i64* %236, i32* %237)
%239 = load i8*, i8** %12
store i8* %239, i8** %21
%240 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 0
%241 = load i64, i64* %240
store i64 %241, i64* %17
%242 = load i64, i64* %17
%243 = and i64 %242, 255
%244 = trunc i64 %243 to i8
%245 = load i8*, i8** %21
%246 = getelementptr inbounds i8, i8* %245, i32 1
store i8* %246, i8** %21
store i8 %244, i8* %245
%247 = load i64, i64* %17
%248 = lshr i64 %247, 8
%249 = and i64 %248, 255
%250 = trunc i64 %249 to i8
%251 = load i8*, i8** %21
%252 = getelementptr inbounds i8, i8* %251, i32 1
store i8* %252, i8** %21
store i8 %250, i8* %251
%253 = load i64, i64* %17
%254 = lshr i64 %253, 16
%255 = and i64 %254, 255
%256 = trunc i64 %255 to i8
%257 = load i8*, i8** %21
%258 = getelementptr inbounds i8, i8* %257, i32 1
store i8* %258, i8** %21
store i8 %256, i8* %257
%259 = load i64, i64* %17
%260 = lshr i64 %259, 24
%261 = and i64 %260, 255
%262 = trunc i64 %261 to i8
%263 = load i8*, i8** %21
%264 = getelementptr inbounds i8, i8* %263, i32 1
store i8* %264, i8** %21
store i8 %262, i8* %263
%265 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 1
%266 = load i64, i64* %265
store i64 %266, i64* %17
%267 = load i64, i64* %17
%268 = and i64 %267, 255
%269 = trunc i64 %268 to i8
%270 = load i8*, i8** %21
%271 = getelementptr inbounds i8, i8* %270, i32 1
store i8* %271, i8** %21
store i8 %269, i8* %270
%272 = load i64, i64* %17
%273 = lshr i64 %272, 8
%274 = and i64 %273, 255
%275 = trunc i64 %274 to i8
%276 = load i8*, i8** %21
%277 = getelementptr inbounds i8, i8* %276, i32 1
store i8* %277, i8** %21
store i8 %275, i8* %276
%278 = load i64, i64* %17
%279 = lshr i64 %278, 16
%280 = and i64 %279, 255
%281 = trunc i64 %280 to i8
%282 = load i8*, i8** %21
%283 = getelementptr inbounds i8, i8* %282, i32 1
store i8* %283, i8** %21
store i8 %281, i8* %282
%284 = load i64, i64* %17
%285 = lshr i64 %284, 24
%286 = and i64 %285, 255
%287 = trunc i64 %286 to i8
%288 = load i8*, i8** %21
%289 = getelementptr inbounds i8, i8* %288, i32 1
store i8* %289, i8** %21
store i8 %287, i8* %288
%290 = load i8*, i8** %12
store i8* %290, i8** %21
br label %291
291: ; preds = %181, %178
%292 = load i8*, i8** %8
%293 = getelementptr inbounds i8, i8* %292, i32 1
store i8* %293, i8** %8
%294 = load i8, i8* %292
store i8 %294, i8* %23
%295 = load i8*, i8** %21
%296 = load i32, i32* %18
%297 = sext i32 %296 to i64
%298 = getelementptr inbounds i8, i8* %295, i64 %297
%299 = load i8, i8* %298
store i8 %299, i8* %22
%300 = load i8, i8* %23
%301 = load i8*, i8** %21
%302 = load i32, i32* %18
%303 = sext i32 %302 to i64
%304 = getelementptr inbounds i8, i8* %301, i64 %303
store i8 %300, i8* %304
%305 = load i8, i8* %22
%306 = zext i8 %305 to i32
%307 = load i8, i8* %23
%308 = zext i8 %307 to i32
%309 = xor i32 %306, %308
%310 = trunc i32 %309 to i8
%311 = load i8*, i8** %9
%312 = getelementptr inbounds i8, i8* %311, i32 1
store i8* %312, i8** %9
store i8 %310, i8* %311
%313 = load i32, i32* %18
%314 = add nsw i32 %313, 1
%315 = and i32 %314, 7
store i32 %315, i32* %18
br label %174
316: ; preds = %174
br label %317
317: ; preds = %316, %172
store i8 0, i8* %23
store i8 0, i8* %22
store i64 0, i64* %17
%318 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 1
store i64 0, i64* %318
%319 = getelementptr inbounds [2 x i64], [2 x i64]* %20, i64 0, i64 0
store i64 0, i64* %319
store i64 0, i64* %16
store i64 0, i64* %15
%320 = load i32, i32* %18
%321 = load i32*, i32** %13
store i32 %320, i32* %321
ret void
}

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