#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 */
struct bf_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bf_decrypt(struct bf_ctx *, unsigned char *,
                              unsigned char *);
void nbl_decrypt_buffer(struct bf_ctx *pCtx, char *pstrBuffer, int iSize) {
  int i;
  iSize /= 8;
  for (i = 0; i < iSize; i++) {
    bf_decrypt(pCtx, (unsigned char *)pstrBuffer, (unsigned char *)pstrBuffer);
    pstrBuffer += 8;
  }
}


x86 assembly (clang, -O0):
<nbl_decrypt_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116f <nbl_decrypt_buffer+0x5f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <bf_decrypt@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1138 <nbl_decrypt_buffer+0x28>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nbl_decrypt_buffer>:
push   %rbp
push   %r14
push   %rbx
lea    0x7(%rdx),%ebp
test   %edx,%edx
cmovns %edx,%ebp
cmp    $0x8,%edx
jl     1147 <nbl_decrypt_buffer+0x37>
mov    %rsi,%rbx
mov    %rdi,%r14
sar    $0x3,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1030 <bf_decrypt@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
jne    1130 <nbl_decrypt_buffer+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.bf_ctx = type { i32 }
define void @nbl_decrypt_buffer(%struct.bf_ctx* %0, i8* %1, i32 %2) {
%4 = alloca %struct.bf_ctx*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.bf_ctx* %0, %struct.bf_ctx** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sdiv i32 %8, 8
store i32 %9, i32* %6
store i32 0, i32* %7
br label %10
10: ; preds = %21, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load %struct.bf_ctx*, %struct.bf_ctx** %4
%16 = load i8*, i8** %5
%17 = load i8*, i8** %5
%18 = call i32 @bf_decrypt(%struct.bf_ctx* %15, i8* %16, i8* %17)
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 8
store i8* %20, i8** %5
br label %21
21: ; preds = %14
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %10
24: ; preds = %10
ret void
}

LLVM IR (-O2):
%struct.bf_ctx = type { i32 }
define void @nbl_decrypt_buffer(%struct.bf_ctx* %0, i8* %1, i32 %2) {
%4 = sdiv i32 %2, 8
%5 = icmp sgt i32 %2, 7
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %11, %6 ], [ 0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %1, %3 ]
%9 = tail call i32 @bf_decrypt(%struct.bf_ctx* %0, i8* %8, i8* %8)
%10 = getelementptr inbounds i8, i8* %8, i64 8
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, %4
br i1 %12, label %13, label %6
13: ; preds = %6, %3
ret void
}