#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*/ haraka512_perm(unsigned char *, unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
void haraka_S_squeezeblocks(unsigned char *h, unsigned long long nblocks,
                            unsigned char *s, unsigned int r) {
  while (nblocks > 0) {
    haraka512_perm(s, s);
    memcpy(h, s, 32);
    h += r;
    nblocks--;
  }
}


x86 assembly (clang, -O0):
<haraka_S_squeezeblocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1182 <haraka_S_squeezeblocks+0x62>
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <haraka512_perm@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <haraka_S_squeezeblocks+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<haraka_S_squeezeblocks>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1164 <haraka_S_squeezeblocks+0x44>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %ecx,%r12d
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r14,%rsi
call   1040 <haraka512_perm@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
add    %r12,%rbx
add    $0xffffffffffffffff,%r15
jne    1140 <haraka_S_squeezeblocks+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @haraka_S_squeezeblocks(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = icmp eq i64 %1, 0
br i1 %5, label %16, label %6
6: ; preds = %4
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i8* [ %0, %6 ], [ %13, %8 ]
%10 = phi i64 [ %1, %6 ], [ %14, %8 ]
%11 = tail call i32 @haraka512_perm(i8* %2, i8* %2)
%12 = tail call i32 @memcpy(i8* %9, i8* %2, i32 32)
%13 = getelementptr inbounds i8, i8* %9, i64 %7
%14 = add i64 %10, -1
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %4
ret void
}