#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 md_len;
  scalar_t__ num;
  scalar_t__ Nh;
  scalar_t__ Nl;
};
typedef TYPE_1__ SHA512_CTX;

/* Variables and functions */
int SHA512_Init(SHA512_CTX *c) {
  c->h[0] = 0x6a09e667f3bcc908ULL;
  c->h[1] = 0xbb67ae8584caa73bULL;
  c->h[2] = 0x3c6ef372fe94f82bULL;
  c->h[3] = 0xa54ff53a5f1d36f1ULL;
  c->h[4] = 0x510e527fade682d1ULL;
  c->h[5] = 0x9b05688c2b3e6c1fULL;
  c->h[6] = 0x1f83d9abfb41bd6bULL;
  c->h[7] = 0x5be0cd19137e2179ULL;
  c->Nl = 0;
  c->Nh = 0;
  c->num = 0;
  c->md_len = 64;
  return 1;
}


x86 assembly (clang, -O0):
<SHA512_Init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0xf3bcc908,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x84caa73b,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0xfe94f82b,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x5f1d36f1,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0xade682d1,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x2b3e6c1f,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0xfb41bd6b,0x18(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x137e2179,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    -0x8(%rbp),%rax
movl   $0x40,0x8(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA512_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)
movl   $0x40,0x8(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32*, i32, i64, i64, i64 }
define i32 @SHA512_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 -205731576, 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 -2067093701, 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 -23791573, 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 1595750129, 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 -1377402159, 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 725511199, 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 -79577749, 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 327033209, 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 %struct.TYPE_3__*, %struct.TYPE_3__** %2
%42 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %41, i32 0, i32 1
store i32 64, i32* %42
ret i32 1
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32*, i32, i64, i64, i64 }
define i32 @SHA512_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 -205731576, i32 -2067093701, i32 -23791573, i32 1595750129>, <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 -1377402159, i32 725511199, i32 -79577749, i32 327033209>, <4 x i32>* %6
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 2
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%9 = bitcast i64* %7 to i8*
store i32 64, i32* %8
ret i32 1
}