user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<restore_sha512_array>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  call   <strlen@plt>
  cmp    $0x56,%eax
  jne    L335
  sub    $0x8,%rsp
  push   $0x2a
  mov    $0x15,%r9d
  mov    $0x0,%r8d
  mov    $0x4,%ecx
  mov    $0x0,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L271
  sub    $0x8,%rsp
  push   $0x1
  mov    $0x2b,%r9d
  mov    $0x16,%r8d
  mov    $0x4,%ecx
  mov    $0x4,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L259
  sub    $0x8,%rsp
  push   $0x17
  mov    $0x2,%r9d
  mov    $0x2c,%r8d
  mov    $0x4,%ecx
  mov    $0x8,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L280
  sub    $0x8,%rsp
  push   $0x2d
  mov    $0x18,%r9d
  mov    $0x3,%r8d
  mov    $0x4,%ecx
  mov    $0xc,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L277
  sub    $0x8,%rsp
  push   $0x4
  mov    $0x2e,%r9d
  mov    $0x19,%r8d
  mov    $0x4,%ecx
  mov    $0x10,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L234
  sub    $0x8,%rsp
  push   $0x1a
  mov    $0x5,%r9d
  mov    $0x2f,%r8d
  mov    $0x4,%ecx
  mov    $0x14,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L257
  sub    $0x8,%rsp
  push   $0x30
  mov    $0x1b,%r9d
  mov    $0x6,%r8d
  mov    $0x4,%ecx
  mov    $0x18,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L382
  sub    $0x8,%rsp
  push   $0x7
  mov    $0x31,%r9d
  mov    $0x1c,%r8d
  mov    $0x4,%ecx
  mov    $0x1c,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L151
  sub    $0x8,%rsp
  push   $0x1d
  mov    $0x8,%r9d
  mov    $0x32,%r8d
  mov    $0x4,%ecx
  mov    $0x20,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L437
  sub    $0x8,%rsp
  push   $0x33
  mov    $0x1e,%r9d
  mov    $0x9,%r8d
  mov    $0x4,%ecx
  mov    $0x24,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L276
  sub    $0x8,%rsp
  push   $0xa
  mov    $0x34,%r9d
  mov    $0x1f,%r8d
  mov    $0x4,%ecx
  mov    $0x28,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L438
  sub    $0x8,%rsp
  push   $0x20
  mov    $0xb,%r9d
  mov    $0x35,%r8d
  mov    $0x4,%ecx
  mov    $0x2c,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L139
  sub    $0x8,%rsp
  push   $0x36
  mov    $0x21,%r9d
  mov    $0xc,%r8d
  mov    $0x4,%ecx
  mov    $0x30,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L31
  sub    $0x8,%rsp
  push   $0xd
  mov    $0x37,%r9d
  mov    $0x22,%r8d
  mov    $0x4,%ecx
  mov    $0x34,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L186
  sub    $0x8,%rsp
  push   $0x23
  mov    $0xe,%r9d
  mov    $0x38,%r8d
  mov    $0x4,%ecx
  mov    $0x38,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L315
  sub    $0x8,%rsp
  push   $0x39
  mov    $0x24,%r9d
  mov    $0xf,%r8d
  mov    $0x4,%ecx
  mov    $0x3c,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L196
  sub    $0x8,%rsp
  push   $0x10
  mov    $0x3a,%r9d
  mov    $0x25,%r8d
  mov    $0x4,%ecx
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L332
  sub    $0x8,%rsp
  push   $0x26
  mov    $0x11,%r9d
  mov    $0x3b,%r8d
  mov    $0x4,%ecx
  mov    $0x44,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L313
  sub    $0x8,%rsp
  push   $0x3c
  mov    $0x27,%r9d
  mov    $0x12,%r8d
  mov    $0x4,%ecx
  mov    $0x48,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L374
  sub    $0x8,%rsp
  push   $0x13
  mov    $0x3d,%r9d
  mov    $0x28,%r8d
  mov    $0x4,%ecx
  mov    $0x4c,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L442
  sub    $0x8,%rsp
  push   $0x29
  mov    $0x14,%r9d
  mov    $0x3e,%r8d
  mov    $0x4,%ecx
  mov    $0x50,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <split_24bit@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  js     L66
  movsbl 0x55(%rbx),%edi
  call   <b64_to_int@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  js     L473
  movsbl 0x54(%rbx),%edi
  call   <b64_to_int@plt>
  test   %eax,%eax
  js     L403
  shl    $0x6,%r12d
  or     %eax,%r12d
  movslq %r12d,%r12
  mov    %r12,0x1f8(%rbp)
  mov    $0x0,%eax
L71:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L335:
  mov    $0xffffffff,%eax
  jmp    L71
L271:
  mov    $0xffffffff,%eax
  jmp    L71
L259:
  mov    $0xffffffff,%eax
  jmp    L71
L280:
  mov    $0xffffffff,%eax
  jmp    L71
L277:
  mov    $0xffffffff,%eax
  jmp    L71
L234:
  mov    $0xffffffff,%eax
  jmp    L71
L257:
  mov    $0xffffffff,%eax
  jmp    L71
L382:
  mov    $0xffffffff,%eax
  jmp    L71
L151:
  mov    $0xffffffff,%eax
  jmp    L71
L437:
  mov    $0xffffffff,%eax
  jmp    L71
L276:
  mov    $0xffffffff,%eax
  jmp    L71
L438:
  mov    $0xffffffff,%eax
  jmp    L71
L139:
  mov    $0xffffffff,%eax
  jmp    L71
L31:
  mov    $0xffffffff,%eax
  jmp    L71
L186:
  mov    $0xffffffff,%eax
  jmp    L71
L315:
  mov    $0xffffffff,%eax
  jmp    L71
L196:
  mov    $0xffffffff,%eax
  jmp    L71
L332:
  mov    $0xffffffff,%eax
  jmp    L71
L313:
  mov    $0xffffffff,%eax
  jmp    L71
L374:
  mov    $0xffffffff,%eax
  jmp    L71
L442:
  mov    $0xffffffff,%eax
  jmp    L71
L66:
  mov    $0xffffffff,%eax
  jmp    L71
L473:
  mov    $0xffffffff,%eax
  jmp    L71
L403:
  mov    $0xffffffff,%eax
  jmp    L71
```

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;
}
```