user: What is the c source code of the assembly code below?

```asm
<DecompressBlockDXT1Internal>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x58,%rsp
  mov    (%rdi),%ecx
  mov    0x10(%rdi),%ebp
  mov    %rsi,0x10(%rsp)
  mov    %ecx,%eax
  mov    %edx,0x1c(%rsp)
  mov    0x8(%rdi),%edx
  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
  mov    %ecx,%esi
  sar    $0x5,%esi
  sar    $0x5,%eax
  and    $0x3f,%esi
  mov    %eax,0xc(%rsp)
  mov    %eax,%r11d
  mov    %esi,%eax
  shl    $0x8,%eax
  sub    %esi,%eax
  add    $0x20,%eax
  mov    %eax,%esi
  sar    $0x6,%esi
  add    %esi,%eax
  mov    %ecx,%esi
  sar    $0x6,%eax
  and    $0x1f,%esi
  mov    %eax,(%rsp)
  mov    %eax,%r9d
  mov    %esi,%eax
  shl    $0x8,%eax
  sub    %esi,%eax
  add    $0x10,%eax
  mov    %eax,%esi
  sar    $0x5,%esi
  add    %esi,%eax
  sar    $0x5,%eax
  mov    %eax,0x4(%rsp)
  mov    %eax,%r14d
  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
  mov    %edx,%esi
  sar    $0x5,%esi
  sar    $0x5,%eax
  and    $0x3f,%esi
  mov    %eax,0x18(%rsp)
  mov    %eax,%r10d
  mov    %esi,%eax
  shl    $0x8,%eax
  sub    %esi,%eax
  add    $0x20,%eax
  mov    %eax,%esi
  sar    $0x6,%esi
  add    %esi,%eax
  mov    %edx,%esi
  sar    $0x6,%eax
  and    $0x1f,%esi
  mov    %eax,0x8(%rsp)
  mov    %eax,%r8d
  mov    %esi,%eax
  shl    $0x8,%eax
  sub    %esi,%eax
  add    $0x10,%eax
  mov    %eax,%r12d
  sar    $0x5,%r12d
  add    %eax,%r12d
  sar    $0x5,%r12d
  cmp    %edx,%ecx
  jg     L132
  lea    (%r12,%r14,1),%eax
  mov    %r10d,%edx
  mov    %r12d,0x38(%rsp)
  xor    %r14d,%r14d
  sar    %eax
  add    %r11d,%edx
  movl   $0x0,0x30(%rsp)
  mov    %eax,0x20(%rsp)
  mov    %r9d,%eax
  add    %r8d,%eax
  sar    %eax
  mov    %eax,0x28(%rsp)
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x34(%rsp)
L111:
  movslq 0x30(%rsp),%rax
  mov    0x10(%rsp),%rdx
  lea    (%r14,%r14,1),%r15d
  xor    %r12d,%r12d
  lea    (%rdx,%rax,4),%r13
L29:
  mov    %r15d,%ecx
  mov    %ebp,%eax
  mov    (%rbx,%r12,1),%r8d
  sar    %cl,%eax
  and    $0x3,%eax
  mov    %r8d,%ecx
  cmp    $0x2,%eax
  je     L89
  cmp    $0x3,%eax
  je     L102
  cmp    $0x1,%eax
  je     L122
  mov    0x4(%rsp),%edx
  mov    (%rsp),%esi
  mov    0xc(%rsp),%edi
  call   <PackRGBA@plt>
L157:
  mov    %eax,0x0(%r13,%r12,1)
  add    $0x4,%r12
  add    $0x2,%r15d
  cmp    $0x10,%r12
  jne    L29
  add    $0x4,%r14d
  mov    0x1c(%rsp),%edi
  add    $0x10,%rbx
  add    %edi,0x30(%rsp)
  cmp    $0x10,%r14d
  jne    L111
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L122:
  mov    0x38(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    0x18(%rsp),%edi
  call   <PackRGBA@plt>
  jmp    L157
  nopl   0x0(%rax,%rax,1)
L102:
  xor    %edx,%edx
  xor    %esi,%esi
  xor    %edi,%edi
  call   <PackRGBA@plt>
  jmp    L157
  nopl   (%rax)
L89:
  mov    0x20(%rsp),%edx
  mov    0x28(%rsp),%esi
  mov    0x34(%rsp),%edi
  call   <PackRGBA@plt>
  jmp    L157
  nopl   0x0(%rax,%rax,1)
L132:
  mov    $0xaaaaaaab,%edx
  lea    (%r12,%r14,2),%eax
  lea    (%r10,%r11,2),%ecx
  movl   $0x0,0x30(%rsp)
  imul   %rdx,%rax
  mov    %r12d,0x4c(%rsp)
  shr    $0x21,%rax
  mov    %rax,0x20(%rsp)
  lea    (%r8,%r9,2),%eax
  imul   %rdx,%rax
  shr    $0x21,%rax
  mov    %rax,0x28(%rsp)
  movslq %ecx,%rax
  sar    $0x1f,%ecx
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  sub    %ecx,%eax
  mov    %eax,0x34(%rsp)
  lea    (%r14,%r12,2),%eax
  xor    %r14d,%r14d
  imul   %rdx,%rax
  shr    $0x21,%rax
  mov    %rax,0x38(%rsp)
  lea    (%r9,%r8,2),%eax
  imul   %rdx,%rax
  lea    (%r11,%r10,2),%edx
  shr    $0x21,%rax
  mov    %rax,0x40(%rsp)
  movslq %edx,%rax
  sar    $0x1f,%edx
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  sub    %edx,%eax
  mov    %eax,0x48(%rsp)
L4:
  movslq 0x30(%rsp),%rax
  mov    0x10(%rsp),%rdi
  lea    (%r14,%r14,1),%r15d
  xor    %r12d,%r12d
  lea    (%rdi,%rax,4),%r13
L62:
  mov    %r15d,%ecx
  mov    %ebp,%eax
  mov    (%rbx,%r12,1),%r8d
  sar    %cl,%eax
  and    $0x3,%eax
  mov    %r8d,%ecx
  cmp    $0x2,%eax
  je     L154
  cmp    $0x3,%eax
  je     L115
  cmp    $0x1,%eax
  je     L75
  mov    0x4(%rsp),%edx
  mov    (%rsp),%esi
  mov    0xc(%rsp),%edi
  call   <PackRGBA@plt>
L44:
  mov    %eax,0x0(%r13,%r12,1)
  add    $0x4,%r12
  add    $0x2,%r15d
  cmp    $0x10,%r12
  jne    L62
  add    $0x4,%r14d
  mov    0x1c(%rsp),%edi
  add    $0x10,%rbx
  add    %edi,0x30(%rsp)
  cmp    $0x10,%r14d
  jne    L4
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L75:
  mov    0x4c(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    0x18(%rsp),%edi
  call   <PackRGBA@plt>
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L115:
  mov    0x38(%rsp),%edx
  mov    0x40(%rsp),%esi
  mov    0x48(%rsp),%edi
  call   <PackRGBA@plt>
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L154:
  mov    0x20(%rsp),%edx
  mov    0x28(%rsp),%esi
  mov    0x34(%rsp),%edi
  call   <PackRGBA@plt>
  jmp    L44
```

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;
      }
    }
  }
}
```