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

```asm
<lznt1_block>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%rbp
  cmp    %rsi,%rdx
  je     L25
  mov    %rdi,%r13
  mov    %rdx,%rsi
  mov    %rcx,%r9
  mov    $0x0,%r10d
  mov    $0x0,%r8d
  mov    $0x10,%edx
  mov    $0xc,%ecx
  mov    $0x0,%eax
  mov    $0x1,%r14d
  jmp    L97
L96:
  lea    D8(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
L0:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L35:
  test   %r9,%r9
  je     L38
  mov    0x0(%r13,%rsi,1),%edi
  mov    %edi,(%r9)
  lea    0x4(%r9),%r9
L38:
  add    $0x1,%rsi
  add    $0x1,%rax
L60:
  mov    %edx,%edi
  cmp    %rdi,%rax
  jbe    L41
L18:
  sub    $0x1,%ecx
  add    %edx,%edx
  mov    %edx,%edi
  cmp    %rax,%rdi
  jb     L18
L41:
  shr    %r10d
  add    $0x1,%r8d
  and    $0x7,%r8d
  cmp    %rsi,%rbp
  je     L0
L97:
  test   %r8d,%r8d
  jne    L154
  mov    0x0(%r13,%rsi,1),%r10d
  add    $0x1,%rsi
  cmp    %rsi,%rbp
  je     L0
L154:
  test   $0x1,%r10b
  je     L35
  lea    0x4(%rsi),%rbx
  cmp    %rbp,%rbx
  ja     L96
  mov    0x0(%r13,%rsi,1),%r12d
  mov    %r14d,%edi
  shl    %cl,%edi
  sub    $0x1,%edi
  and    %r12d,%edi
  lea    0x3(%rdi),%r11d
  movslq %r11d,%r11
  add    %r11,%rax
  mov    %rbx,%rsi
  test   %r9,%r9
  je     L60
  sar    %cl,%r12d
  movslq %r12d,%rsi
  shl    $0x2,%rsi
  mov    $0xfffffffffffffffc,%r15
  sub    %rsi,%r15
  mov    %r15,%r12
  add    %r9,%r12
  test   %r11,%r11
  je     L49
  movslq %edi,%rdi
  add    $0x3,%rdi
  mov    $0x0,%esi
L58:
  mov    (%r12,%rsi,4),%r15d
  mov    %r15d,(%r9,%rsi,4)
  add    $0x1,%rsi
  cmp    %rsi,%rdi
  jne    L58
  lea    (%r9,%r11,4),%r9
  mov    %rbx,%rsi
  jmp    L60
L49:
  mov    %rbx,%rsi
  jmp    L60
L25:
  mov    $0x0,%eax
  jmp    L0
```

tool_calls: name: read_data
arguments: tag: D8
data_type: string

tool: D8: 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;
}
```