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

```asm
<compress_DDS_color_block>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x60,%rsp
  mov    %edi,%r12d
  mov    %rsi,%rbp
  mov    %rdx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x30(%rsp)
  movl   $0x0,0x34(%rsp)
  movl   $0x0,0x38(%rsp)
  movl   $0x0,0x40(%rsp)
  movl   $0x2,0x44(%rsp)
  movl   $0x3,0x48(%rsp)
  movl   $0x1,0x4c(%rsp)
  lea    0xc(%rsp),%rsi
  lea    0x8(%rsp),%rdi
  mov    %rbp,%rcx
  mov    %r12d,%edx
  call   <LSE_master_colors_max_min@plt>
  mov    0x8(%rsp),%edi
  mov    %dil,(%rbx)
  mov    %edi,%eax
  movzbl %ah,%eax
  mov    %al,0x1(%rbx)
  mov    0xc(%rsp),%eax
  mov    %al,0x2(%rbx)
  movzbl %ah,%eax
  mov    %al,0x3(%rbx)
  movb   $0x0,0x4(%rbx)
  movb   $0x0,0x5(%rbx)
  movb   $0x0,0x6(%rbx)
  movb   $0x0,0x7(%rbx)
  lea    0x10(%rsp),%rsi
  lea    0x18(%rsp),%rcx
  lea    0x14(%rsp),%rdx
  call   <rgb_888_from_565@plt>
  lea    0x20(%rsp),%rsi
  lea    0x28(%rsp),%rcx
  lea    0x24(%rsp),%rdx
  mov    0xc(%rsp),%edi
  call   <rgb_888_from_565@plt>
  mov    $0x0,%eax
  pxor   %xmm2,%xmm2
  lea    0x10(%rsp),%rcx
L30:
  mov    0x20(%rsp,%rax,1),%edx
  sub    (%rax,%rcx,1),%edx
  pxor   %xmm0,%xmm0
  cvtsi2ss %edx,%xmm0
  movss  %xmm0,0x30(%rsp,%rax,1)
  mulss  %xmm0,%xmm0
  addss  %xmm0,%xmm2
  add    $0x4,%rax
  cmp    $0xc,%rax
  jne    L30
  comiss D10(%rip),%xmm2
  jbe    L35
  movss  D26(%rip),%xmm0
  divss  %xmm2,%xmm0
  movaps %xmm0,%xmm2
L35:
  movaps %xmm2,%xmm5
  mulss  0x30(%rsp),%xmm5
  movaps %xmm2,%xmm4
  mulss  0x34(%rsp),%xmm4
  mulss  0x38(%rsp),%xmm2
  pxor   %xmm3,%xmm3
  cvtsi2ssl 0x10(%rsp),%xmm3
  mulss  %xmm5,%xmm3
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0x14(%rsp),%xmm0
  mulss  %xmm4,%xmm0
  addss  %xmm0,%xmm3
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0x18(%rsp),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm0,%xmm3
  movslq %r12d,%r8
  mov    %rbp,%rdx
  mov    $0x20,%esi
  movss  D25(%rip),%xmm7
  movss  D6(%rip),%xmm6
L21:
  mov    %esi,%edi
  sar    $0x3,%edi
  movslq %edi,%rdi
  movzbl (%rdx),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  %xmm5,%xmm0
  movzbl 0x1(%rdx),%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  mulss  %xmm4,%xmm1
  addss  %xmm1,%xmm0
  movzbl 0x2(%rdx),%eax
  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
  mov    $0x0,%ecx
  cmovs  %ecx,%eax
  mov    $0x3,%ecx
  cmp    %ecx,%eax
  cmovg  %ecx,%eax
  cltq
  mov    %esi,%ecx
  and    $0x7,%ecx
  mov    0x40(%rsp,%rax,4),%eax
  shl    %cl,%eax
  or     %al,(%rbx,%rdi,1)
  add    $0x2,%esi
  add    %r8,%rdx
  cmp    $0x40,%esi
  jne    L21
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L28
  add    $0x60,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L28:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D10
data_type: f32
name: disassemble_data
arguments: data_label: D26
data_type: f32
name: disassemble_data
arguments: data_label: D25
data_type: byte[4]
name: disassemble_data
arguments: data_label: D6
data_type: byte[4]

tool: D10: 0

tool: D26: 1

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

tool: {"D6": [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;
  }
}
```