user: 请从给定的汇编指令推导出C源代码:

```asm
<compress_DDS_color_block>:
  endbr64
  push   %r14
  mov    %edi,%r14d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %r13,%rcx
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  mov    %r14d,%edx
  sub    $0x60,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rsi
  lea    0x8(%rsp),%rdi
  movabs $0x200000000,%rax
  mov    %rax,0x40(%rsp)
  lea    0x10(%rsp),%r12
  lea    0x20(%rsp),%rbp
  movabs $0x100000003,%rax
  movq   $0x0,0x30(%rsp)
  movl   $0x0,0x38(%rsp)
  mov    %rax,0x48(%rsp)
  call   <LSE_master_colors_max_min@plt>
  movzwl 0x8(%rsp),%eax
  mov    0x8(%rsp),%edi
  mov    %r12,%rsi
  movl   $0x0,0x4(%rbx)
  lea    0x18(%rsp),%rcx
  lea    0x14(%rsp),%rdx
  mov    %ax,(%rbx)
  movzwl 0xc(%rsp),%eax
  mov    %ax,0x2(%rbx)
  call   <rgb_888_from_565@plt>
  mov    0xc(%rsp),%edi
  lea    0x24(%rsp),%rdx
  mov    %rbp,%rsi
  lea    0x28(%rsp),%rcx
  call   <rgb_888_from_565@plt>
  xor    %eax,%eax
  pxor   %xmm2,%xmm2
  lea    0x30(%rsp),%rdx
L3:
  mov    0x0(%rbp,%rax,1),%ecx
  pxor   %xmm0,%xmm0
  sub    (%r12,%rax,1),%ecx
  cvtsi2ss %ecx,%xmm0
  movss  %xmm0,(%rdx,%rax,1)
  mulss  %xmm0,%xmm0
  add    $0x4,%rax
  addss  %xmm0,%xmm2
  cmp    $0xc,%rax
  jne    L3
  pxor   %xmm6,%xmm6
  comiss %xmm6,%xmm2
  jbe    L16
  movss  D13(%rip),%xmm0
  divss  %xmm2,%xmm0
  movaps %xmm0,%xmm2
L16:
  movss  0x30(%rsp),%xmm5
  pxor   %xmm3,%xmm3
  movslq %r14d,%r8
  mov    %r13,%rdx
  movss  0x34(%rsp),%xmm4
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0x10(%rsp),%xmm3
  movss  D9(%rip),%xmm7
  mulss  %xmm2,%xmm5
  cvtsi2ssl 0x14(%rsp),%xmm0
  mov    $0x20,%esi
  movss  D20(%rip),%xmm6
  mulss  %xmm2,%xmm4
  mulss  0x38(%rsp),%xmm2
  mulss  %xmm5,%xmm3
  mulss  %xmm4,%xmm0
  addss  %xmm0,%xmm3
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0x18(%rsp),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm0,%xmm3
  nopl   0x0(%rax)
L30:
  movzbl (%rdx),%eax
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %esi,%edi
  xor    %ecx,%ecx
  sar    $0x3,%edi
  cvtsi2ss %eax,%xmm0
  movzbl 0x1(%rdx),%eax
  movslq %edi,%rdi
  cvtsi2ss %eax,%xmm1
  movzbl 0x2(%rdx),%eax
  mulss  %xmm5,%xmm0
  mulss  %xmm4,%xmm1
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  mulss  %xmm2,%xmm1
  addss  %xmm1,%xmm0
  subss  %xmm3,%xmm0
  mulss  %xmm7,%xmm0
  addss  %xmm6,%xmm0
  cvttss2si %xmm0,%eax
  test   %eax,%eax
  cmovs  %ecx,%eax
  mov    $0x3,%ecx
  cmp    %ecx,%eax
  cmovg  %ecx,%eax
  mov    %esi,%ecx
  add    $0x2,%esi
  add    %r8,%rdx
  and    $0x7,%ecx
  cltq
  mov    0x40(%rsp,%rax,4),%eax
  shl    %cl,%eax
  or     %al,(%rbx,%rdi,1)
  cmp    $0x40,%esi
  jne    L30
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L35
  add    $0x60,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L35:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D13
datatype: f32
name: unpack_data
arguments: tag: D9
datatype: byte[4]
name: unpack_data
arguments: tag: D20
datatype: byte[4]

tool: D13: 1

tool: {"D9": [0x00,0x00,0x40,0x40]}

tool: {"D20": [0x00,0x00,0x00,0x3f]}

assistant: ```c
void compress_DDS_color_block(int channels, const unsigned char *const uncompressed, unsigned char compressed[8]) {
  int i;
  int next_bit;
  int enc_c0, enc_c1;
  int c0[4], c1[4];
  float color_line[] = {0.0f, 0.0f, 0.0f, 0.0f};
  float vec_len2 = 0.0f, dot_offset = 0.0f;
  int swizzle4[] = {0, 2, 3, 1};
  LSE_master_colors_max_min(&enc_c0, &enc_c1, channels, uncompressed);
  compressed[0] = (enc_c0 >> 0) & 255;
  compressed[1] = (enc_c0 >> 8) & 255;
  compressed[2] = (enc_c1 >> 0) & 255;
  compressed[3] = (enc_c1 >> 8) & 255;
  compressed[4] = 0;
  compressed[5] = 0;
  compressed[6] = 0;
  compressed[7] = 0;
  rgb_888_from_565(enc_c0, &c0[0], &c0[1], &c0[2]);
  rgb_888_from_565(enc_c1, &c1[0], &c1[1], &c1[2]);
  vec_len2 = 0.0f;
  for (i = 0; i < 3; ++i) {
    color_line[i] = (float)(c1[i] - c0[i]);
    vec_len2 += color_line[i] * color_line[i];
  }
  if (vec_len2 > 0.0f) {
    vec_len2 = 1.0f / vec_len2;
  }
  color_line[0] *= vec_len2;
  color_line[1] *= vec_len2;
  color_line[2] *= vec_len2;
  dot_offset = color_line[0] * c0[0] + color_line[1] * c0[1] + color_line[2] * c0[2];
  next_bit = 8 * 4;
  for (i = 0; i < 16; ++i) {
    int next_value = 0;
    float dot_product = color_line[0] * uncompressed[i * channels + 0] + color_line[1] * uncompressed[i * channels + 1] + color_line[2] * uncompressed[i * channels + 2] - dot_offset;
    next_value = (int)(dot_product * 3.0f + 0.5f);
    if (next_value > 3) {
      next_value = 3;
    } else if (next_value < 0) {
      next_value = 0;
    }
    compressed[next_bit >> 3] |= swizzle4[next_value] << (next_bit & 7);
    next_bit += 2;
  }
}
```