#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_20() {
  unsigned char input[15] = {26, 197, 127, 120, 233, 230, 190, 233,
                             35, 104, 31,  114, 122, 109, 103};
  unsigned char result0[32] = {0xED, 0xBD, 0x5A, 0x34, 0x8F, 0xDE, 0xAF, 0xCF,
                               0x5C, 0x0E, 0xE9, 0xA6, 0x75, 0x13, 0x85, 0x48,
                               0x1B, 0x34, 0x3C, 0x92, 0x75, 0x45, 0x6F, 0x51,
                               0x73, 0x3C, 0x32, 0x28, 0x90, 0xDD, 0x13, 0x89};
  unsigned char result1[32];
  memset(result1, 0, 32);
  SHA256_VST(input, result1, 15);
  check_test(result0, result1, 32,
             "Disagreement between given answer and SHA256_VST in "
             "SHA256_Xcompare_20\n");
  memset(result1, 0, 32);
  SHA256_NSS(input, result1, 15);
  check_test(result0, result1, 32,
             "Disagreement between given answer and SHA256_NSS in "
             "SHA256_Xcompare_20\n");
  memset(result1, 0, 32);
  SHA256_sodium(input, result1, 15);
  check_test(result0, result1, 32,
             "Disagreement between given answer and SHA256_sodium in "
             "SHA256_Xcompare_20\n");
}


x86 assembly (clang, -O0):
<SHA256_Xcompare_20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xea1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xe9f(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xe99(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xe91(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xe89(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe86(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe83(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe80(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0xf(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0xf,%edx
call   1030 <SHA256_VST@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x20,%edx
lea    0xe4e(%rip),%rcx
call   1070 <check_test@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0xf(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0xf,%edx
call   1050 <SHA256_NSS@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x20,%edx
lea    0xe5b(%rip),%rcx
call   1070 <check_test@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0xf(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0xf,%edx
call   1060 <SHA256_sodium@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x20,%edx
lea    0xe68(%rip),%rcx
call   1070 <check_test@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA256_Xcompare_20>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
movabs $0x676d7a721f6823e9,%rax
7a 6d 67
mov    %rax,0x7(%rsp)
movabs $0xe9bee6e9787fc51a,%rax
e6 be e9
mov    %rax,(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe87(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xf,%edx
call   1030 <SHA256_VST@plt>
lea    0xe74(%rip),%rcx
lea    0x10(%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    $0xf,%edx
call   1050 <SHA256_NSS@plt>
lea    0xe81(%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    $0xf,%edx
call   1060 <SHA256_sodium@plt>
lea    0xe93(%rip),%rcx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1070 <check_test@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.SHA256_Xcompare_20.input = [15 x i8] c"\1A\C5\7Fx\E9\E6\BE\E9#h\1Frzmg"
@__const.SHA256_Xcompare_20.result0 = [32 x i8] c"\ED\BDZ4\8F\DE\AF\CF\\\0E\E9\A6u\13\85H\1B4<\92uEoQs<2(\90\DD\13\89"
@.str = [72 x i8] c"Disagreement between given answer and SHA256_VST in SHA256_Xcompare_20\0A\00"
@.str.1 = [72 x i8] c"Disagreement between given answer and SHA256_NSS in SHA256_Xcompare_20\0A\00"
@.str.2 = [75 x i8] c"Disagreement between given answer and SHA256_sodium in SHA256_Xcompare_20\0A\00"
define void @SHA256_Xcompare_20() {
%1 = alloca [15 x i8]
%2 = alloca [32 x i8]
%3 = alloca [32 x i8]
%4 = bitcast [15 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 [15 x i8], [15 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 15)
%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 ([72 x i8], [72 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 [15 x i8], [15 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 15)
%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 ([72 x i8], [72 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 [15 x i8], [15 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 15)
%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 ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.SHA256_Xcompare_20.input = [15 x i8] c"\1A\C5\7Fx\E9\E6\BE\E9#h\1Frzmg"
@__const.SHA256_Xcompare_20.result0 = [32 x i8] c"\ED\BDZ4\8F\DE\AF\CF\\\0E\E9\A6u\13\85H\1B4<\92uEoQs<2(\90\DD\13\89"
@.str = [72 x i8] c"Disagreement between given answer and SHA256_VST in SHA256_Xcompare_20\0A\00"
@.str.1 = [72 x i8] c"Disagreement between given answer and SHA256_NSS in SHA256_Xcompare_20\0A\00"
@.str.2 = [75 x i8] c"Disagreement between given answer and SHA256_sodium in SHA256_Xcompare_20\0A\00"
define void @SHA256_Xcompare_20() {
%1 = alloca [15 x i8]
%2 = alloca [32 x i8]
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [15 x i8], [15 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 15)
%9 = call i32 @check_test(i8* %5, i8* %6, i32 32, i8* getelementptr inbounds ([72 x i8], [72 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 15)
%12 = call i32 @check_test(i8* %5, i8* %6, i32 32, i8* getelementptr inbounds ([72 x i8], [72 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 15)
%15 = call i32 @check_test(i8* %5, i8* %6, i32 32, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0))
ret void
}