void BF_cfb64_encrypt(in, out, length, ivec, num, encrypt) unsigned char *in;
unsigned char *out;
long length;
unsigned char *ivec;
int *num;
int encrypt;
{
  register unsigned long v0, v1, t;
  register int n;
  register long l;
  unsigned long ti[2];
  unsigned char *iv, c, cc;
  n = *num;
  l = length;
  iv = (unsigned char *)ivec;
  if (encrypt) {
    while (l--) {
      if (n == 0) {
        (v0 = ((unsigned long)(*((iv)++))) << 24L,
         v0 |= ((unsigned long)(*((iv)++))) << 16L,
         v0 |= ((unsigned long)(*((iv)++))) << 8L,
         v0 |= ((unsigned long)(*((iv)++))));
        ti[0] = v0;
        (v1 = ((unsigned long)(*((iv)++))) << 24L,
         v1 |= ((unsigned long)(*((iv)++))) << 16L,
         v1 |= ((unsigned long)(*((iv)++))) << 8L,
         v1 |= ((unsigned long)(*((iv)++))));
        ti[1] = v1;
        BF_encrypt((unsigned long *)ti, 1);
        iv = (unsigned char *)ivec;
        t = ti[0];
        (*((iv)++) = (unsigned char)(((t) >> 24L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff),
         *((iv)++) = (unsigned char)(((t)) & 0xff));
        t = ti[1];
        (*((iv)++) = (unsigned char)(((t) >> 24L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff),
         *((iv)++) = (unsigned char)(((t)) & 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)++))) << 24L,
         v0 |= ((unsigned long)(*((iv)++))) << 16L,
         v0 |= ((unsigned long)(*((iv)++))) << 8L,
         v0 |= ((unsigned long)(*((iv)++))));
        ti[0] = v0;
        (v1 = ((unsigned long)(*((iv)++))) << 24L,
         v1 |= ((unsigned long)(*((iv)++))) << 16L,
         v1 |= ((unsigned long)(*((iv)++))) << 8L,
         v1 |= ((unsigned long)(*((iv)++))));
        ti[1] = v1;
        BF_encrypt((unsigned long *)ti, 1);
        iv = (unsigned char *)ivec;
        t = ti[0];
        (*((iv)++) = (unsigned char)(((t) >> 24L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff),
         *((iv)++) = (unsigned char)(((t)) & 0xff));
        t = ti[1];
        (*((iv)++) = (unsigned char)(((t) >> 24L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff),
         *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff),
         *((iv)++) = (unsigned char)(((t)) & 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):
<BF_cfb64_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     13f9 <BF_cfb64_encrypt+0x2e9>
jmp    115b <BF_cfb64_encrypt+0x4b>
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x58(%rbp)
cmp    $0x0,%rax
je     13f4 <BF_cfb64_encrypt+0x2e4>
cmpl   $0x0,-0x4c(%rbp)
jne    139e <BF_cfb64_encrypt+0x28e>
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x18,%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    $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
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
shl    $0x18,%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    $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
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <BF_encrypt@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x48(%rbp)
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    -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    $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
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
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    -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    $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
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x20(%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    115b <BF_cfb64_encrypt+0x4b>
jmp    16a4 <BF_cfb64_encrypt+0x594>
jmp    13fe <BF_cfb64_encrypt+0x2ee>
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x58(%rbp)
cmp    $0x0,%rax
je     169f <BF_cfb64_encrypt+0x58f>
cmpl   $0x0,-0x4c(%rbp)
jne    1641 <BF_cfb64_encrypt+0x531>
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movzbl (%rax),%eax
shl    $0x18,%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    $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
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
shl    $0x18,%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    $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
or     -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <BF_encrypt@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x48(%rbp)
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    -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    $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
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
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    -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    $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
and    $0xff,%rax
mov    %al,%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
mov    -0x20(%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 <BF_cfb64_encrypt+0x2ee>
jmp    16a4 <BF_cfb64_encrypt+0x594>
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    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BF_cfb64_encrypt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
mov    %r8,0x10(%rsp)
mov    (%r8),%r14d
test   %r9d,%r9d
je     11ba <BF_cfb64_encrypt+0xaa>
test   %r15,%r15
je     1239 <BF_cfb64_encrypt+0x129>
xor    %ebp,%ebp
jmp    1178 <BF_cfb64_encrypt+0x68>
nopl   0x0(%rax,%rax,1)
movslq %r14d,%rax
movzbl (%rbx,%rax,1),%ecx
xor    0x0(%r13,%rbp,1),%cl
mov    %cl,(%r12,%rbp,1)
mov    %cl,(%rbx,%rax,1)
add    $0x1,%r14d
and    $0x7,%r14d
add    $0x1,%rbp
cmp    %rbp,%r15
je     1239 <BF_cfb64_encrypt+0x129>
test   %r14d,%r14d
jne    1150 <BF_cfb64_encrypt+0x40>
mov    (%rbx),%eax
shl    $0x20,%rax
bswap  %rax
mov    %rax,(%rsp)
mov    0x4(%rbx),%eax
shl    $0x20,%rax
bswap  %rax
mov    %rax,0x8(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <BF_encrypt@plt>
mov    (%rsp),%eax
bswap  %eax
mov    %eax,(%rbx)
mov    0x8(%rsp),%eax
bswap  %eax
mov    %eax,0x4(%rbx)
jmp    1150 <BF_cfb64_encrypt+0x40>
test   %r15,%r15
je     1239 <BF_cfb64_encrypt+0x129>
xor    %ebp,%ebp
jmp    11f7 <BF_cfb64_encrypt+0xe7>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x0(%r13,%rbp,1),%eax
movslq %r14d,%rcx
movzbl (%rbx,%rcx,1),%edx
xor    %al,%dl
mov    %al,(%rbx,%rcx,1)
mov    %dl,(%r12,%rbp,1)
add    $0x1,%r14d
and    $0x7,%r14d
add    $0x1,%rbp
cmp    %rbp,%r15
je     1239 <BF_cfb64_encrypt+0x129>
test   %r14d,%r14d
jne    11d0 <BF_cfb64_encrypt+0xc0>
mov    (%rbx),%eax
shl    $0x20,%rax
bswap  %rax
mov    %rax,(%rsp)
mov    0x4(%rbx),%eax
shl    $0x20,%rax
bswap  %rax
mov    %rax,0x8(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <BF_encrypt@plt>
mov    (%rsp),%eax
bswap  %eax
mov    %eax,(%rbx)
mov    0x8(%rsp),%eax
bswap  %eax
mov    %eax,0x4(%rbx)
jmp    11d0 <BF_cfb64_encrypt+0xc0>
mov    0x10(%rsp),%rax
mov    %r14d,(%rax)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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