#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*/ crypto_auth(void *, void const *, size_t,
                               unsigned char const *);
int hx4_check_params(int, void const *, size_t, void const *, size_t, void *,
                     size_t);
int hx4_siphash24_64_ref(const void *in, size_t in_sz, const void *cookie,
                         size_t cookie_sz, void *out, size_t out_sz) {
  int rc;
  rc = hx4_check_params(64 / 8, in, in_sz, cookie, cookie_sz, out, out_sz);
  if (rc != (0)) {
    return rc;
  }
  crypto_auth(out, in, in_sz, (const unsigned char *)cookie);
  return (0);
}


x86 assembly (clang, -O0):
<hx4_siphash24_64_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    -0x38(%rbp),%rax
mov    $0x8,%edi
mov    %rax,(%rsp)
call   1040 <hx4_check_params@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     117e <hx4_siphash24_64_ref+0x5e>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119a <hx4_siphash24_64_ref+0x7a>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <crypto_auth@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hx4_siphash24_64_ref>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8,%r15
mov    %rcx,%r8
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%rbx
mov    %r9,(%rsp)
mov    $0x8,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r9
call   1040 <hx4_check_params@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    116c <hx4_siphash24_64_ref+0x4c>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1030 <crypto_auth@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hx4_siphash24_64_ref(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
store i8* %0, i8** %8
store i64 %1, i64* %9
store i8* %2, i8** %10
store i64 %3, i64* %11
store i8* %4, i8** %12
store i64 %5, i64* %13
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = load i8*, i8** %10
%18 = load i64, i64* %11
%19 = load i8*, i8** %12
%20 = load i64, i64* %13
%21 = call i32 @hx4_check_params(i32 8, i8* %15, i64 %16, i8* %17, i64 %18, i8* %19, i64 %20)
store i32 %21, i32* %14
%22 = load i32, i32* %14
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %6
%25 = load i32, i32* %14
store i32 %25, i32* %7
br label %32
26: ; preds = %6
%27 = load i8*, i8** %12
%28 = load i8*, i8** %8
%29 = load i64, i64* %9
%30 = load i8*, i8** %10
%31 = call i32 @crypto_auth(i8* %27, i8* %28, i64 %29, i8* %30)
store i32 0, i32* %7
br label %32
32: ; preds = %26, %24
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
define i32 @hx4_siphash24_64_ref(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5) {
%7 = tail call i32 @hx4_check_params(i32 8, i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @crypto_auth(i8* %4, i8* %0, i64 %1, i8* %2)
br label %11
11: ; preds = %6, %9
ret i32 %7
}