#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*/ TigerKDF_HashPassword(void *, size_t, void *, size_t, void *,
                                         size_t, unsigned int, int,
                                         int /*<<< orphan*/,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/, int, int,
                                         unsigned int);
int PHS(void *out, size_t outlen, const void *in, size_t inlen,
        const void *salt, size_t saltlen, unsigned int t_cost,
        unsigned int m_cost) {
  return !TigerKDF_HashPassword(out, outlen, (void *)in, inlen, (void *)salt,
                                saltlen, m_cost, 4096, 0, NULL, 0, 16384, 2,
                                t_cost);
}


x86 assembly (clang, -O0):
<PHS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x18(%rbp),%r10d
mov    0x10(%rbp),%eax
xor    %r11d,%r11d
xor    %r11d,%r11d
mov    %r10d,(%rsp)
movl   $0x1000,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movq   $0x0,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x4000,0x28(%rsp)
movl   $0x2,0x30(%rsp)
mov    %eax,0x38(%rsp)
call   1030 <TigerKDF_HashPassword@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PHS>:
push   %rax
mov    0x18(%rsp),%r10d
mov    0x10(%rsp),%eax
push   %rax
push   $0x2
push   $0x4000
push   $0x0
push   $0x0
push   $0x0
push   $0x1000
push   %r10
call   1030 <TigerKDF_HashPassword@plt>
add    $0x40,%rsp
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PHS(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5, i32 %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i32
%16 = alloca i32
store i8* %0, i8** %9
store i64 %1, i64* %10
store i8* %2, i8** %11
store i64 %3, i64* %12
store i8* %4, i8** %13
store i64 %5, i64* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i8*, i8** %9
%18 = load i64, i64* %10
%19 = load i8*, i8** %11
%20 = load i64, i64* %12
%21 = load i8*, i8** %13
%22 = load i64, i64* %14
%23 = load i32, i32* %16
%24 = load i32, i32* %15
%25 = call i32 @TigerKDF_HashPassword(i8* %17, i64 %18, i8* %19, i64 %20, i8* %21, i64 %22, i32 %23, i32 4096, i32 0, i32* null, i32 0, i32 16384, i32 2, i32 %24)
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @PHS(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5, i32 %6, i32 %7) {
%9 = tail call i32 @TigerKDF_HashPassword(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5, i32 %7, i32 4096, i32 0, i32* null, i32 0, i32 16384, i32 2, i32 %6)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}