#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_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int *h;
  int /*<<< orphan*/ md_len;
  scalar_t__ num;
  scalar_t__ Nh;
  scalar_t__ Nl;
};
typedef TYPE_1__ SHA256_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA256_DIGEST_LENGTH;
int SHA256_Init(SHA256_CTX *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->Nl = 0;
  c->Nh = 0;
  c->num = 0;
  c->md_len = SHA256_DIGEST_LENGTH;
  return 1;
}


x86 assembly (clang, -O0):
<SHA256_Init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
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    -0x8(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x10(%rax)
mov    0x2e3e(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA256_Init>:
mov    (%rdi),%rax
movaps 0xef6(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xefc(%rip),%xmm0
movups %xmm0,0x10(%rax)
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movq   $0x0,0x20(%rdi)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rdi)
mov    $0x1,%eax
ret

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

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