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

```asm
<dact_mzlib2_decompress>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %edx,-0x54(%rbp)
  mov    %ecx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x54(%rbp),%eax
  add    %eax,%eax
  cltq
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x34(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x54(%rbp),%ecx
  mov    -0x48(%rbp),%rdx
  lea    -0x28(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <uncompress@plt>
  mov    %eax,-0x30(%rbp)
  mov    D13(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x30(%rbp)
  je     L79
  mov    $0x0,%eax
  jmp    L85
L79:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  add    $0x2,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x2,%eax
  cmp    $0x1ff,%eax
  ja     L67
  movl   $0x1,-0x34(%rbp)
L67:
  movl   $0x2,-0x38(%rbp)
  jmp    L59
L37:
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x1(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %eax,%edx
  mov    -0x38(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  mov    %eax,%ecx
  movslq %edx,%rax
  movslq %ecx,%rdx
  lea    0x0(,%rdx,8),%rcx
  lea    D23(%rip),%rdx
  mov    %rax,(%rcx,%rdx,1)
  addl   $0x2,-0x38(%rbp)
L59:
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x2c(%rbp)
  ja     L37
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  jmp    L96
L56:
  cmpl   $0x0,-0x34(%rbp)
  je     L98
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %rax,-0x20(%rbp)
  jmp    L70
L98:
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x1(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  cltq
  mov    %rax,-0x20(%rbp)
L70:
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  lea    D23(%rip),%rax
  mov    (%rdx,%rax,1),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  shr    $0x8,%rax
  mov    %rax,%rcx
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%rdx
  mov    %dl,(%rax)
  mov    $0x2,%eax
  sub    -0x34(%rbp),%eax
  add    %eax,-0x38(%rbp)
L96:
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  cmp    %rax,%rdx
  jb     L56
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x3c(%rbp),%eax
L85:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L33
  call   <__stack_chk_fail@plt>
L33:
  leave
  ret
```

assistant: ```c
int dact_mzlib2_decompress(unsigned char *curr_block, unsigned char *out_block, int blk_size, int bufsize) {
  static uint16_t lookup_table[65536];
  uint16_t curr_val, repl_val;
  unsigned long dest_size = (blk_size * 2);
  unsigned char *tmp_block;
  unsigned int m = 0, hdrsize;
  int retval, i, low_byte = 0;
  tmp_block = malloc(dest_size);
  retval = uncompress(tmp_block, &dest_size, curr_block, blk_size);
  if (retval != Z_OK)
    return (0);
  hdrsize = ((unsigned int)(((tmp_block[0] << 8) | tmp_block[1]))) + 2;
  if ((hdrsize - 2) < 0x200)
    low_byte = 1;
  for (i = 2; i < hdrsize; i += 2) {
    lookup_table[(i - 2) / 2] = ((tmp_block[i] << 8) | tmp_block[i + 1]);
  }
  for (i = hdrsize; i < (dest_size); i += (2 - low_byte)) {
    if (low_byte) {
      curr_val = tmp_block[i];
    } else {
      curr_val = ((tmp_block[i] << 8) | tmp_block[i + 1]);
    }
    repl_val = lookup_table[curr_val];
    out_block[m++] = repl_val >> 8;
    out_block[m++] = repl_val & 0xff;
  }
  free(tmp_block);
  return (m);
}
```