#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_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length,
                       RC2_KEY *schedule, unsigned char *ivec, int *num) {
  unsigned long v0, v1, t;
  int n = *num;
  long l = length;
  unsigned char d[8];
  char *dp;
  unsigned long ti[2];
  unsigned char *iv;
  int save = 0;
  iv = (unsigned char *)ivec;
  (v0 = ((unsigned long)(*((iv)++))), v0 |= ((unsigned long)(*((iv)++))) << 8L,
   v0 |= ((unsigned long)(*((iv)++))) << 16L,
   v0 |= ((unsigned long)(*((iv)++))) << 24L);
  (v1 = ((unsigned long)(*((iv)++))), v1 |= ((unsigned long)(*((iv)++))) << 8L,
   v1 |= ((unsigned long)(*((iv)++))) << 16L,
   v1 |= ((unsigned long)(*((iv)++))) << 24L);
  ti[0] = v0;
  ti[1] = v1;
  dp = (char *)d;
  (*((dp)++) = (unsigned char)(((v0)) & 0xff),
   *((dp)++) = (unsigned char)(((v0) >> 8L) & 0xff),
   *((dp)++) = (unsigned char)(((v0) >> 16L) & 0xff),
   *((dp)++) = (unsigned char)(((v0) >> 24L) & 0xff));
  (*((dp)++) = (unsigned char)(((v1)) & 0xff),
   *((dp)++) = (unsigned char)(((v1) >> 8L) & 0xff),
   *((dp)++) = (unsigned char)(((v1) >> 16L) & 0xff),
   *((dp)++) = (unsigned char)(((v1) >> 24L) & 0xff));
  while (l--) {
    if (n == 0) {
      RC2_encrypt((unsigned long *)ti, schedule);
      dp = (char *)d;
      t = ti[0];
      (*((dp)++) = (unsigned char)(((t)) & 0xff),
       *((dp)++) = (unsigned char)(((t) >> 8L) & 0xff),
       *((dp)++) = (unsigned char)(((t) >> 16L) & 0xff),
       *((dp)++) = (unsigned char)(((t) >> 24L) & 0xff));
      t = ti[1];
      (*((dp)++) = (unsigned char)(((t)) & 0xff),
       *((dp)++) = (unsigned char)(((t) >> 8L) & 0xff),
       *((dp)++) = (unsigned char)(((t) >> 16L) & 0xff),
       *((dp)++) = (unsigned char)(((t) >> 24L) & 0xff));
      save++;
    }
    *(out++) = *(in++) ^ d[n];
    n = (n + 1) & 0x07;
  }
  if (save) {
    v0 = ti[0];
    v1 = ti[1];
    iv = (unsigned char *)ivec;
    (*((iv)++) = (unsigned char)(((v0)) & 0xff),
     *((iv)++) = (unsigned char)(((v0) >> 8L) & 0xff),
     *((iv)++) = (unsigned char)(((v0) >> 16L) & 0xff),
     *((iv)++) = (unsigned char)(((v0) >> 24L) & 0xff));
    (*((iv)++) = (unsigned char)(((v1)) & 0xff),
     *((iv)++) = (unsigned char)(((v1) >> 8L) & 0xff),
     *((iv)++) = (unsigned char)(((v1) >> 16L) & 0xff),
     *((iv)++) = (unsigned char)(((v1) >> 24L) & 0xff));
  }
  t = v0 = v1 = ti[0] = ti[1] = 0;
  *num = n;
}


