#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);
int /*<<< orphan*/ check_KAT(unsigned char *, unsigned char *, int, char *);
SHA256_sodium_KAT_3() {
  unsigned char input[112] =
      "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnop"
      "jklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
  unsigned char result[32];
  unsigned char expected_result[32] = {
      0xcf, 0x5b, 0x16, 0xa7, 0x78, 0xaf, 0x83, 0x80, 0x03, 0x6c, 0xe5,
      0x9e, 0x7b, 0x04, 0x92, 0x37, 0x0b, 0x24, 0x9b, 0x11, 0xe8, 0xf0,
      0x7a, 0x51, 0xaf, 0xac, 0x45, 0x03, 0x7a, 0xfe, 0xe9, 0xd1};
  SHA256_sodium(input, result, 112);
  check_KAT(result, expected_result, 32, "SHA256_sodium_KAT_3");
}


x86 assembly (clang, -O0):
<SHA256_sodium_KAT_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
lea    -0x80(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x70,%edx
call   1030 <memcpy@plt>
mov    0xf19(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xf13(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    0xf0d(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xf07(%rip),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x80(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    $0x70,%edx
call   1040 <SHA256_sodium@plt>
lea    -0xa0(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
mov    $0x20,%edx
lea    0xed9(%rip),%rcx
call   1050 <check_KAT@plt>
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA256_sodium_KAT_3>:
push   %rbx
sub    $0xb0,%rsp
movaps 0xf31(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xf12(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xef6(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
lea    0x90(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x70,%edx
call   1030 <SHA256_sodium@plt>
lea    0xed9(%rip),%rcx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x20,%edx
call   1040 <check_KAT@plt>
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.SHA256_sodium_KAT_3.input = [112 x i8] c"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
@__const.SHA256_sodium_KAT_3.expected_result = [32 x i8] c"\CF[\16\A7x\AF\83\80\03l\E5\9E{\04\927\0B$\9B\11\E8\F0zQ\AF\ACE\03z\FE\E9\D1"
@.str = [20 x i8] c"SHA256_sodium_KAT_3\00"
define i32 @SHA256_sodium_KAT_3() {
%1 = alloca i32
%2 = alloca [112 x i8]
%3 = alloca [32 x i8]
%4 = alloca [32 x i8]
%5 = bitcast [112 x i8]* %2 to i8*
%6 = bitcast [32 x i8]* %4 to i8*
%7 = getelementptr inbounds [112 x i8], [112 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 112)
%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_3.input = [112 x i8] c"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
@__const.SHA256_sodium_KAT_3.expected_result = [32 x i8] c"\CF[\16\A7x\AF\83\80\03l\E5\9E{\04\927\0B$\9B\11\E8\F0zQ\AF\ACE\03z\FE\E9\D1"
@.str = [20 x i8] c"SHA256_sodium_KAT_3\00"
define i32 @SHA256_sodium_KAT_3() {
%1 = alloca [112 x i8]
%2 = alloca [32 x i8]
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [112 x i8], [112 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 112)
%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
}