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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int /*<<< orphan*/ siphash24_mac(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 size_t, int /*<<< orphan*/ const *);
void siphash24_cbc_mac(uint8_t *hash, const uint8_t *in, size_t inlen,
                       const uint8_t *nonce, const uint8_t *key) {
  uint8_t buffer[inlen + 8];
  memcpy(buffer, in, inlen);
  memcpy(buffer + inlen, nonce, 8);
  siphash24_mac(hash, buffer, inlen + 8, key);
}


x86 assembly (clang, -O0):
<siphash24_cbc_mac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,%rax
add    $0x8,%rax
mov    %rsp,%rdx
mov    %rdx,-0x30(%rbp)
lea    0x2f(,%rcx,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x40(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x40(%rbp),%rsi
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    -0x28(%rbp),%rcx
call   1040 <siphash24_mac@plt>
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<siphash24_cbc_mac>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,-0x30(%rbp)
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %rdi,%r12
lea    0x8(%rdx),%r13
mov    %rsp,%r14
lea    0x2f(,%rdx,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    %r14,%rdi
call   1030 <memcpy@plt>
lea    (%r14,%rbx,4),%rdi
mov    %r15,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    -0x30(%rbp),%rcx
call   1040 <siphash24_mac@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @siphash24_cbc_mac(i32* %0, i32* %1, i64 %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i64
store i32* %0, i32** %6
store i32* %1, i32** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%13 = load i64, i64* %8
%14 = add i64 %13, 8
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %11
%16 = alloca i32, i64 %14
store i64 %14, i64* %12
%17 = load i32*, i32** %7
%18 = load i64, i64* %8
%19 = trunc i64 %18 to i32
%20 = call i32 @memcpy(i32* %16, i32* %17, i32 %19)
%21 = load i64, i64* %8
%22 = getelementptr inbounds i32, i32* %16, i64 %21
%23 = load i32*, i32** %9
%24 = call i32 @memcpy(i32* %22, i32* %23, i32 8)
%25 = load i32*, i32** %6
%26 = load i64, i64* %8
%27 = add i64 %26, 8
%28 = load i32*, i32** %10
%29 = call i32 @siphash24_mac(i32* %25, i32* %16, i64 %27, i32* %28)
%30 = load i8*, i8** %11
ret void
}

LLVM IR (-O2):
define void @siphash24_cbc_mac(i32* %0, i32* %1, i64 %2, i32* %3, i32* %4) {
%6 = add i64 %2, 8
%7 = alloca i32, i64 %6
%8 = trunc i64 %2 to i32
%9 = call i32 @memcpy(i32* %7, i32* %1, i32 %8)
%10 = getelementptr inbounds i32, i32* %7, i64 %2
%11 = call i32 @memcpy(i32* %10, i32* %3, i32 8)
%12 = call i32 @siphash24_mac(i32* %0, i32* %7, i64 %6, i32* %4)
ret void
}