x86 assembly (clang, -O0):
<RC2_ofb64_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
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)
movl   $0x0,-0x8c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movzbl (%rax),%eax
mov    %rax,-0x38(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movzbl (%rax),%eax
shl    $0x8,%rax
or     -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movzbl (%rax),%eax
shl    $0x10,%rax
or     -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movzbl (%rax),%eax
shl    $0x18,%rax
or     -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movzbl (%rax),%eax
mov    %rax,-0x40(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movzbl (%rax),%eax
shl    $0x8,%rax
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movzbl (%rax),%eax
shl    $0x10,%rax
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x88(%rbp)
movzbl (%rax),%eax
shl    $0x18,%rax
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x38(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x58(%rbp)
cmp    $0x0,%rax
je     1519 <RC2_ofb64_encrypt+0x409>
cmpl   $0x0,-0x4c(%rbp)
jne    14d8 <RC2_ofb64_encrypt+0x3c8>
lea    -0x80(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <RC2_encrypt@plt>
lea    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x78(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x48(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x68(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x68(%rbp)
mov    %cl,(%rax)
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
movslq -0x4c(%rbp),%rcx
movzbl -0x60(%rbp,%rcx,1),%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    1381 <RC2_ofb64_encrypt+0x271>
cmpl   $0x0,-0x8c(%rbp)
je     1671 <RC2_ofb64_encrypt+0x561>
mov    -0x80(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x38(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x88(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x88(%rbp)
mov    %cl,(%rax)
movq   $0x0,-0x78(%rbp)
movq   $0x0,-0x80(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x48(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RC2_ofb64_encrypt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,%r10
mov    %rcx,0x30(%rsp)
mov    %rdx,%rbx
mov    %rsi,%r12
mov    %rdi,%r13
mov    (%r9),%r14d
movzbl (%r8),%r11d
movzbl 0x1(%r8),%r9d
movzbl 0x2(%r8),%esi
movzbl 0x3(%r8),%ecx
movzbl 0x4(%r8),%edi
movzbl 0x5(%r8),%ebp
movzbl 0x6(%r8),%edx
mov    %r8,0x28(%rsp)
movzbl 0x7(%r8),%eax
mov    %r11b,(%rsp)
mov    %r9b,0x1(%rsp)
shl    $0x8,%r9
or     %r11,%r9
mov    %sil,0x2(%rsp)
shl    $0x10,%rsi
or     %r9,%rsi
mov    %cl,0x3(%rsp)
shl    $0x18,%rcx
or     %rsi,%rcx
mov    %dil,0x4(%rsp)
mov    %bpl,0x5(%rsp)
shl    $0x8,%rbp
or     %rdi,%rbp
mov    %dl,0x6(%rsp)
shl    $0x10,%rdx
or     %rbp,%rdx
mov    %al,0x7(%rsp)
shl    $0x18,%rax
or     %rdx,%rax
mov    %rcx,0x10(%rsp)
mov    %rax,0x18(%rsp)
test   %rbx,%rbx
je     1256 <RC2_ofb64_encrypt+0x146>
mov    %r10,0x8(%rsp)
xor    %r15d,%r15d
xor    %ebp,%ebp
jmp    11f1 <RC2_ofb64_encrypt+0xe1>
nopl   0x0(%rax,%rax,1)
movslq %r14d,%rdx
movzbl (%rsp,%rdx,1),%edx
xor    0x0(%r13,%r15,1),%dl
mov    %dl,(%r12,%r15,1)
add    $0x1,%r14d
and    $0x7,%r14d
add    $0x1,%r15
cmp    %r15,%rbx
je     121b <RC2_ofb64_encrypt+0x10b>
test   %r14d,%r14d
jne    11d0 <RC2_ofb64_encrypt+0xc0>
lea    0x10(%rsp),%rdi
mov    0x30(%rsp),%rsi
call   1030 <RC2_encrypt@plt>
mov    0x10(%rsp),%rcx
mov    0x18(%rsp),%rax
mov    %ecx,(%rsp)
mov    %eax,0x4(%rsp)
add    $0x1,%ebp
jmp    11d0 <RC2_ofb64_encrypt+0xc0>
test   %ebp,%ebp
je     1251 <RC2_ofb64_encrypt+0x141>
mov    0x28(%rsp),%rsi
mov    %cl,(%rsi)
mov    %ch,0x1(%rsi)
mov    %rcx,%rdx
shr    $0x10,%rdx
mov    %dl,0x2(%rsi)
shr    $0x18,%rcx
mov    %cl,0x3(%rsi)
mov    %al,0x4(%rsi)
mov    %ah,0x5(%rsi)
mov    %rax,%rcx
shr    $0x10,%rcx
mov    %cl,0x6(%rsi)
shr    $0x18,%rax
mov    %al,0x7(%rsi)
mov    0x8(%rsp),%r10
mov    %r14d,(%r10)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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