user: Please show me the C implementation that matches the assembly code listed below:

```asm
<haval_cert>:
  endbr64
  push   %r13
  mov    $0xa,%edi
  lea    D73(%rip),%r13
  push   %r12
  lea    D62(%rip),%r12
  push   %rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  call   <putchar@plt>
  mov    $0x80,%edx
  mov    $0x3,%esi
  xor    %eax,%eax
  lea    D66(%rip),%rdi
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r12,%rdi
  mov    %rbp,%rsi
  call   <haval_string@plt>
  mov    %r12,%rsi
  lea    D117(%rip),%r12
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r13,%rdi
  mov    %rbp,%rsi
  call   <haval_string@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  lea    D27(%rip),%r13
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r13,%rdi
  mov    %rbp,%rsi
  call   <haval_string@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  lea    D41(%rip),%r13
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r13,%rdi
  mov    %rbp,%rsi
  call   <haval_string@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  lea    D50(%rip),%r13
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <haval_string@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  lea    D52(%rip),%r12
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r12,%rdi
  mov    %rbp,%rsi
  call   <haval_string@plt>
  mov    %r12,%rsi
  xor    %eax,%eax
  lea    D67(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  lea    D110(%rip),%r12
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <haval_file@plt>
  mov    %r12,%rsi
  test   %rax,%rax
  je     L11
  lea    D17(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L23:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  add    $0x20,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nop
L11:
  lea    D68(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <haval_print@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L23
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D73
type: string
name: read_data
arguments: tag: D62
type: string
name: read_data
arguments: tag: D66
type: string
name: read_data
arguments: tag: D117
type: string
name: read_data
arguments: tag: D27
type: string
name: read_data
arguments: tag: D41
type: string
name: read_data
arguments: tag: D50
type: string
name: read_data
arguments: tag: D52
type: string
name: read_data
arguments: tag: D67
type: string
name: read_data
arguments: tag: D110
type: string
name: read_data
arguments: tag: D17
type: string
name: read_data
arguments: tag: D68
type: string

tool: D73: a

tool: 

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

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

tool: D27: HAVAL

tool: D41: 0123456789

tool: D50: abcdefghijklmnopqrstuvwxyz

tool: D52: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

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

tool: D110: pi.frac

tool: D17: %s can not be opened !


tool: D68: 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");
  }
}
```