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

/* Variables and functions */
int /*<<< orphan*/ Camellia_cfbr_encrypt_block(unsigned char const *,
                                               unsigned char *, int,
                                               int /*<<< orphan*/ const *,
                                               unsigned char *, int const);
int /*<<< orphan*/ assert(int);
void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out,
                           const unsigned long length, const CAMELLIA_KEY *key,
                           unsigned char *ivec, int *num, const int enc) {
  unsigned int n;
  assert(in && out && key && ivec && num);
  assert(*num == 0);
  for (n = 0; n < length; ++n)
    Camellia_cfbr_encrypt_block(&in[n], &out[n], 8, key, ivec, enc);
}


x86 assembly (clang, -O0):
<Camellia_cfb8_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x35(%rbp)
je     118e <Camellia_cfb8_encrypt+0x6e>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x35(%rbp)
je     118e <Camellia_cfb8_encrypt+0x6e>
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x35(%rbp)
je     118e <Camellia_cfb8_encrypt+0x6e>
xor    %eax,%eax
cmpq   $0x0,-0x28(%rbp)
mov    %al,-0x35(%rbp)
je     118e <Camellia_cfb8_encrypt+0x6e>
cmpq   $0x0,-0x30(%rbp)
setne  %al
mov    %al,-0x35(%rbp)
mov    -0x35(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x30(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    11fb <Camellia_cfb8_encrypt+0xdb>
mov    -0x8(%rbp),%rdi
mov    -0x34(%rbp),%eax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x34(%rbp),%eax
add    %rax,%rsi
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    0x10(%rbp),%r9d
mov    $0x8,%edx
call   1040 <Camellia_cfbr_encrypt_block@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b6 <Camellia_cfb8_encrypt+0x96>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Camellia_cfb8_encrypt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%rbp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
test   %r15,%r15
setne  %al
test   %r8,%r8
setne  %dl
and    %al,%dl
and    %cl,%dl
test   %r9,%r9
setne  %al
and    %dl,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,0x0(%rbp)
sete   %dil
call   1030 <assert@plt>
test   %r12,%r12
je     11b7 <Camellia_cfb8_encrypt+0x97>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%rbp,1),%rdi
mov    %r13,%rsi
add    %rbp,%rsi
mov    $0x8,%edx
mov    %r15,%rcx
mov    %r14,%r8
mov    0x40(%rsp),%r9d
call   1040 <Camellia_cfbr_encrypt_block@plt>
add    $0x1,%ebp
cmp    %r12,%rbp
jb     1190 <Camellia_cfb8_encrypt+0x70>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @Camellia_cfb8_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 i32
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
%16 = load i8*, i8** %8
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %30
18: ; preds = %7
%19 = load i8*, i8** %9
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %30
21: ; preds = %18
%22 = load i32*, i32** %11
%23 = icmp ne i32* %22, null
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i8*, i8** %12
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32*, i32** %13
%29 = icmp ne i32* %28, null
br label %30
30: ; preds = %27, %24, %21, %18, %7
%31 = phi i1 [ false, %24 ], [ false, %21 ], [ false, %18 ], [ false, %7 ], [ %29, %27 ]
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = load i32*, i32** %13
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 0
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
store i32 0, i32* %15
br label %39
39: ; preds = %57, %30
%40 = load i32, i32* %15
%41 = zext i32 %40 to i64
%42 = load i64, i64* %10
%43 = icmp ult i64 %41, %42
br i1 %43, label %44, label %60
44: ; preds = %39
%45 = load i8*, i8** %8
%46 = load i32, i32* %15
%47 = zext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %45, i64 %47
%49 = load i8*, i8** %9
%50 = load i32, i32* %15
%51 = zext i32 %50 to i64
%52 = getelementptr inbounds i8, i8* %49, i64 %51
%53 = load i32*, i32** %11
%54 = load i8*, i8** %12
%55 = load i32, i32* %14
%56 = call i32 @Camellia_cfbr_encrypt_block(i8* %48, i8* %52, i32 8, i32* %53, i8* %54, i32 %55)
br label %57
57: ; preds = %44
%58 = load i32, i32* %15
%59 = add i32 %58, 1
store i32 %59, i32* %15
br label %39
60: ; preds = %39
ret void
}

LLVM IR (-O2):
define void @Camellia_cfb8_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5, i32 %6) {
%8 = icmp ne i8* %0, null
%9 = icmp ne i8* %1, null
%10 = and i1 %8, %9
%11 = icmp ne i32* %3, null
%12 = and i1 %10, %11
%13 = icmp ne i8* %4, null
%14 = and i1 %12, %13
%15 = icmp ne i32* %5, null
%16 = and i1 %14, %15
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = load i32, i32* %5
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
%22 = tail call i32 @assert(i32 %21)
%23 = icmp eq i64 %2, 0
br i1 %23, label %32, label %24
24: ; preds = %7, %24
%25 = phi i64 [ %30, %24 ], [ 0, %7 ]
%26 = getelementptr inbounds i8, i8* %0, i64 %25
%27 = getelementptr inbounds i8, i8* %1, i64 %25
%28 = tail call i32 @Camellia_cfbr_encrypt_block(i8* %26, i8* %27, i32 8, i32* %3, i8* %4, i32 %6)
%29 = add nuw nsw i64 %25, 1
%30 = and i64 %29, 4294967295
%31 = icmp ult i64 %30, %2
br i1 %31, label %24, label %32
32: ; preds = %24, %7
ret void
}