#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 /*<<< orphan*/ md_len;
  scalar_t__ num;
  scalar_t__ Nh;
  scalar_t__ Nl;
  void **h;
};
typedef TYPE_1__ SHA512_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA512_DIGEST_LENGTH;
void *U64(int);
int SHA512_Init(SHA512_CTX *c) {
  c->h[0] = U64(0x6a09e667f3bcc908);
  c->h[1] = U64(0xbb67ae8584caa73b);
  c->h[2] = U64(0x3c6ef372fe94f82b);
  c->h[3] = U64(0xa54ff53a5f1d36f1);
  c->h[4] = U64(0x510e527fade682d1);
  c->h[5] = U64(0x9b05688c2b3e6c1f);
  c->h[6] = U64(0x1f83d9abfb41bd6b);
  c->h[7] = U64(0x5be0cd19137e2179);
  c->Nl = 0;
  c->Nh = 0;
  c->num = 0;
  c->md_len = SHA512_DIGEST_LENGTH;
  return 1;
}


x86 assembly (clang, -O0):
<SHA512_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf3bcc908,%edi
call   1030 <U64@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rcx,(%rax)
mov    $0x84caa73b,%edi
call   1030 <U64@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rcx,0x8(%rax)
mov    $0xfe94f82b,%edi
call   1030 <U64@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rcx,0x10(%rax)
mov    $0x5f1d36f1,%edi
call   1030 <U64@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rcx,0x18(%rax)
mov    $0xade682d1,%edi
call   1030 <U64@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rcx,0x20(%rax)
mov    $0x2b3e6c1f,%edi
call   1030 <U64@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rcx,0x28(%rax)
mov    $0xfb41bd6b,%edi
call   1030 <U64@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rcx,0x30(%rax)
mov    $0x137e2179,%edi
call   1030 <U64@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rcx,0x38(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x10(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    0x2dda(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA512_Init>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf3bcc908,%edi
call   1030 <U64@plt>
mov    0x20(%rbx),%rcx
mov    %rax,(%rcx)
mov    $0x84caa73b,%edi
call   1030 <U64@plt>
mov    0x20(%rbx),%rcx
mov    %rax,0x8(%rcx)
mov    $0xfe94f82b,%edi
call   1030 <U64@plt>
mov    0x20(%rbx),%rcx
mov    %rax,0x10(%rcx)
mov    $0x5f1d36f1,%edi
call   1030 <U64@plt>
mov    0x20(%rbx),%rcx
mov    %rax,0x18(%rcx)
mov    $0xade682d1,%edi
call   1030 <U64@plt>
mov    0x20(%rbx),%rcx
mov    %rax,0x20(%rcx)
mov    $0x2b3e6c1f,%edi
call   1030 <U64@plt>
mov    0x20(%rbx),%rcx
mov    %rax,0x28(%rcx)
mov    $0xfb41bd6b,%edi
call   1030 <U64@plt>
mov    0x20(%rbx),%rcx
mov    %rax,0x30(%rcx)
mov    $0x137e2179,%edi
call   1030 <U64@plt>
mov    0x20(%rbx),%rcx
mov    %rax,0x38(%rcx)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rbx)
movq   $0x0,0x18(%rbx)
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i64, i64, i64, i8** }
@SHA512_DIGEST_LENGTH = global i32 0
define i32 @SHA512_Init(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = call i8* @U64(i32 -205731576)
%4 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 4
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
store i8* %3, i8** %7
%8 = call i8* @U64(i32 -2067093701)
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 4
%11 = load i8**, i8*** %10
%12 = getelementptr inbounds i8*, i8** %11, i64 1
store i8* %8, i8** %12
%13 = call i8* @U64(i32 -23791573)
%14 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i32 0, i32 4
%16 = load i8**, i8*** %15
%17 = getelementptr inbounds i8*, i8** %16, i64 2
store i8* %13, i8** %17
%18 = call i8* @U64(i32 1595750129)
%19 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%20 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %19, i32 0, i32 4
%21 = load i8**, i8*** %20
%22 = getelementptr inbounds i8*, i8** %21, i64 3
store i8* %18, i8** %22
%23 = call i8* @U64(i32 -1377402159)
%24 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%25 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %24, i32 0, i32 4
%26 = load i8**, i8*** %25
%27 = getelementptr inbounds i8*, i8** %26, i64 4
store i8* %23, i8** %27
%28 = call i8* @U64(i32 725511199)
%29 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%30 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %29, i32 0, i32 4
%31 = load i8**, i8*** %30
%32 = getelementptr inbounds i8*, i8** %31, i64 5
store i8* %28, i8** %32
%33 = call i8* @U64(i32 -79577749)
%34 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%35 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %34, i32 0, i32 4
%36 = load i8**, i8*** %35
%37 = getelementptr inbounds i8*, i8** %36, i64 6
store i8* %33, i8** %37
%38 = call i8* @U64(i32 327033209)
%39 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%40 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %39, i32 0, i32 4
%41 = load i8**, i8*** %40
%42 = getelementptr inbounds i8*, i8** %41, i64 7
store i8* %38, i8** %42
%43 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%44 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %43, i32 0, i32 3
store i64 0, i64* %44
%45 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%46 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %45, i32 0, i32 2
store i64 0, i64* %46
%47 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%48 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %47, i32 0, i32 1
store i64 0, i64* %48
%49 = load i32, i32* @SHA512_DIGEST_LENGTH
%50 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%51 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %50, i32 0, i32 0
store i32 %49, i32* %51
ret i32 1
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i64, i64, i64, i8** }
@SHA512_DIGEST_LENGTH = global i32 0
define i32 @SHA512_Init(%struct.TYPE_3__* nocapture %0) {
%2 = tail call i8* @U64(i32 -205731576)
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 4
%4 = load i8**, i8*** %3
store i8* %2, i8** %4
%5 = tail call i8* @U64(i32 -2067093701)
%6 = load i8**, i8*** %3
%7 = getelementptr inbounds i8*, i8** %6, i64 1
store i8* %5, i8** %7
%8 = tail call i8* @U64(i32 -23791573)
%9 = load i8**, i8*** %3
%10 = getelementptr inbounds i8*, i8** %9, i64 2
store i8* %8, i8** %10
%11 = tail call i8* @U64(i32 1595750129)
%12 = load i8**, i8*** %3
%13 = getelementptr inbounds i8*, i8** %12, i64 3
store i8* %11, i8** %13
%14 = tail call i8* @U64(i32 -1377402159)
%15 = load i8**, i8*** %3
%16 = getelementptr inbounds i8*, i8** %15, i64 4
store i8* %14, i8** %16
%17 = tail call i8* @U64(i32 725511199)
%18 = load i8**, i8*** %3
%19 = getelementptr inbounds i8*, i8** %18, i64 5
store i8* %17, i8** %19
%20 = tail call i8* @U64(i32 -79577749)
%21 = load i8**, i8*** %3
%22 = getelementptr inbounds i8*, i8** %21, i64 6
store i8* %20, i8** %22
%23 = tail call i8* @U64(i32 327033209)
%24 = load i8**, i8*** %3
%25 = getelementptr inbounds i8*, i8** %24, i64 7
store i8* %23, i8** %25
%26 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%27 = bitcast i64* %26 to i8*
%28 = load i32, i32* @SHA512_DIGEST_LENGTH
%29 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i32 %28, i32* %29
ret i32 1
}