#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 */

/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int b64_to_int(char const);
scalar_t__ split_24bit(char const *, scalar_t__ *, int, int, int, int, int);
int strlen(char const *);
int restore_sha512_array(const char *string, uint8_t *hash) {
  uint32_t tmp = 0;
  int value1, value2;
  if (strlen(string) != 86)
    return -1;
  if (split_24bit(string, hash, 0, 4, 0, 21, 42) < 0)
    return -1;
  if (split_24bit(string, hash, 4, 4, 22, 43, 1) < 0)
    return -1;
  if (split_24bit(string, hash, 8, 4, 44, 2, 23) < 0)
    return -1;
  if (split_24bit(string, hash, 12, 4, 3, 24, 45) < 0)
    return -1;
  if (split_24bit(string, hash, 16, 4, 25, 46, 4) < 0)
    return -1;
  if (split_24bit(string, hash, 20, 4, 47, 5, 26) < 0)
    return -1;
  if (split_24bit(string, hash, 24, 4, 6, 27, 48) < 0)
    return -1;
  if (split_24bit(string, hash, 28, 4, 28, 49, 7) < 0)
    return -1;
  if (split_24bit(string, hash, 32, 4, 50, 8, 29) < 0)
    return -1;
  if (split_24bit(string, hash, 36, 4, 9, 30, 51) < 0)
    return -1;
  if (split_24bit(string, hash, 40, 4, 31, 52, 10) < 0)
    return -1;
  if (split_24bit(string, hash, 44, 4, 53, 11, 32) < 0)
    return -1;
  if (split_24bit(string, hash, 48, 4, 12, 33, 54) < 0)
    return -1;
  if (split_24bit(string, hash, 52, 4, 34, 55, 13) < 0)
    return -1;
  if (split_24bit(string, hash, 56, 4, 56, 14, 35) < 0)
    return -1;
  if (split_24bit(string, hash, 60, 4, 15, 36, 57) < 0)
    return -1;
  if (split_24bit(string, hash, 64, 4, 37, 58, 16) < 0)
    return -1;
  if (split_24bit(string, hash, 68, 4, 59, 17, 38) < 0)
    return -1;
  if (split_24bit(string, hash, 72, 4, 18, 39, 60) < 0)
    return -1;
  if (split_24bit(string, hash, 76, 4, 40, 61, 19) < 0)
    return -1;
  if (split_24bit(string, hash, 80, 4, 62, 20, 41) < 0)
    return -1;
  value1 = b64_to_int(string[85]);
  if (value1 < 0)
    return -1;
  value2 = b64_to_int(string[84]);
  if (value2 < 0)
    return -1;
  tmp = (value1 << 6) | value2;
  hash[63] = (uint8_t)tmp;
  return 0;
}


