#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_NSS(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ SHA256_VST(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ SHA256_sodium(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ check_test(unsigned char *, unsigned char *, int, char *);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void SHA256_Xcompare_8() {
  unsigned char input[90] = {
      67,  197, 99,  139, 253, 238, 213, 212, 47,  114, 117, 130, 59,
      87,  211, 244, 177, 229, 142, 89,  20,  138, 239, 131, 29,  42,
      142, 102, 31,  142, 119, 225, 47,  233, 195, 83,  72,  107, 4,
      248, 161, 210, 9,   176, 53,  134, 142, 124, 194, 109, 160, 209,
      200, 10,  44,  149, 29,  2,   230, 28,  53,  213, 239, 147, 110,
      118, 222, 130, 60,  155, 109, 255, 128, 138, 239, 49,  128, 83,
      231, 110, 164, 247, 130, 96,  41,  15,  178, 176, 219, 156};
  unsigned char result0[32] = {0xE5, 0x0F, 0x30, 0x51, 0xA2, 0xA5, 0xF7, 0xEE,
                               0xD0, 0x3D, 0xEB, 0xD1, 0x1B, 0x32, 0xDB, 0x51,
                               0x93, 0x63, 0xA8, 0x7A, 0xDC, 0xE4, 0x84, 0x5F,
                               0x60, 0x58, 0x60, 0xD9, 0x22, 0x42, 0x28, 0x69};
  unsigned char result1[32];
  memset(result1, 0, 32);
  SHA256_VST(input, result1, 90);
  check_test(result0, result1, 32,
             "Disagreement between given answer and SHA256_VST in "
             "SHA256_Xcompare_8\n");
  memset(result1, 0, 32);
  SHA256_NSS(input, result1, 90);
  check_test(result0, result1, 32,
             "Disagreement between given answer and SHA256_NSS in "
             "SHA256_Xcompare_8\n");
  memset(result1, 0, 32);
  SHA256_sodium(input, result1, 90);
  check_test(result0, result1, 32,
             "Disagreement between given answer and SHA256_sodium in "
             "SHA256_Xcompare_8\n");
}


