#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__ {
  unsigned long long *h;
  int /*<<< orphan*/ md_len;
  scalar_t__ num;
  scalar_t__ Nh;
  scalar_t__ Nl;
};
typedef TYPE_1__ SHA512_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA512_DIGEST_LENGTH;
int SHA512_Init_iv(SHA512_CTX *c, unsigned long long *h) {
  int i;
  for (i = 0; i < 8; i++)
    c->h[i] = *(h + i);
  c->Nl = 0;
  c->Nh = 0;
  c->num = 0;
  c->md_len = SHA512_DIGEST_LENGTH;
  return 1;
}


x86 assembly (clang, -O0):
<SHA512_Init_iv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1146 <SHA512_Init_iv+0x46>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <SHA512_Init_iv+0x13>
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    0x2e77(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA512_Init_iv>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rax)
mov    0x8(%rsi),%rcx
mov    %rcx,0x8(%rax)
mov    0x10(%rsi),%rcx
mov    %rcx,0x10(%rax)
mov    0x18(%rsi),%rcx
mov    %rcx,0x18(%rax)
mov    0x20(%rsi),%rcx
mov    %rcx,0x20(%rax)
mov    0x28(%rsi),%rcx
mov    %rcx,0x28(%rax)
mov    0x30(%rsi),%rcx
mov    %rcx,0x30(%rax)
mov    0x38(%rsi),%rcx
mov    %rcx,0x38(%rax)
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movq   $0x0,0x20(%rdi)
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64*, i32, i64, i64, i64 }
@SHA512_DIGEST_LENGTH = global i32 0
define i32 @SHA512_Init_iv(%struct.TYPE_3__* %0, i64* %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i64*
%5 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i64* %1, i64** %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i64*, i64** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %10, i64 %12
%14 = load i64, i64* %13
%15 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %15, i32 0, i32 0
%17 = load i64*, i64** %16
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i64, i64* %17, i64 %19
store i64 %14, i64* %20
br label %21
21: ; preds = %9
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
%25 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%26 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %25, i32 0, i32 4
store i64 0, i64* %26
%27 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%28 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %27, i32 0, i32 3
store i64 0, i64* %28
%29 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%30 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %29, i32 0, i32 2
store i64 0, i64* %30
%31 = load i32, i32* @SHA512_DIGEST_LENGTH
%32 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%33 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %32, i32 0, i32 1
store i32 %31, i32* %33
ret i32 1
}

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