user: Converte this assembly snippet into its equivalent C code:

```asm
<haval_cert>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x80,%edx
  mov    $0x3,%esi
  lea    D45(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rsp,%rbx
  mov    %rbx,%rsi
  lea    D62(%rip),%rbp
  mov    %rbp,%rdi
  call   <haval_string@plt>
  mov    %rbp,%rsi
  lea    D130(%rip),%rbp
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbx,%rsi
  lea    D106(%rip),%r12
  mov    %r12,%rdi
  call   <haval_string@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbx,%rsi
  lea    D107(%rip),%r12
  mov    %r12,%rdi
  call   <haval_string@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbx,%rsi
  lea    D99(%rip),%r12
  mov    %r12,%rdi
  call   <haval_string@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbx,%rsi
  lea    D109(%rip),%r12
  mov    %r12,%rdi
  call   <haval_string@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbx,%rsi
  lea    D48(%rip),%rbp
  mov    %rbp,%rdi
  call   <haval_string@plt>
  mov    %rbp,%rsi
  lea    D132(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbx,%rsi
  lea    D3(%rip),%rdi
  call   <haval_file@plt>
  test   %rax,%rax
  je     L17
  lea    D3(%rip),%rsi
  lea    D121(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L24:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L17:
  lea    D3(%rip),%rsi
  lea    D71(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rsp,%rdi
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L24
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D45
datatype: string
name: unpack_data
arguments: data_label: D62
datatype: string
name: unpack_data
arguments: data_label: D130
datatype: string
name: unpack_data
arguments: data_label: D106
datatype: string
name: unpack_data
arguments: data_label: D107
datatype: string
name: unpack_data
arguments: data_label: D99
datatype: string
name: unpack_data
arguments: data_label: D109
datatype: string
name: unpack_data
arguments: data_label: D48
datatype: string
name: unpack_data
arguments: data_label: D132
datatype: string
name: unpack_data
arguments: data_label: D3
datatype: string
name: unpack_data
arguments: data_label: D121
datatype: string
name: unpack_data
arguments: data_label: D71
datatype: string

tool: D45: HAVAL certification data (PASS=%d, FPTLEN=%d):

tool: 

tool: D130: HAVAL("%s") = 

tool: D106: a

tool: D107: HAVAL

tool: D99: 0123456789

tool: D109: abcdefghijklmnopqrstuvwxyz

tool: D48: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

tool: D132: HAVAL("%s")
      = 

tool: D3: pi.frac

tool: D121: %s can not be opened !


tool: D71: HAVAL(File %s) = 

assistant: ```c
void haval_cert(void) {
  unsigned int i;
  char *str;
  unsigned char fingerprint[128 >> 3];
  printf("\n");
  printf("HAVAL certification data (PASS=%d, FPTLEN=%d):", 3, 128);
  printf("\n");
  str = "";
  haval_string(str, fingerprint);
  printf("HAVAL(\"%s\") = ", str);
  haval_print(fingerprint);
  printf("\n");
  str = "a";
  haval_string(str, fingerprint);
  printf("HAVAL(\"%s\") = ", str);
  haval_print(fingerprint);
  printf("\n");
  str = "HAVAL";
  haval_string(str, fingerprint);
  printf("HAVAL(\"%s\") = ", str);
  haval_print(fingerprint);
  printf("\n");
  str = "0123456789";
  haval_string(str, fingerprint);
  printf("HAVAL(\"%s\") = ", str);
  haval_print(fingerprint);
  printf("\n");
  str = "abcdefghijklmnopqrstuvwxyz";
  haval_string(str, fingerprint);
  printf("HAVAL(\"%s\") = ", str);
  haval_print(fingerprint);
  printf("\n");
  str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  haval_string(str, fingerprint);
  printf("HAVAL(\"%s\")\n      = ", str);
  haval_print(fingerprint);
  printf("\n");
  str = "pi.frac";
  if (haval_file(str, fingerprint)) {
    printf("%s can not be opened !\n", str);
  } else {
    printf("HAVAL(File %s) = ", str);
    haval_print(fingerprint);
    printf("\n");
  }
}
```