#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*/ smbhash(unsigned char *, unsigned char *, unsigned char *,
                           int);
void cred_hash3(unsigned char *out, unsigned char *in, unsigned char *key,
                int forw) {
  static unsigned char key2[8];
  smbhash(out, in, key, forw);
  key2[0] = key[7];
  smbhash(out + 8, in + 8, key2, forw);
}


x86 assembly (clang, -O0):
<cred_hash3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <smbhash@plt>
mov    -0x18(%rbp),%rax
mov    0x7(%rax),%al
mov    %al,0x2ee1(%rip)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x1c(%rbp),%ecx
lea    0x2ec7(%rip),%rdx
call   1030 <smbhash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cred_hash3>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1030 <smbhash@plt>
mov    0x7(%r15),%al
mov    %al,0x2ef7(%rip)
lea    0x2ef0(%rip),%rdx
add    $0x8,%rbx
add    $0x8,%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <smbhash@plt>

LLVM IR (-O0):
@cred_hash3.key2 = internal global [8 x i8] zeroinitializer
define void @cred_hash3(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @smbhash(i8* %9, i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %7
%15 = getelementptr inbounds i8, i8* %14, i64 7
%16 = load i8, i8* %15
store i8 %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @cred_hash3.key2, i64 0, i64 0)
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 8
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i64 8
%21 = load i32, i32* %8
%22 = call i32 @smbhash(i8* %18, i8* %20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @cred_hash3.key2, i64 0, i64 0), i32 %21)
ret void
}

LLVM IR (-O2):
@cred_hash3.key2 = internal global [8 x i8] zeroinitializer
define void @cred_hash3(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @smbhash(i8* %0, i8* %1, i8* %2, i32 %3)
%6 = getelementptr inbounds i8, i8* %2, i64 7
%7 = load i8, i8* %6
store i8 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @cred_hash3.key2, i64 0, i64 0)
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = getelementptr inbounds i8, i8* %1, i64 8
%10 = tail call i32 @smbhash(i8* %8, i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @cred_hash3.key2, i64 0, i64 0), i32 %3)
ret void
}