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

/* Variables and functions */
int /*<<< orphan*/ unscrunch(unsigned char *, int *);
int DES_CBCUpdate(unsigned char *output, int len) {
  int work[2];
  unsigned int i;
  for (i = 0; i < len / 8; i++)
    unscrunch(&output[8 * i], work);
}


x86 assembly (clang, -O0):
<DES_CBCUpdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cmp    %ecx,%eax
jae    116a <DES_CBCUpdate+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%eax
shl    $0x3,%eax
mov    %eax,%eax
add    %rax,%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <unscrunch@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1126 <DES_CBCUpdate+0x16>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DES_CBCUpdate>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0x7(%rsi),%eax
cmp    $0xf,%eax
jb     1169 <DES_CBCUpdate+0x59>
mov    %rdi,%r15
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cmp    $0x2,%eax
mov    $0x1,%r12d
cmovae %eax,%r12d
shl    $0x3,%r12
xor    %ebx,%ebx
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
and    $0xfffffff8,%edi
add    %r15,%rdi
mov    %r14,%rsi
call   1030 <unscrunch@plt>
add    $0x8,%rbx
cmp    %rbx,%r12
jne    1150 <DES_CBCUpdate+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @DES_CBCUpdate(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [2 x i32]
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 0, i32* %7
br label %8
8: ; preds = %21, %2
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 8
%12 = icmp ult i32 %9, %11
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = load i8*, i8** %4
%15 = load i32, i32* %7
%16 = mul i32 8, %15
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%20 = call i32 @unscrunch(i8* %18, i32* %19)
br label %21
21: ; preds = %13
%22 = load i32, i32* %7
%23 = add i32 %22, 1
store i32 %23, i32* %7
br label %8
24: ; preds = %8
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @DES_CBCUpdate(i8* %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = add i32 %1, 7
%6 = icmp ult i32 %5, 15
br i1 %6, label %20, label %7
7: ; preds = %2
%8 = sdiv i32 %1, 8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%10 = call i32 @llvm.umax.i32(i32 %8, i32 1)
%11 = zext i32 %10 to i64
br label %12
12: ; preds = %7, %12
%13 = phi i64 [ 0, %7 ], [ %18, %12 ]
%14 = shl i64 %13, 3
%15 = and i64 %14, 4294967288
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = call i32 @unscrunch(i8* %16, i32* %9)
%18 = add nuw nsw i64 %13, 1
%19 = icmp eq i64 %18, %11
br i1 %19, label %20, label %12
20: ; preds = %12, %2
ret i32 undef
}