x86 assembly (clang, -O0):
<SHA256_Xcompare_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0x60(%rbp),%rdi
lea    0xe8a(%rip),%rsi
mov    $0x5a,%edx
call   1060 <memcpy@plt>
mov    0xed9(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    $0x5a,%edx
call   1030 <SHA256_VST@plt>
lea    -0x80(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    $0x20,%edx
lea    0xe95(%rip),%rcx
call   1080 <check_test@plt>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    $0x5a,%edx
call   1050 <SHA256_NSS@plt>
lea    -0x80(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    $0x20,%edx
lea    0xe98(%rip),%rcx
call   1080 <check_test@plt>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    $0x5a,%edx
call   1070 <SHA256_sodium@plt>
lea    -0x80(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    $0x20,%edx
lea    0xe9b(%rip),%rcx
call   1080 <check_test@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA256_Xcompare_8>:
push   %r15
push   %r14
push   %rbx
sub    $0xa0,%rsp
movups 0xee7(%rip),%xmm0
movups %xmm0,0x6a(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe7d(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe61(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x80(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x5a,%edx
call   1030 <SHA256_VST@plt>
lea    0xe92(%rip),%rcx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1070 <check_test@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x5a,%edx
call   1050 <SHA256_NSS@plt>
lea    0xea0(%rip),%rcx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1070 <check_test@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x5a,%edx
call   1060 <SHA256_sodium@plt>
lea    0xeb1(%rip),%rcx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1070 <check_test@plt>
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.SHA256_Xcompare_8.input = [90 x i8] c"C\C5c\8B\FD\EE\D5\D4/ru\82;W\D3\F4\B1\E5\8EY\14\8A\EF\83\1D*\8Ef\1F\8Ew\E1/\E9\C3SHk\04\F8\A1\D2\09\B05\86\8E|\C2m\A0\D1\C8\0A,\95\1D\02\E6\1C5\D5\EF\93nv\DE\82<\9Bm\FF\80\8A\EF1\80S\E7n\A4\F7\82`)\0F\B2\B0\DB\9C"
@__const.SHA256_Xcompare_8.result0 = [32 x i8] c"\E5\0F0Q\A2\A5\F7\EE\D0=\EB\D1\1B2\DBQ\93c\A8z\DC\E4\84_`X`\D9\22B(i"
@.str = [71 x i8] c"Disagreement between given answer and SHA256_VST in SHA256_Xcompare_8\0A\00"
@.str.1 = [71 x i8] c"Disagreement between given answer and SHA256_NSS in SHA256_Xcompare_8\0A\00"
@.str.2 = [74 x i8] c"Disagreement between given answer and SHA256_sodium in SHA256_Xcompare_8\0A\00"
define void @SHA256_Xcompare_8() {
%1 = alloca [90 x i8]
%2 = alloca [32 x i8]
%3 = alloca [32 x i8]
%4 = bitcast [90 x i8]* %1 to i8*
%5 = bitcast [32 x i8]* %2 to i8*
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i32 0, i32 32)
%8 = getelementptr inbounds [90 x i8], [90 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%10 = call i32 @SHA256_VST(i8* %8, i8* %9, i32 90)
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%13 = call i32 @check_test(i8* %11, i8* %12, i32 32, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%15 = call i32 @memset(i8* %14, i32 0, i32 32)
%16 = getelementptr inbounds [90 x i8], [90 x i8]* %1, i64 0, i64 0
%17 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%18 = call i32 @SHA256_NSS(i8* %16, i8* %17, i32 90)
%19 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%20 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%21 = call i32 @check_test(i8* %19, i8* %20, i32 32, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%23 = call i32 @memset(i8* %22, i32 0, i32 32)
%24 = getelementptr inbounds [90 x i8], [90 x i8]* %1, i64 0, i64 0
%25 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%26 = call i32 @SHA256_sodium(i8* %24, i8* %25, i32 90)
%27 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%28 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%29 = call i32 @check_test(i8* %27, i8* %28, i32 32, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.SHA256_Xcompare_8.input = [90 x i8] c"C\C5c\8B\FD\EE\D5\D4/ru\82;W\D3\F4\B1\E5\8EY\14\8A\EF\83\1D*\8Ef\1F\8Ew\E1/\E9\C3SHk\04\F8\A1\D2\09\B05\86\8E|\C2m\A0\D1\C8\0A,\95\1D\02\E6\1C5\D5\EF\93nv\DE\82<\9Bm\FF\80\8A\EF1\80S\E7n\A4\F7\82`)\0F\B2\B0\DB\9C"
@__const.SHA256_Xcompare_8.result0 = [32 x i8] c"\E5\0F0Q\A2\A5\F7\EE\D0=\EB\D1\1B2\DBQ\93c\A8z\DC\E4\84_`X`\D9\22B(i"
@.str = [71 x i8] c"Disagreement between given answer and SHA256_VST in SHA256_Xcompare_8\0A\00"
@.str.1 = [71 x i8] c"Disagreement between given answer and SHA256_NSS in SHA256_Xcompare_8\0A\00"
@.str.2 = [74 x i8] c"Disagreement between given answer and SHA256_sodium in SHA256_Xcompare_8\0A\00"
define void @SHA256_Xcompare_8() {
%1 = alloca [90 x i8]
%2 = alloca [32 x i8]
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [90 x i8], [90 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 @memset(i8* %6, i32 0, i32 32)
%8 = call i32 @SHA256_VST(i8* %4, i8* %6, i32 90)
%9 = call i32 @check_test(i8* %5, i8* %6, i32 32, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @memset(i8* %6, i32 0, i32 32)
%11 = call i32 @SHA256_NSS(i8* %4, i8* %6, i32 90)
%12 = call i32 @check_test(i8* %5, i8* %6, i32 32, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @memset(i8* %6, i32 0, i32 32)
%14 = call i32 @SHA256_sodium(i8* %4, i8* %6, i32 90)
%15 = call i32 @check_test(i8* %5, i8* %6, i32 32, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0))
ret void
}