user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<test>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %rdx,%r14
  mov    %ecx,%r13d
  mov    %r8,%r15
  mov    %r9d,0xc(%rsp)
  mov    $0x6,%r8d
  call   <compress2@plt>
  test   %eax,%eax
  jne    L57
  lea    0xc(%rsp),%rcx
  mov    (%r12),%esi
  sub    $0x6,%esi
  lea    0x10(%rbp),%rdi
  mov    %r15,%rdx
  call   <inflate_multi_pass@plt>
  mov    %eax,%ebx
  lea    0x3(%rax),%eax
  cmp    $0x5,%eax
  ja     L42
  mov    %eax,%eax
  lea    D79(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L57:
  mov    %eax,%ebx
  mov    %eax,%esi
  lea    D40(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L98:
  mov    %ebx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  lea    D66(%rip),%rdi
  call   <puts@plt>
  jmp    L98
  lea    D64(%rip),%rdi
  call   <puts@plt>
  jmp    L98
  lea    D24(%rip),%rdi
  call   <puts@plt>
  jmp    L98
  lea    D65(%rip),%rdi
  call   <puts@plt>
  jmp    L98
  lea    D73(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L98
L42:
  lea    D20(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%ebx
  jmp    L98
  cmp    %r13d,0xc(%rsp)
  jne    L4
  mov    %r13d,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L98
  test   %r13d,%r13d
  jle    L73
  lea    -0x1(%r13),%ebp
  mov    $0x0,%ebx
  lea    D25(%rip),%r12
  jmp    L169
L4:
  lea    D35(%rip),%rdi
  call   <puts@plt>
  mov    %r13d,%edx
  mov    0xc(%rsp),%esi
  lea    D102(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%ebx
  jmp    L98
L78:
  lea    0x1(%rbx),%rax
  cmp    %rbp,%rbx
  je     L73
  mov    %rax,%rbx
L169:
  mov    %ebx,%esi
  mov    (%r14,%rbx,8),%rdx
  mov    (%r15,%rbx,8),%rcx
  cmp    %rcx,%rdx
  je     L78
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L78
L73:
  lea    D90(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%ebx
  jmp    L98
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D40
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D66
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D64
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D24
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D65
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D73
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D20
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D25
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D35
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D102
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D90
type_infered: string

tool: D40: Failed compressing input with exit code %d

tool: D66:  did not decompress all input

tool: D64:   invalid header

tool: D24:  invalid symbol

tool: D65:  out buffer overflow

tool: D73: Invalid lookback distance

tool: D20:  error

tool: D25: first error at %d, 0x%x != 0x%x


tool: D35: incorrect amount of data was decompressed from compressed data

tool: D102: %d decompressed of %d compressed

tool: D90:  decompressed data is not the same as the compressed data

assistant: ```c
int test(uint8_t *compressed_stream, uint64_t *compressed_length, uint8_t *uncompressed_stream, uint32_t uncompressed_length, uint8_t *uncompressed_test_stream, uint32_t uncompressed_test_stream_length) {
  int ret;
  ret = compress2(compressed_stream, (uLongf *)compressed_length, uncompressed_stream, uncompressed_length, 6);
  if (ret) {
    printf("Failed compressing input with exit code %d", ret);
    return ret;
  }
  ret = inflate_multi_pass(compressed_stream + 2, *compressed_length - 2 - 4, uncompressed_test_stream, &uncompressed_test_stream_length);
  switch (ret) {
  case 0:
    break;
  case 1:
    printf(" did not decompress all input\n");
    return 1;
    break;
  case -1:
    printf("  invalid header\n");
    return -1;
    break;
  case -2:
    printf(" invalid symbol\n");
    return -2;
    break;
  case 2:
    printf(" out buffer overflow\n");
    return 2;
    break;
  case -3:
    printf("Invalid lookback distance");
    return -3;
    break;
  default:
    printf(" error\n");
    return -1;
    break;
  }
  if (uncompressed_test_stream_length != uncompressed_length) {
    printf("incorrect amount of data was decompressed from compressed data\n");
    printf("%d decompressed of %d compressed", uncompressed_test_stream_length, uncompressed_length);
    return -1;
  }
  if (memcmp(uncompressed_stream, uncompressed_test_stream, uncompressed_length)) {
    int i;
    for (i = 0; i < uncompressed_length; i++) {
      if (uncompressed_stream[i] != uncompressed_test_stream[i]) {
        printf("first error at %d, 0x%x != 0x%x\n", i, uncompressed_stream[i], uncompressed_test_stream[i]);
      }
    }
    printf(" decompressed data is not the same as the compressed data\n");
    return -1;
  }
  return 0;
}
```