user: 请将以下的汇编代码转换成C语言代码：

```asm
<restore_sha512_array>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  cmp    $0x56,%eax
  jne    L73
  sub    $0x8,%rsp
  mov    $0x15,%r9d
  xor    %r8d,%r8d
  xor    %edx,%edx
  push   $0x2a
  mov    $0x4,%ecx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  pop    %r8
  pop    %r9
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    $0x2b,%r9d
  push   $0x1
  mov    $0x16,%r8d
  mov    $0x4,%ecx
  mov    $0x4,%edx
  call   <split_24bit@plt>
  pop    %rsi
  pop    %rdi
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x4,%ecx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x17
  mov    $0x8,%edx
  mov    $0x2,%r9d
  mov    $0x2c,%r8d
  call   <split_24bit@plt>
  pop    %rdx
  pop    %rcx
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x18,%r9d
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x2d
  mov    $0x3,%r8d
  mov    $0x4,%ecx
  mov    $0xc,%edx
  call   <split_24bit@plt>
  pop    %r11
  pop    %r12
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x2e,%r9d
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x4
  mov    $0x19,%r8d
  mov    $0x4,%ecx
  mov    $0x10,%edx
  call   <split_24bit@plt>
  pop    %r9
  pop    %r10
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x2f,%r8d
  mov    %rbx,%rdi
  mov    %rbp,%rsi
  push   $0x1a
  mov    $0x5,%r9d
  mov    $0x4,%ecx
  mov    $0x14,%edx
  call   <split_24bit@plt>
  pop    %rdi
  pop    %r8
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x4,%ecx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x30
  mov    $0x1b,%r9d
  mov    $0x6,%r8d
  mov    $0x18,%edx
  call   <split_24bit@plt>
  pop    %rcx
  pop    %rsi
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x1c,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x7
  mov    $0x31,%r9d
  mov    $0x1c,%r8d
  mov    $0x4,%ecx
  call   <split_24bit@plt>
  pop    %r12
  pop    %rdx
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x8,%r9d
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x1d
  mov    $0x32,%r8d
  mov    $0x4,%ecx
  mov    $0x20,%edx
  call   <split_24bit@plt>
  pop    %r10
  pop    %r11
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x1e,%r9d
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x33
  mov    $0x9,%r8d
  mov    $0x4,%ecx
  mov    $0x24,%edx
  call   <split_24bit@plt>
  pop    %r8
  pop    %r9
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    $0x34,%r9d
  push   $0xa
  mov    $0x1f,%r8d
  mov    $0x4,%ecx
  mov    $0x28,%edx
  call   <split_24bit@plt>
  pop    %rsi
  pop    %rdi
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x4,%ecx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x20
  mov    $0x2c,%edx
  mov    $0xb,%r9d
  mov    $0x35,%r8d
  call   <split_24bit@plt>
  pop    %rdx
  pop    %rcx
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x21,%r9d
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x36
  mov    $0xc,%r8d
  mov    $0x4,%ecx
  mov    $0x30,%edx
  call   <split_24bit@plt>
  pop    %r11
  pop    %r12
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x37,%r9d
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0xd
  mov    $0x22,%r8d
  mov    $0x4,%ecx
  mov    $0x34,%edx
  call   <split_24bit@plt>
  pop    %r9
  pop    %r10
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x38,%r8d
  mov    %rbx,%rdi
  mov    %rbp,%rsi
  push   $0x23
  mov    $0xe,%r9d
  mov    $0x4,%ecx
  mov    $0x38,%edx
  call   <split_24bit@plt>
  pop    %rdi
  pop    %r8
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x4,%ecx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x39
  mov    $0x24,%r9d
  mov    $0xf,%r8d
  mov    $0x3c,%edx
  call   <split_24bit@plt>
  pop    %rcx
  pop    %rsi
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x10
  mov    $0x3a,%r9d
  mov    $0x25,%r8d
  mov    $0x4,%ecx
  call   <split_24bit@plt>
  pop    %r12
  pop    %rdx
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x11,%r9d
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x26
  mov    $0x3b,%r8d
  mov    $0x4,%ecx
  mov    $0x44,%edx
  call   <split_24bit@plt>
  pop    %r10
  pop    %r11
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x27,%r9d
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x3c
  mov    $0x12,%r8d
  mov    $0x4,%ecx
  mov    $0x48,%edx
  call   <split_24bit@plt>
  pop    %r8
  pop    %r9
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    $0x3d,%r9d
  push   $0x13
  mov    $0x28,%r8d
  mov    $0x4,%ecx
  mov    $0x4c,%edx
  call   <split_24bit@plt>
  pop    %rsi
  pop    %rdi
  test   %rax,%rax
  js     L73
  sub    $0x8,%rsp
  mov    $0x4,%ecx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  push   $0x29
  mov    $0x50,%edx
  mov    $0x14,%r9d
  mov    $0x3e,%r8d
  call   <split_24bit@plt>
  pop    %rdx
  pop    %rcx
  test   %rax,%rax
  js     L73
  movsbl 0x55(%rbx),%edi
  call   <b64_to_int@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  js     L73
  movsbl 0x54(%rbx),%edi
  call   <b64_to_int@plt>
  test   %eax,%eax
  js     L73
  shl    $0x6,%r12d
  pop    %rbx
  or     %eax,%r12d
  xor    %eax,%eax
  movslq %r12d,%r12
  mov    %r12,0x1f8(%rbp)
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L73:
  pop    %rbx
  mov    $0xffffffff,%eax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
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;
}
```