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

```asm
<lznt1_block>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  movq   $0x0,-0x10(%rbp)
  movl   $0xc,-0x38(%rbp)
  movl   $0x10,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L113
L115:
  cmpl   $0x0,-0x30(%rbp)
  jne    L36
  mov    -0x48(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x2c(%rbp)
  addq   $0x1,-0x58(%rbp)
  mov    -0x58(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  je     L122
L36:
  mov    -0x2c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L107
  mov    -0x58(%rbp),%rax
  add    $0x4,%rax
  cmp    %rax,-0x50(%rbp)
  jae    L148
  mov    -0x58(%rbp),%rax
  mov    %rax,%rsi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L71
L148:
  mov    -0x48(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  addq   $0x4,-0x58(%rbp)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x38(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%ecx
  shl    %cl,%esi
  mov    %esi,%eax
  sub    $0x1,%eax
  and    %edx,%eax
  add    $0x3,%eax
  cltq
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L39
  mov    -0x8(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x38(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  cltq
  shl    $0x2,%rax
  mov    $0xfffffffffffffffc,%rdx
  sub    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  jmp    L109
L102:
  mov    -0x28(%rbp),%rdx
  lea    0x4(%rdx),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rcx
  mov    %rcx,-0x20(%rbp)
  mov    (%rdx),%edx
  mov    %edx,(%rax)
L109:
  mov    -0x18(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  test   %rax,%rax
  jne    L102
  jmp    L39
L107:
  mov    -0x48(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L1
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    (%rdx),%edx
  mov    %edx,(%rax)
L1:
  addq   $0x1,-0x58(%rbp)
  addq   $0x1,-0x10(%rbp)
  jmp    L39
L14:
  subl   $0x1,-0x38(%rbp)
  shll   -0x34(%rbp)
L39:
  mov    -0x34(%rbp),%eax
  cmp    %rax,-0x10(%rbp)
  ja     L14
  shrl   -0x2c(%rbp)
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  and    $0x7,%eax
  mov    %eax,-0x30(%rbp)
L113:
  mov    -0x58(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  jne    L115
  jmp    L129
L122:
  nop
L129:
  mov    -0x10(%rbp),%rax
L71:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D0
type_guessed: string

tool: D0: LZNT1 compressed value overrun at %#zx


assistant: ```c
ssize_t lznt1_block(const void *data, size_t limit, size_t offset, void *block) {
  const uint16_t *tuple;
  const uint8_t *copy_src;
  uint8_t *copy_dest = block;
  size_t copy_len;
  size_t block_out_len = 0;
  unsigned int split = 12;
  unsigned int next_threshold = 16;
  unsigned int tag_bit = 0;
  unsigned int tag = 0;
  while (offset != limit) {
    if (tag_bit == 0) {
      tag = *((uint8_t *)(data + offset));
      offset++;
      if (offset == limit)
        break;
    }
    if (tag & 1) {
      if (offset + sizeof(*tuple) > limit) {
        do {
          if (1 & 1) {
            printf("LZNT1 compressed value overrun at "
                   "%#zx\n",
                   offset);
          }
        } while (0);
        return -1;
      }
      tuple = (data + offset);
      offset += sizeof(*tuple);
      copy_len = (((*tuple) & ((1 << (split)) - 1)) + 3);
      block_out_len += copy_len;
      if (copy_dest) {
        copy_src = (copy_dest - (((*tuple) >> split) + 1));
        while (copy_len--)
          *(copy_dest++) = *(copy_src++);
      }
    } else {
      copy_src = (data + offset);
      if (copy_dest)
        *(copy_dest++) = *copy_src;
      offset++;
      block_out_len++;
    }
    while (block_out_len > next_threshold) {
      split--;
      next_threshold <<= 1;
    }
    tag >>= 1;
    tag_bit = ((tag_bit + 1) % 8);
  }
  return block_out_len;
}
```