#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*/ SHA256_sodium(unsigned char *, unsigned char *,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ check_KAT(unsigned char *, unsigned char *, int, char *);
SHA256_sodium_KAT_4() {
  unsigned char input[0] = {};
  unsigned char result[32];
  unsigned char expected_result[32] = {
      0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4,
      0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b,
      0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55};
  SHA256_sodium(input, result, 0);
  check_KAT(result, expected_result, 32, "SHA256_sodium_KAT_4");
}


x86 assembly (clang, -O0):
<SHA256_sodium_KAT_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x5(%rbp),%rdi
lea    -0x30(%rbp),%rsi
xor    %edx,%edx
call   1030 <SHA256_sodium@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x20,%edx
lea    0xea9(%rip),%rcx
call   1040 <check_KAT@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA256_sodium_KAT_4>:
push   %rbx
sub    $0x50,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xf(%rsp),%rdi
lea    0x30(%rsp),%rbx
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <SHA256_sodium@plt>
lea    0xec8(%rip),%rcx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x20,%edx
call   1040 <check_KAT@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.SHA256_sodium_KAT_4.expected_result = [32 x i8] c"\E3\B0\C4B\98\FC\1C\14\9A\FB\F4\C8\99o\B9$'\AEA\E4d\9B\93L\A4\95\99\1BxR\B8U"
@.str = [20 x i8] c"SHA256_sodium_KAT_4\00"
define i32 @SHA256_sodium_KAT_4() {
%1 = alloca i32
%2 = alloca [0 x i8]
%3 = alloca [32 x i8]
%4 = alloca [32 x i8]
%5 = bitcast [0 x i8]* %2 to i8*
%6 = bitcast [32 x i8]* %4 to i8*
%7 = getelementptr inbounds [0 x i8], [0 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%9 = call i32 @SHA256_sodium(i8* %7, i8* %8, i32 0)
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%12 = call i32 @check_KAT(i8* %10, i8* %11, i32 32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@__const.SHA256_sodium_KAT_4.expected_result = [32 x i8] c"\E3\B0\C4B\98\FC\1C\14\9A\FB\F4\C8\99o\B9$'\AEA\E4d\9B\93L\A4\95\99\1BxR\B8U"
@.str = [20 x i8] c"SHA256_sodium_KAT_4\00"
define i32 @SHA256_sodium_KAT_4() {
%1 = alloca [0 x i8]
%2 = alloca [32 x i8]
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [0 x i8], [0 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%7 = call i32 @SHA256_sodium(i8* %4, i8* %5, i32 0)
%8 = call i32 @check_KAT(i8* %5, i8* %6, i32 32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}