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

```asm
<DecompressBlockDXT1Internal>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rsi,(%rsp)
  mov    %edx,0x8(%rsp)
  mov    %rcx,%rbp
  mov    (%rdi),%ecx
  mov    0x8(%rdi),%edx
  mov    %ecx,%eax
  sar    $0xb,%eax
  mov    %eax,%esi
  shl    $0x8,%esi
  sub    %eax,%esi
  lea    0x2f(%rsi),%eax
  add    $0x10,%esi
  cmovns %esi,%eax
  sar    $0x5,%eax
  add    %esi,%eax
  lea    0x1f(%rax),%esi
  cmovs  %esi,%eax
  sar    $0x5,%eax
  mov    %eax,%r9d
  mov    %eax,0xc(%rsp)
  mov    %ecx,%eax
  sar    $0x5,%eax
  and    $0x3f,%eax
  mov    %eax,%esi
  shl    $0x8,%esi
  sub    %eax,%esi
  lea    0x5f(%rsi),%eax
  add    $0x20,%esi
  cmovns %esi,%eax
  sar    $0x6,%eax
  add    %esi,%eax
  lea    0x3f(%rax),%esi
  cmovs  %esi,%eax
  sar    $0x6,%eax
  mov    %eax,%ebx
  mov    %eax,0x10(%rsp)
  mov    %ecx,%eax
  and    $0x1f,%eax
  mov    %eax,%esi
  shl    $0x8,%esi
  sub    %eax,%esi
  lea    0x2f(%rsi),%eax
  add    $0x10,%esi
  cmovns %esi,%eax
  sar    $0x5,%eax
  add    %esi,%eax
  lea    0x1f(%rax),%esi
  cmovs  %esi,%eax
  sar    $0x5,%eax
  mov    %eax,%r10d
  mov    %eax,0x14(%rsp)
  mov    %edx,%eax
  sar    $0xb,%eax
  mov    %eax,%esi
  shl    $0x8,%esi
  sub    %eax,%esi
  lea    0x2f(%rsi),%eax
  add    $0x10,%esi
  cmovns %esi,%eax
  sar    $0x5,%eax
  add    %esi,%eax
  lea    0x1f(%rax),%esi
  cmovs  %esi,%eax
  sar    $0x5,%eax
  mov    %eax,%r8d
  mov    %eax,0x18(%rsp)
  mov    %edx,%eax
  sar    $0x5,%eax
  and    $0x3f,%eax
  mov    %eax,%esi
  shl    $0x8,%esi
  sub    %eax,%esi
  lea    0x5f(%rsi),%eax
  add    $0x20,%esi
  cmovns %esi,%eax
  sar    $0x6,%eax
  add    %esi,%eax
  lea    0x3f(%rax),%esi
  cmovs  %esi,%eax
  sar    $0x6,%eax
  mov    %eax,%r11d
  mov    %eax,0x1c(%rsp)
  mov    %edx,%eax
  and    $0x1f,%eax
  mov    %eax,%esi
  shl    $0x8,%esi
  sub    %eax,%esi
  lea    0x2f(%rsi),%eax
  add    $0x10,%esi
  cmovns %esi,%eax
  sar    $0x5,%eax
  add    %esi,%eax
  lea    0x1f(%rax),%esi
  cmovs  %esi,%eax
  sar    $0x5,%eax
  mov    %eax,0x20(%rsp)
  mov    0x10(%rdi),%r13d
  cmp    %edx,%ecx
  jg     L27
  add    %r10d,%eax
  mov    %eax,%edx
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x28(%rsp)
  mov    %ebx,%edx
  add    %r11d,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x2c(%rsp)
  mov    %r8d,%edx
  add    %r9d,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x30(%rsp)
  mov    $0x0,%r15d
  movl   $0x0,0x24(%rsp)
  jmp    L125
L27:
  mov    0x14(%rsp),%edi
  mov    0x20(%rsp),%ecx
  lea    (%rdi,%rcx,2),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    %eax,0x34(%rsp)
  mov    0x10(%rsp),%ebx
  mov    0x1c(%rsp),%esi
  lea    (%rbx,%rsi,2),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    %eax,0x38(%rsp)
  mov    0xc(%rsp),%r8d
  mov    0x18(%rsp),%r9d
  lea    (%r8,%r9,2),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    %eax,0x3c(%rsp)
  lea    (%rcx,%rdi,2),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    %eax,0x28(%rsp)
  lea    (%rsi,%rbx,2),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    %eax,0x2c(%rsp)
  lea    (%r9,%r8,2),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    %eax,0x30(%rsp)
  mov    $0x0,%r15d
  movl   $0x0,0x24(%rsp)
  jmp    L86
L190:
  mov    $0x0,%eax
  jmp    L174
L99:
  mov    %edx,%ecx
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  mov    0xc(%rsp),%edi
  call   <PackRGBA@plt>
L174:
  mov    %eax,(%r14,%rbx,1)
  add    $0x2,%r12d
  add    $0x4,%rbx
  cmp    $0x10,%rbx
  je     L49
L96:
  mov    0x0(%rbp,%rbx,1),%edx
  mov    %r13d,%eax
  mov    %r12d,%ecx
  sar    %cl,%eax
  and    $0x3,%eax
  cmp    $0x2,%eax
  je     L160
  jg     L175
  test   %eax,%eax
  je     L99
  cmp    $0x1,%eax
  jne    L190
  mov    %edx,%ecx
  mov    0x20(%rsp),%edx
  mov    0x1c(%rsp),%esi
  mov    0x18(%rsp),%edi
  call   <PackRGBA@plt>
  jmp    L174
L160:
  mov    %edx,%ecx
  mov    0x28(%rsp),%edx
  mov    0x2c(%rsp),%esi
  mov    0x30(%rsp),%edi
  call   <PackRGBA@plt>
  jmp    L174
L175:
  mov    %edx,%ecx
  mov    0x34(%rsp),%edx
  mov    0x38(%rsp),%esi
  mov    0x3c(%rsp),%edi
  call   <PackRGBA@plt>
  jmp    L174
L49:
  mov    0x8(%rsp),%edi
  add    %edi,0x24(%rsp)
  add    $0x4,%r15d
  add    $0x10,%rbp
  cmp    $0x10,%r15d
  je     L54
L86:
  lea    (%r15,%r15,1),%r12d
  movslq 0x24(%rsp),%rax
  mov    (%rsp),%rdi
  lea    (%rdi,%rax,4),%r14
  mov    $0x0,%ebx
  jmp    L96
L30:
  mov    $0x0,%eax
  jmp    L227
L228:
  mov    %edx,%ecx
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  mov    0xc(%rsp),%edi
  call   <PackRGBA@plt>
L227:
  mov    %eax,(%r14,%rbx,1)
  add    $0x2,%r12d
  add    $0x4,%rbx
  cmp    $0x10,%rbx
  je     L109
L119:
  mov    0x0(%rbp,%rbx,1),%edx
  mov    %r13d,%eax
  mov    %r12d,%ecx
  sar    %cl,%eax
  and    $0x3,%eax
  cmp    $0x2,%eax
  je     L120
  jg     L93
  test   %eax,%eax
  je     L228
  cmp    $0x1,%eax
  jne    L30
  mov    %edx,%ecx
  mov    0x20(%rsp),%edx
  mov    0x1c(%rsp),%esi
  mov    0x18(%rsp),%edi
  call   <PackRGBA@plt>
  jmp    L227
L120:
  mov    %edx,%ecx
  mov    0x28(%rsp),%edx
  mov    0x2c(%rsp),%esi
  mov    0x30(%rsp),%edi
  call   <PackRGBA@plt>
  jmp    L227
L93:
  mov    %edx,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <PackRGBA@plt>
  jmp    L227
L109:
  mov    0x8(%rsp),%edi
  add    %edi,0x24(%rsp)
  add    $0x4,%r15d
  add    $0x10,%rbp
  cmp    $0x10,%r15d
  je     L54
L125:
  lea    (%r15,%r15,1),%r12d
  movslq 0x24(%rsp),%rax
  mov    (%rsp),%rdi
  lea    (%rdi,%rax,4),%r14
  mov    $0x0,%ebx
  jmp    L119
L54:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void DecompressBlockDXT1Internal(const uint8_t *block, uint32_t *output, uint32_t outputStride, const uint8_t *alphaValues) {
  uint32_t temp, code;
  uint16_t color0, color1;
  uint8_t r0, g0, b0, r1, g1, b1;
  int i, j;
  color0 = *(const uint16_t *)(block);
  color1 = *(const uint16_t *)(block + 2);
  temp = (color0 >> 11) * 255 + 16;
  r0 = (uint8_t)((temp / 32 + temp) / 32);
  temp = ((color0 & 0x07E0) >> 5) * 255 + 32;
  g0 = (uint8_t)((temp / 64 + temp) / 64);
  temp = (color0 & 0x001F) * 255 + 16;
  b0 = (uint8_t)((temp / 32 + temp) / 32);
  temp = (color1 >> 11) * 255 + 16;
  r1 = (uint8_t)((temp / 32 + temp) / 32);
  temp = ((color1 & 0x07E0) >> 5) * 255 + 32;
  g1 = (uint8_t)((temp / 64 + temp) / 64);
  temp = (color1 & 0x001F) * 255 + 16;
  b1 = (uint8_t)((temp / 32 + temp) / 32);
  code = *(const uint32_t *)(block + 4);
  if (color0 > color1) {
    for (j = 0; j < 4; ++j) {
      for (i = 0; i < 4; ++i) {
        uint32_t finalColor, positionCode;
        uint8_t alpha;
        alpha = alphaValues[j * 4 + i];
        finalColor = 0;
        positionCode = (code >> 2 * (4 * j + i)) & 0x03;
        switch (positionCode) {
        case 0:
          finalColor = PackRGBA(r0, g0, b0, alpha);
          break;
        case 1:
          finalColor = PackRGBA(r1, g1, b1, alpha);
          break;
        case 2:
          finalColor = PackRGBA((2 * r0 + r1) / 3, (2 * g0 + g1) / 3, (2 * b0 + b1) / 3, alpha);
          break;
        case 3:
          finalColor = PackRGBA((r0 + 2 * r1) / 3, (g0 + 2 * g1) / 3, (b0 + 2 * b1) / 3, alpha);
          break;
        }
        output[j * outputStride + i] = finalColor;
      }
    }
  } else {
    for (j = 0; j < 4; ++j) {
      for (i = 0; i < 4; ++i) {
        uint32_t finalColor, positionCode;
        uint8_t alpha;
        alpha = alphaValues[j * 4 + i];
        finalColor = 0;
        positionCode = (code >> 2 * (4 * j + i)) & 0x03;
        switch (positionCode) {
        case 0:
          finalColor = PackRGBA(r0, g0, b0, alpha);
          break;
        case 1:
          finalColor = PackRGBA(r1, g1, b1, alpha);
          break;
        case 2:
          finalColor = PackRGBA((r0 + r1) / 2, (g0 + g1) / 2, (b0 + b1) / 2, alpha);
          break;
        case 3:
          finalColor = PackRGBA(0, 0, 0, alpha);
          break;
        }
        output[j * outputStride + i] = finalColor;
      }
    }
  }
}
```