#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*/ uint64_t;
typedef int /*<<< orphan*/ mode;

/* Variables and functions */
int /*<<< orphan*/ eal_hash64_fnv1a(int *, int);
int /*<<< orphan*/ eal_hash64_more_fnv1a(char const *, int, int /*<<< orphan*/);
__attribute__((always_)) void eal_wsa_hash(int mode, const char *local_addr,
                                           int laddr_len, char *local_port,
                                           int lport_len, char *remote_addr,
                                           int raddr_len, char *remote_port,
                                           int rport_len, uint64_t *inst_id) {
  *inst_id = eal_hash64_fnv1a(&mode, sizeof(mode));
  *inst_id = eal_hash64_more_fnv1a(local_addr, laddr_len, *inst_id);
  *inst_id = eal_hash64_more_fnv1a(local_port, lport_len, *inst_id);
  *inst_id = eal_hash64_more_fnv1a(remote_addr, raddr_len, *inst_id);
  *inst_id = eal_hash64_more_fnv1a(remote_port, rport_len, *inst_id);
}


x86 assembly (clang, -O0):
<eal_wsa_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1040 <eal_hash64_fnv1a@plt>
mov    %eax,%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x28(%rbp),%rax
mov    (%rax),%edx
call   1030 <eal_hash64_more_fnv1a@plt>
mov    %eax,%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x28(%rbp),%rax
mov    (%rax),%edx
call   1030 <eal_hash64_more_fnv1a@plt>
mov    %eax,%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rdi
mov    0x10(%rbp),%esi
mov    0x28(%rbp),%rax
mov    (%rax),%edx
call   1030 <eal_hash64_more_fnv1a@plt>
mov    %eax,%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    0x18(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    0x28(%rbp),%rax
mov    (%rax),%edx
call   1030 <eal_hash64_more_fnv1a@plt>
mov    %eax,%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eal_wsa_hash>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r12
mov    %r8d,%r13d
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    0x58(%rsp),%r15
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1040 <eal_hash64_fnv1a@plt>
mov    %eax,(%r15)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <eal_hash64_more_fnv1a@plt>
mov    %eax,(%r15)
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %eax,%edx
call   1030 <eal_hash64_more_fnv1a@plt>
mov    %eax,(%r15)
mov    %r12,%rdi
mov    0x40(%rsp),%esi
mov    %eax,%edx
call   1030 <eal_hash64_more_fnv1a@plt>
mov    %eax,(%r15)
mov    0x48(%rsp),%rdi
mov    0x50(%rsp),%esi
mov    %eax,%edx
call   1030 <eal_hash64_more_fnv1a@plt>
mov    %eax,(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @eal_wsa_hash(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5, i32 %6, i8* %7, i32 %8, i32* %9) {
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32*
store i32 %0, i32* %11
store i8* %1, i8** %12
store i32 %2, i32* %13
store i8* %3, i8** %14
store i32 %4, i32* %15
store i8* %5, i8** %16
store i32 %6, i32* %17
store i8* %7, i8** %18
store i32 %8, i32* %19
store i32* %9, i32** %20
%21 = call i32 @eal_hash64_fnv1a(i32* %11, i32 4)
%22 = load i32*, i32** %20
store i32 %21, i32* %22
%23 = load i8*, i8** %12
%24 = load i32, i32* %13
%25 = load i32*, i32** %20
%26 = load i32, i32* %25
%27 = call i32 @eal_hash64_more_fnv1a(i8* %23, i32 %24, i32 %26)
%28 = load i32*, i32** %20
store i32 %27, i32* %28
%29 = load i8*, i8** %14
%30 = load i32, i32* %15
%31 = load i32*, i32** %20
%32 = load i32, i32* %31
%33 = call i32 @eal_hash64_more_fnv1a(i8* %29, i32 %30, i32 %32)
%34 = load i32*, i32** %20
store i32 %33, i32* %34
%35 = load i8*, i8** %16
%36 = load i32, i32* %17
%37 = load i32*, i32** %20
%38 = load i32, i32* %37
%39 = call i32 @eal_hash64_more_fnv1a(i8* %35, i32 %36, i32 %38)
%40 = load i32*, i32** %20
store i32 %39, i32* %40
%41 = load i8*, i8** %18
%42 = load i32, i32* %19
%43 = load i32*, i32** %20
%44 = load i32, i32* %43
%45 = call i32 @eal_hash64_more_fnv1a(i8* %41, i32 %42, i32 %44)
%46 = load i32*, i32** %20
store i32 %45, i32* %46
ret void
}

LLVM IR (-O2):
define void @eal_wsa_hash(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5, i32 %6, i8* %7, i32 %8, i32* nocapture writeonly %9) {
%11 = alloca i32
store i32 %0, i32* %11
%12 = call i32 @eal_hash64_fnv1a(i32* %11, i32 4)
store i32 %12, i32* %9
%13 = call i32 @eal_hash64_more_fnv1a(i8* %1, i32 %2, i32 %12)
store i32 %13, i32* %9
%14 = call i32 @eal_hash64_more_fnv1a(i8* %3, i32 %4, i32 %13)
store i32 %14, i32* %9
%15 = call i32 @eal_hash64_more_fnv1a(i8* %5, i32 %6, i32 %14)
store i32 %15, i32* %9
%16 = call i32 @eal_hash64_more_fnv1a(i8* %7, i32 %8, i32 %15)
store i32 %16, i32* %9
ret void
}