#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 */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int *h;
  int /*<<< orphan*/ md_len;
};
typedef TYPE_1__ SHA256_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA256_DIGEST_LENGTH;
int /*<<< orphan*/ memset(TYPE_1__ *, int /*<<< orphan*/, int);
int SHA256_Init(SHA256_CTX *c) {
  memset(c, 0, sizeof(*c));
  c->h[0] = 0x6a09e667UL;
  c->h[1] = 0xbb67ae85UL;
  c->h[2] = 0x3c6ef372UL;
  c->h[3] = 0xa54ff53aUL;
  c->h[4] = 0x510e527fUL;
  c->h[5] = 0x9b05688cUL;
  c->h[6] = 0x1f83d9abUL;
  c->h[7] = 0x5be0cd19UL;
  c->md_len = SHA256_DIGEST_LENGTH;
  return 1;
}


x86 assembly (clang, -O0):
<SHA256_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x6a09e667,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0xbb67ae85,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x3c6ef372,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0xa54ff53a,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x510e527f,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x9b05688c,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x1f83d9ab,0x18(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x5be0cd19,0x1c(%rax)
mov    0x2e3e(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA256_Init>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    (%rbx),%rax
movaps 0xed6(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xedc(%rip),%xmm0
movups %xmm0,0x10(%rax)
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32*, i32 }
@SHA256_DIGEST_LENGTH = global i32 0
define i32 @SHA256_Init(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%4 = call i32 @memset(%struct.TYPE_4__* %3, i32 0, i32 16)
%5 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 1779033703, i32* %8
%9 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %9, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 -1150833019, i32* %12
%13 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%14 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %13, i32 0, i32 0
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 1013904242, i32* %16
%17 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%18 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %17, i32 0, i32 0
%19 = load i32*, i32** %18
%20 = getelementptr inbounds i32, i32* %19, i64 3
store i32 -1521486534, i32* %20
%21 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%22 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %21, i32 0, i32 0
%23 = load i32*, i32** %22
%24 = getelementptr inbounds i32, i32* %23, i64 4
store i32 1359893119, i32* %24
%25 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%26 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %25, i32 0, i32 0
%27 = load i32*, i32** %26
%28 = getelementptr inbounds i32, i32* %27, i64 5
store i32 -1694144372, i32* %28
%29 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%30 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %29, i32 0, i32 0
%31 = load i32*, i32** %30
%32 = getelementptr inbounds i32, i32* %31, i64 6
store i32 528734635, i32* %32
%33 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%34 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %33, i32 0, i32 0
%35 = load i32*, i32** %34
%36 = getelementptr inbounds i32, i32* %35, i64 7
store i32 1541459225, i32* %36
%37 = load i32, i32* @SHA256_DIGEST_LENGTH
%38 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%39 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %38, i32 0, i32 1
store i32 %37, i32* %39
ret i32 1
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32*, i32 }
@SHA256_DIGEST_LENGTH = global i32 0
define i32 @SHA256_Init(%struct.TYPE_4__* %0) {
%2 = tail call i32 @memset(%struct.TYPE_4__* %0, i32 0, i32 16)
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 1779033703, i32 -1150833019, i32 1013904242, i32 -1521486534>, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %4, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 1359893119, i32 -1694144372, i32 528734635, i32 1541459225>, <4 x i32>* %7
%8 = load i32, i32* @SHA256_DIGEST_LENGTH
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 1
store i32 %8, i32* %9
ret i32 1
}