x86 assembly (clang, -O0):
<restore_sha512_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x56,%eax
je     1165 <restore_sha512_array+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %r8d,%r8d
mov    $0x4,%ecx
mov    $0x15,%r9d
mov    %r8d,%edx
movl   $0x2a,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    11a0 <restore_sha512_array+0x70>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%ecx
mov    $0x16,%r8d
mov    $0x2b,%r9d
mov    %ecx,%edx
movl   $0x1,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    11dd <restore_sha512_array+0xad>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x8,%edx
mov    $0x4,%ecx
mov    $0x2c,%r8d
mov    $0x2,%r9d
movl   $0x17,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    121d <restore_sha512_array+0xed>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xc,%edx
mov    $0x4,%ecx
mov    $0x3,%r8d
mov    $0x18,%r9d
movl   $0x2d,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    125d <restore_sha512_array+0x12d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
mov    $0x4,%ecx
mov    $0x19,%r8d
mov    $0x2e,%r9d
movl   $0x4,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    129d <restore_sha512_array+0x16d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x14,%edx
mov    $0x4,%ecx
mov    $0x2f,%r8d
mov    $0x5,%r9d
movl   $0x1a,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    12dd <restore_sha512_array+0x1ad>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x18,%edx
mov    $0x4,%ecx
mov    $0x6,%r8d
mov    $0x1b,%r9d
movl   $0x30,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    131d <restore_sha512_array+0x1ed>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1c,%r8d
mov    $0x4,%ecx
mov    $0x31,%r9d
mov    %r8d,%edx
movl   $0x7,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    135b <restore_sha512_array+0x22b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x20,%edx
mov    $0x4,%ecx
mov    $0x32,%r8d
mov    $0x8,%r9d
movl   $0x1d,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    139b <restore_sha512_array+0x26b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x24,%edx
mov    $0x4,%ecx
mov    $0x9,%r8d
mov    $0x1e,%r9d
movl   $0x33,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    13db <restore_sha512_array+0x2ab>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x28,%edx
mov    $0x4,%ecx
mov    $0x1f,%r8d
mov    $0x34,%r9d
movl   $0xa,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    141b <restore_sha512_array+0x2eb>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x2c,%edx
mov    $0x4,%ecx
mov    $0x35,%r8d
mov    $0xb,%r9d
movl   $0x20,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    145b <restore_sha512_array+0x32b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x30,%edx
mov    $0x4,%ecx
mov    $0xc,%r8d
mov    $0x21,%r9d
movl   $0x36,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    149b <restore_sha512_array+0x36b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x34,%edx
mov    $0x4,%ecx
mov    $0x22,%r8d
mov    $0x37,%r9d
movl   $0xd,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    14db <restore_sha512_array+0x3ab>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x38,%r8d
mov    $0x4,%ecx
mov    $0xe,%r9d
mov    %r8d,%edx
movl   $0x23,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    1519 <restore_sha512_array+0x3e9>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x3c,%edx
mov    $0x4,%ecx
mov    $0xf,%r8d
mov    $0x24,%r9d
movl   $0x39,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    1559 <restore_sha512_array+0x429>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x40,%edx
mov    $0x4,%ecx
mov    $0x25,%r8d
mov    $0x3a,%r9d
movl   $0x10,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    1599 <restore_sha512_array+0x469>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x44,%edx
mov    $0x4,%ecx
mov    $0x3b,%r8d
mov    $0x11,%r9d
movl   $0x26,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    15d9 <restore_sha512_array+0x4a9>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x48,%edx
mov    $0x4,%ecx
mov    $0x12,%r8d
mov    $0x27,%r9d
movl   $0x3c,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    1619 <restore_sha512_array+0x4e9>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4c,%edx
mov    $0x4,%ecx
mov    $0x28,%r8d
mov    $0x3d,%r9d
movl   $0x13,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    1659 <restore_sha512_array+0x529>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x50,%edx
mov    $0x4,%ecx
mov    $0x3e,%r8d
mov    $0x14,%r9d
movl   $0x29,(%rsp)
call   1040 <split_24bit@plt>
cmp    $0x0,%rax
jge    1699 <restore_sha512_array+0x569>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rax
movsbl 0x55(%rax),%edi
call   1050 <b64_to_int@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    16bf <restore_sha512_array+0x58f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x10(%rbp),%rax
movsbl 0x54(%rax),%edi
call   1050 <b64_to_int@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    16e5 <restore_sha512_array+0x5b5>
movl   $0xffffffff,-0x4(%rbp)
jmp    1707 <restore_sha512_array+0x5d7>
mov    -0x20(%rbp),%eax
shl    $0x6,%eax
or     -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x1f8(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_sha512_array>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <strlen@plt>
mov    $0xffffffff,%r14d
cmp    $0x56,%eax
jne    1578 <restore_sha512_array+0x448>
movl   $0x2a,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
mov    $0x15,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x1,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
mov    $0x4,%ecx
mov    $0x16,%r8d
mov    $0x2b,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x17,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
mov    $0x4,%ecx
mov    $0x2c,%r8d
mov    $0x2,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x2d,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0xc,%edx
mov    $0x4,%ecx
mov    $0x3,%r8d
mov    $0x18,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x4,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
mov    $0x4,%ecx
mov    $0x19,%r8d
mov    $0x2e,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x1a,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x14,%edx
mov    $0x4,%ecx
mov    $0x2f,%r8d
mov    $0x5,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x30,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x18,%edx
mov    $0x4,%ecx
mov    $0x6,%r8d
mov    $0x1b,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x7,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x1c,%edx
mov    $0x4,%ecx
mov    $0x1c,%r8d
mov    $0x31,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x1d,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
mov    $0x4,%ecx
mov    $0x32,%r8d
mov    $0x8,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x33,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x24,%edx
mov    $0x4,%ecx
mov    $0x9,%r8d
mov    $0x1e,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0xa,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x28,%edx
mov    $0x4,%ecx
mov    $0x1f,%r8d
mov    $0x34,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x20,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x2c,%edx
mov    $0x4,%ecx
mov    $0x35,%r8d
mov    $0xb,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x36,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x30,%edx
mov    $0x4,%ecx
mov    $0xc,%r8d
mov    $0x21,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0xd,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x34,%edx
mov    $0x4,%ecx
mov    $0x22,%r8d
mov    $0x37,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x23,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x38,%edx
mov    $0x4,%ecx
mov    $0x38,%r8d
mov    $0xe,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x39,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x3c,%edx
mov    $0x4,%ecx
mov    $0xf,%r8d
mov    $0x24,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x10,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
mov    $0x4,%ecx
mov    $0x25,%r8d
mov    $0x3a,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x26,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x44,%edx
mov    $0x4,%ecx
mov    $0x3b,%r8d
mov    $0x11,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x3c,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x48,%edx
mov    $0x4,%ecx
mov    $0x12,%r8d
mov    $0x27,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x13,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x4c,%edx
mov    $0x4,%ecx
mov    $0x28,%r8d
mov    $0x3d,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movl   $0x29,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x50,%edx
mov    $0x4,%ecx
mov    $0x3e,%r8d
mov    $0x14,%r9d
call   1040 <split_24bit@plt>
test   %rax,%rax
js     1578 <restore_sha512_array+0x448>
movsbl 0x55(%rbp),%edi
call   1050 <b64_to_int@plt>
test   %eax,%eax
js     1578 <restore_sha512_array+0x448>
mov    %eax,%r15d
movsbl 0x54(%rbp),%edi
call   1050 <b64_to_int@plt>
test   %eax,%eax
js     1578 <restore_sha512_array+0x448>
shl    $0x6,%r15d
or     %r15d,%eax
cltq
mov    %rax,0x1f8(%rbx)
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @restore_sha512_array(i8* %0, i64* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i64* %1, i64** %5
store i32 0, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = icmp ne i32 %10, 86
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %164
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = load i64*, i64** %5
%16 = call i64 @split_24bit(i8* %14, i64* %15, i32 0, i32 4, i32 0, i32 21, i32 42)
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 -1, i32* %3
br label %164
19: ; preds = %13
%20 = load i8*, i8** %4
%21 = load i64*, i64** %5
%22 = call i64 @split_24bit(i8* %20, i64* %21, i32 4, i32 4, i32 22, i32 43, i32 1)
%23 = icmp slt i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 -1, i32* %3
br label %164
25: ; preds = %19
%26 = load i8*, i8** %4
%27 = load i64*, i64** %5
%28 = call i64 @split_24bit(i8* %26, i64* %27, i32 8, i32 4, i32 44, i32 2, i32 23)
%29 = icmp slt i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %25
store i32 -1, i32* %3
br label %164
31: ; preds = %25
%32 = load i8*, i8** %4
%33 = load i64*, i64** %5
%34 = call i64 @split_24bit(i8* %32, i64* %33, i32 12, i32 4, i32 3, i32 24, i32 45)
%35 = icmp slt i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %31
store i32 -1, i32* %3
br label %164
37: ; preds = %31
%38 = load i8*, i8** %4
%39 = load i64*, i64** %5
%40 = call i64 @split_24bit(i8* %38, i64* %39, i32 16, i32 4, i32 25, i32 46, i32 4)
%41 = icmp slt i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %37
store i32 -1, i32* %3
br label %164
43: ; preds = %37
%44 = load i8*, i8** %4
%45 = load i64*, i64** %5
%46 = call i64 @split_24bit(i8* %44, i64* %45, i32 20, i32 4, i32 47, i32 5, i32 26)
%47 = icmp slt i64 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %43
store i32 -1, i32* %3
br label %164
49: ; preds = %43
%50 = load i8*, i8** %4
%51 = load i64*, i64** %5
%52 = call i64 @split_24bit(i8* %50, i64* %51, i32 24, i32 4, i32 6, i32 27, i32 48)
%53 = icmp slt i64 %52, 0
br i1 %53, label %54, label %55
54: ; preds = %49
store i32 -1, i32* %3
br label %164
55: ; preds = %49
%56 = load i8*, i8** %4
%57 = load i64*, i64** %5
%58 = call i64 @split_24bit(i8* %56, i64* %57, i32 28, i32 4, i32 28, i32 49, i32 7)
%59 = icmp slt i64 %58, 0
br i1 %59, label %60, label %61
60: ; preds = %55
store i32 -1, i32* %3
br label %164
61: ; preds = %55
%62 = load i8*, i8** %4
%63 = load i64*, i64** %5
%64 = call i64 @split_24bit(i8* %62, i64* %63, i32 32, i32 4, i32 50, i32 8, i32 29)
%65 = icmp slt i64 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %61
store i32 -1, i32* %3
br label %164
67: ; preds = %61
%68 = load i8*, i8** %4
%69 = load i64*, i64** %5
%70 = call i64 @split_24bit(i8* %68, i64* %69, i32 36, i32 4, i32 9, i32 30, i32 51)
%71 = icmp slt i64 %70, 0
br i1 %71, label %72, label %73
72: ; preds = %67
store i32 -1, i32* %3
br label %164
73: ; preds = %67
%74 = load i8*, i8** %4
%75 = load i64*, i64** %5
%76 = call i64 @split_24bit(i8* %74, i64* %75, i32 40, i32 4, i32 31, i32 52, i32 10)
%77 = icmp slt i64 %76, 0
br i1 %77, label %78, label %79
78: ; preds = %73
store i32 -1, i32* %3
br label %164
79: ; preds = %73
%80 = load i8*, i8** %4
%81 = load i64*, i64** %5
%82 = call i64 @split_24bit(i8* %80, i64* %81, i32 44, i32 4, i32 53, i32 11, i32 32)
%83 = icmp slt i64 %82, 0
br i1 %83, label %84, label %85
84: ; preds = %79
store i32 -1, i32* %3
br label %164
85: ; preds = %79
%86 = load i8*, i8** %4
%87 = load i64*, i64** %5
%88 = call i64 @split_24bit(i8* %86, i64* %87, i32 48, i32 4, i32 12, i32 33, i32 54)
%89 = icmp slt i64 %88, 0
br i1 %89, label %90, label %91
90: ; preds = %85
store i32 -1, i32* %3
br label %164
91: ; preds = %85
%92 = load i8*, i8** %4
%93 = load i64*, i64** %5
%94 = call i64 @split_24bit(i8* %92, i64* %93, i32 52, i32 4, i32 34, i32 55, i32 13)
%95 = icmp slt i64 %94, 0
br i1 %95, label %96, label %97
96: ; preds = %91
store i32 -1, i32* %3
br label %164
97: ; preds = %91
%98 = load i8*, i8** %4
%99 = load i64*, i64** %5
%100 = call i64 @split_24bit(i8* %98, i64* %99, i32 56, i32 4, i32 56, i32 14, i32 35)
%101 = icmp slt i64 %100, 0
br i1 %101, label %102, label %103
102: ; preds = %97
store i32 -1, i32* %3
br label %164
103: ; preds = %97
%104 = load i8*, i8** %4
%105 = load i64*, i64** %5
%106 = call i64 @split_24bit(i8* %104, i64* %105, i32 60, i32 4, i32 15, i32 36, i32 57)
%107 = icmp slt i64 %106, 0
br i1 %107, label %108, label %109
108: ; preds = %103
store i32 -1, i32* %3
br label %164
109: ; preds = %103
%110 = load i8*, i8** %4
%111 = load i64*, i64** %5
%112 = call i64 @split_24bit(i8* %110, i64* %111, i32 64, i32 4, i32 37, i32 58, i32 16)
%113 = icmp slt i64 %112, 0
br i1 %113, label %114, label %115
114: ; preds = %109
store i32 -1, i32* %3
br label %164
115: ; preds = %109
%116 = load i8*, i8** %4
%117 = load i64*, i64** %5
%118 = call i64 @split_24bit(i8* %116, i64* %117, i32 68, i32 4, i32 59, i32 17, i32 38)
%119 = icmp slt i64 %118, 0
br i1 %119, label %120, label %121
120: ; preds = %115
store i32 -1, i32* %3
br label %164
121: ; preds = %115
%122 = load i8*, i8** %4
%123 = load i64*, i64** %5
%124 = call i64 @split_24bit(i8* %122, i64* %123, i32 72, i32 4, i32 18, i32 39, i32 60)
%125 = icmp slt i64 %124, 0
br i1 %125, label %126, label %127
126: ; preds = %121
store i32 -1, i32* %3
br label %164
127: ; preds = %121
%128 = load i8*, i8** %4
%129 = load i64*, i64** %5
%130 = call i64 @split_24bit(i8* %128, i64* %129, i32 76, i32 4, i32 40, i32 61, i32 19)
%131 = icmp slt i64 %130, 0
br i1 %131, label %132, label %133
132: ; preds = %127
store i32 -1, i32* %3
br label %164
133: ; preds = %127
%134 = load i8*, i8** %4
%135 = load i64*, i64** %5
%136 = call i64 @split_24bit(i8* %134, i64* %135, i32 80, i32 4, i32 62, i32 20, i32 41)
%137 = icmp slt i64 %136, 0
br i1 %137, label %138, label %139
138: ; preds = %133
store i32 -1, i32* %3
br label %164
139: ; preds = %133
%140 = load i8*, i8** %4
%141 = getelementptr inbounds i8, i8* %140, i64 85
%142 = load i8, i8* %141
%143 = call i32 @b64_to_int(i8 signext %142)
store i32 %143, i32* %7
%144 = load i32, i32* %7
%145 = icmp slt i32 %144, 0
br i1 %145, label %146, label %147
146: ; preds = %139
store i32 -1, i32* %3
br label %164
147: ; preds = %139
%148 = load i8*, i8** %4
%149 = getelementptr inbounds i8, i8* %148, i64 84
%150 = load i8, i8* %149
%151 = call i32 @b64_to_int(i8 signext %150)
store i32 %151, i32* %8
%152 = load i32, i32* %8
%153 = icmp slt i32 %152, 0
br i1 %153, label %154, label %155
154: ; preds = %147
store i32 -1, i32* %3
br label %164
155: ; preds = %147
%156 = load i32, i32* %7
%157 = shl i32 %156, 6
%158 = load i32, i32* %8
%159 = or i32 %157, %158
store i32 %159, i32* %6
%160 = load i32, i32* %6
%161 = sext i32 %160 to i64
%162 = load i64*, i64** %5
%163 = getelementptr inbounds i64, i64* %162, i64 63
store i64 %161, i64* %163
store i32 0, i32* %3
br label %164
164: ; preds = %155, %154, %146, %138, %132, %126, %120, %114, %108, %102, %96, %90, %84, %78, %72, %66, %60, %54, %48, %42, %36, %30, %24, %18, %12
%165 = load i32, i32* %3
ret i32 %165
}

LLVM IR (-O2):
define i32 @restore_sha512_array(i8* %0, i64* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp eq i32 %3, 86
br i1 %4, label %5, label %83
5: ; preds = %2
%6 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 0, i32 4, i32 0, i32 21, i32 42)
%7 = icmp slt i64 %6, 0
br i1 %7, label %83, label %8
8: ; preds = %5
%9 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 4, i32 4, i32 22, i32 43, i32 1)
%10 = icmp slt i64 %9, 0
br i1 %10, label %83, label %11
11: ; preds = %8
%12 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 8, i32 4, i32 44, i32 2, i32 23)
%13 = icmp slt i64 %12, 0
br i1 %13, label %83, label %14
14: ; preds = %11
%15 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 12, i32 4, i32 3, i32 24, i32 45)
%16 = icmp slt i64 %15, 0
br i1 %16, label %83, label %17
17: ; preds = %14
%18 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 16, i32 4, i32 25, i32 46, i32 4)
%19 = icmp slt i64 %18, 0
br i1 %19, label %83, label %20
20: ; preds = %17
%21 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 20, i32 4, i32 47, i32 5, i32 26)
%22 = icmp slt i64 %21, 0
br i1 %22, label %83, label %23
23: ; preds = %20
%24 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 24, i32 4, i32 6, i32 27, i32 48)
%25 = icmp slt i64 %24, 0
br i1 %25, label %83, label %26
26: ; preds = %23
%27 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 28, i32 4, i32 28, i32 49, i32 7)
%28 = icmp slt i64 %27, 0
br i1 %28, label %83, label %29
29: ; preds = %26
%30 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 32, i32 4, i32 50, i32 8, i32 29)
%31 = icmp slt i64 %30, 0
br i1 %31, label %83, label %32
32: ; preds = %29
%33 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 36, i32 4, i32 9, i32 30, i32 51)
%34 = icmp slt i64 %33, 0
br i1 %34, label %83, label %35
35: ; preds = %32
%36 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 40, i32 4, i32 31, i32 52, i32 10)
%37 = icmp slt i64 %36, 0
br i1 %37, label %83, label %38
38: ; preds = %35
%39 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 44, i32 4, i32 53, i32 11, i32 32)
%40 = icmp slt i64 %39, 0
br i1 %40, label %83, label %41
41: ; preds = %38
%42 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 48, i32 4, i32 12, i32 33, i32 54)
%43 = icmp slt i64 %42, 0
br i1 %43, label %83, label %44
44: ; preds = %41
%45 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 52, i32 4, i32 34, i32 55, i32 13)
%46 = icmp slt i64 %45, 0
br i1 %46, label %83, label %47
47: ; preds = %44
%48 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 56, i32 4, i32 56, i32 14, i32 35)
%49 = icmp slt i64 %48, 0
br i1 %49, label %83, label %50
50: ; preds = %47
%51 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 60, i32 4, i32 15, i32 36, i32 57)
%52 = icmp slt i64 %51, 0
br i1 %52, label %83, label %53
53: ; preds = %50
%54 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 64, i32 4, i32 37, i32 58, i32 16)
%55 = icmp slt i64 %54, 0
br i1 %55, label %83, label %56
56: ; preds = %53
%57 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 68, i32 4, i32 59, i32 17, i32 38)
%58 = icmp slt i64 %57, 0
br i1 %58, label %83, label %59
59: ; preds = %56
%60 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 72, i32 4, i32 18, i32 39, i32 60)
%61 = icmp slt i64 %60, 0
br i1 %61, label %83, label %62
62: ; preds = %59
%63 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 76, i32 4, i32 40, i32 61, i32 19)
%64 = icmp slt i64 %63, 0
br i1 %64, label %83, label %65
65: ; preds = %62
%66 = tail call i64 @split_24bit(i8* %0, i64* %1, i32 80, i32 4, i32 62, i32 20, i32 41)
%67 = icmp slt i64 %66, 0
br i1 %67, label %83, label %68
68: ; preds = %65
%69 = getelementptr inbounds i8, i8* %0, i64 85
%70 = load i8, i8* %69
%71 = tail call i32 @b64_to_int(i8 signext %70)
%72 = icmp slt i32 %71, 0
br i1 %72, label %83, label %73
73: ; preds = %68
%74 = getelementptr inbounds i8, i8* %0, i64 84
%75 = load i8, i8* %74
%76 = tail call i32 @b64_to_int(i8 signext %75)
%77 = icmp slt i32 %76, 0
br i1 %77, label %83, label %78
78: ; preds = %73
%79 = shl i32 %71, 6
%80 = or i32 %76, %79
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i64, i64* %1, i64 63
store i64 %81, i64* %82
br label %83
83: ; preds = %73, %68, %65, %62, %59, %56, %53, %50, %47, %44, %41, %38, %35, %32, %29, %26, %23, %20, %17, %14, %11, %8, %5, %2, %78
%84 = phi i32 [ 0, %78 ], [ -1, %2 ], [ -1, %5 ], [ -1, %8 ], [ -1, %11 ], [ -1, %14 ], [ -1, %17 ], [ -1, %20 ], [ -1, %23 ], [ -1, %26 ], [ -1, %29 ], [ -1, %32 ], [ -1, %35 ], [ -1, %38 ], [ -1, %41 ], [ -1, %44 ], [ -1, %47 ], [ -1, %50 ], [ -1, %53 ], [ -1, %56 ], [ -1, %59 ], [ -1, %62 ], [ -1, %65 ], [ -1, %68 ], [ -1, %73 ]
ret i32 %84
}