#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*/ fs_hmac_generic(unsigned char const *, int, unsigned char *,
                                   int, unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ wbe16(unsigned char *, short);
int /*<<< orphan*/ wbe32(unsigned char *, int);
void fs_hmac_data(const unsigned char *data, int uid, const unsigned char *name,
                  int entry_n, int x3, short blk, unsigned char *hmac) {
  unsigned char extra[0x40];
  memset(extra, 0, 0x40);
  wbe32(extra, uid);
  memcpy(extra + 4, name, 12);
  wbe16(extra + 0x12, blk);
  wbe32(extra + 0x14, entry_n);
  wbe32(extra + 0x18, x3);
  fs_hmac_generic(data, 0x4000, extra, 0x40, hmac);
}


x86 assembly (clang, -O0):
<fs_hmac_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %r9w,%ax
mov    0x10(%rbp),%r9
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %ax,-0x22(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
lea    -0x70(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <wbe32@plt>
lea    -0x70(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
mov    $0xc,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
add    $0x12,%rdi
movswl -0x22(%rbp),%esi
call   1060 <wbe16@plt>
lea    -0x70(%rbp),%rdi
add    $0x14,%rdi
mov    -0x1c(%rbp),%esi
call   1070 <wbe32@plt>
lea    -0x70(%rbp),%rdi
add    $0x18,%rdi
mov    -0x20(%rbp),%esi
call   1070 <wbe32@plt>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rdx
mov    0x10(%rbp),%r8
mov    $0x4000,%esi
mov    $0x40,%ecx
call   1050 <fs_hmac_generic@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_hmac_data>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9d,%ebp
mov    %r8d,%r13d
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,0x8(%rsp)
lea    0x10(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    %r12,%rdi
mov    %r15d,%esi
call   1070 <wbe32@plt>
lea    0x14(%rsp),%rdi
mov    %r14,%rsi
mov    $0xc,%edx
call   1040 <memcpy@plt>
lea    0x22(%rsp),%rdi
mov    %ebp,%esi
call   1060 <wbe16@plt>
lea    0x24(%rsp),%rdi
mov    %ebx,%esi
call   1070 <wbe32@plt>
lea    0x28(%rsp),%rdi
mov    %r13d,%esi
call   1070 <wbe32@plt>
mov    0x8(%rsp),%rdi
mov    $0x4000,%esi
mov    %r12,%rdx
mov    $0x40,%ecx
mov    0x90(%rsp),%r8
call   1050 <fs_hmac_generic@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @fs_hmac_data(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i16 signext %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i16
%14 = alloca i8*
%15 = alloca [64 x i8]
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i16 %5, i16* %13
store i8* %6, i8** %14
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%17 = call i32 @memset(i8* %16, i32 0, i32 64)
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%19 = load i32, i32* %9
%20 = call i32 @wbe32(i8* %18, i32 %19)
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%22 = getelementptr inbounds i8, i8* %21, i64 4
%23 = load i8*, i8** %10
%24 = call i32 @memcpy(i8* %22, i8* %23, i32 12)
%25 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%26 = getelementptr inbounds i8, i8* %25, i64 18
%27 = load i16, i16* %13
%28 = call i32 @wbe16(i8* %26, i16 signext %27)
%29 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%30 = getelementptr inbounds i8, i8* %29, i64 20
%31 = load i32, i32* %11
%32 = call i32 @wbe32(i8* %30, i32 %31)
%33 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%34 = getelementptr inbounds i8, i8* %33, i64 24
%35 = load i32, i32* %12
%36 = call i32 @wbe32(i8* %34, i32 %35)
%37 = load i8*, i8** %8
%38 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%39 = load i8*, i8** %14
%40 = call i32 @fs_hmac_generic(i8* %37, i32 16384, i8* %38, i32 64, i8* %39)
ret void
}

LLVM IR (-O2):
define void @fs_hmac_data(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i16 signext %5, i8* %6) {
%8 = alloca [64 x i8]
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i32 0, i32 64)
%11 = call i32 @wbe32(i8* %9, i32 %1)
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 4
%13 = call i32 @memcpy(i8* %12, i8* %2, i32 12)
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 18
%15 = call i32 @wbe16(i8* %14, i16 signext %5)
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 20
%17 = call i32 @wbe32(i8* %16, i32 %3)
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 24
%19 = call i32 @wbe32(i8* %18, i32 %4)
%20 = call i32 @fs_hmac_generic(i8* %0, i32 16384, i8* %9, i32 64, i8* %6)
ret void
}