user: What would the C source look like for the assembly code provided here?

```asm
<pack_dxt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x100,%rsp
  mov    %rdi,-0xf8(%rbp)
  mov    %rsi,-0x100(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xd8(%rbp)
  movl   $0x0,-0xe8(%rbp)
  jmp    L47
L148:
  mov    -0xe8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  and    $0xf8fcf8,%eax
  mov    %rax,-0xd0(%rbp)
  movl   $0x0,-0xe4(%rbp)
  jmp    L120
L140:
  mov    -0xe4(%rbp),%eax
  cltq
  mov    -0x90(%rbp,%rax,8),%rdx
  mov    -0xd0(%rbp),%rax
  cmp    %rax,%rdx
  je     L58
  addl   $0x1,-0xe4(%rbp)
L120:
  mov    -0xe4(%rbp),%eax
  cmp    -0xd8(%rbp),%eax
  jl     L140
  jmp    L36
L58:
  nop
L36:
  mov    -0xe4(%rbp),%eax
  cmp    -0xd8(%rbp),%eax
  jne    L88
  mov    -0xd8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xd8(%rbp)
  mov    -0xd0(%rbp),%rdx
  cltq
  mov    %rdx,-0x90(%rbp,%rax,8)
L88:
  addl   $0x1,-0xe8(%rbp)
L47:
  cmpl   $0xf,-0xe8(%rbp)
  jle    L148
  cmpl   $0x1,-0xd8(%rbp)
  jne    L37
  mov    -0x90(%rbp),%rax
  mov    %rax,-0xb8(%rbp)
  mov    -0x90(%rbp),%rax
  mov    %rax,-0xb0(%rbp)
  movl   $0x3e8,-0xdc(%rbp)
  movl   $0x3,-0xe0(%rbp)
  jmp    L113
L37:
  movl   $0x40000000,-0xdc(%rbp)
  movl   $0x0,-0xe8(%rbp)
  jmp    L2
L126:
  mov    -0xe8(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xe4(%rbp)
  jmp    L115
L118:
  mov    -0xe4(%rbp),%eax
  cltq
  mov    -0x90(%rbp,%rax,8),%rcx
  mov    -0xe8(%rbp),%eax
  cltq
  mov    -0x90(%rbp,%rax,8),%rdx
  lea    -0xc0(%rbp),%rsi
  mov    -0xf8(%rbp),%rax
  mov    %rsi,%r8
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <score_dxt@plt>
  mov    %eax,-0xd4(%rbp)
  mov    -0xd4(%rbp),%eax
  cmp    -0xdc(%rbp),%eax
  jge    L136
  mov    -0xe8(%rbp),%eax
  cltq
  mov    -0x90(%rbp,%rax,8),%rax
  mov    %rax,-0xb8(%rbp)
  mov    -0xe4(%rbp),%eax
  cltq
  mov    -0x90(%rbp,%rax,8),%rax
  mov    %rax,-0xb0(%rbp)
  movl   $0x2,-0xe0(%rbp)
  mov    -0xd4(%rbp),%eax
  mov    %eax,-0xdc(%rbp)
L136:
  mov    -0xe4(%rbp),%eax
  cltq
  mov    -0x90(%rbp,%rax,8),%rcx
  mov    -0xe8(%rbp),%eax
  cltq
  mov    -0x90(%rbp,%rax,8),%rdx
  lea    -0xc0(%rbp),%rsi
  mov    -0xf8(%rbp),%rax
  mov    %rsi,%r8
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <score_dxt@plt>
  mov    %eax,-0xd4(%rbp)
  mov    -0xd4(%rbp),%eax
  cmp    -0xdc(%rbp),%eax
  jge    L31
  mov    -0xe8(%rbp),%eax
  cltq
  mov    -0x90(%rbp,%rax,8),%rax
  mov    %rax,-0xb8(%rbp)
  mov    -0xe4(%rbp),%eax
  cltq
  mov    -0x90(%rbp,%rax,8),%rax
  mov    %rax,-0xb0(%rbp)
  movl   $0x3,-0xe0(%rbp)
  mov    -0xd4(%rbp),%eax
  mov    %eax,-0xdc(%rbp)
L31:
  addl   $0x1,-0xe4(%rbp)
L115:
  mov    -0xe4(%rbp),%eax
  cmp    -0xd8(%rbp),%eax
  jl     L118
  addl   $0x1,-0xe8(%rbp)
L2:
  mov    -0xd8(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0xe8(%rbp)
  jl     L126
L113:
  lea    -0xd0(%rbp),%rax
  mov    %rax,-0xa8(%rbp)
  lea    -0xc8(%rbp),%rax
  mov    %rax,-0xa0(%rbp)
  mov    -0xb8(%rbp),%rax
  mov    %rax,-0xd0(%rbp)
  mov    -0xb0(%rbp),%rax
  mov    %rax,-0xc8(%rbp)
  mov    -0x100(%rbp),%rax
  mov    %rax,-0x98(%rbp)
  mov    -0xa8(%rbp),%rax
  movzbl (%rax),%eax
  shr    $0x3,%al
  movzbl %al,%edx
  mov    -0xa8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  shr    $0x2,%al
  movzbl %al,%eax
  shl    $0x5,%eax
  add    %eax,%edx
  mov    -0xa8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  shr    $0x3,%al
  movzbl %al,%eax
  shl    $0xb,%eax
  add    %eax,%edx
  mov    -0x98(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0xa0(%rbp),%rax
  movzbl (%rax),%eax
  shr    $0x3,%al
  movzbl %al,%edx
  mov    -0xa0(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  shr    $0x2,%al
  movzbl %al,%eax
  shl    $0x5,%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0xa0(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  shr    $0x3,%al
  movzbl %al,%eax
  shl    $0xb,%eax
  mov    %eax,%edx
  mov    -0x98(%rbp),%rax
  add    $0x2,%rax
  add    %ecx,%edx
  mov    %dx,(%rax)
  mov    -0x98(%rbp),%rax
  movzwl (%rax),%edx
  mov    -0x98(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  cmp    %ax,%dx
  seta   %dl
  cmpl   $0x3,-0xe0(%rbp)
  sete   %al
  xor    %edx,%eax
  test   %al,%al
  je     L11
  mov    -0x98(%rbp),%rax
  movzwl (%rax),%eax
  mov    %ax,-0xea(%rbp)
  mov    -0x98(%rbp),%rax
  movzwl 0x2(%rax),%edx
  mov    -0x98(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x98(%rbp),%rax
  lea    0x2(%rax),%rdx
  movzwl -0xea(%rbp),%eax
  mov    %ax,(%rdx)
  mov    -0xc8(%rbp),%rax
  mov    %rax,-0xb8(%rbp)
  mov    -0xd0(%rbp),%rax
  mov    %rax,-0xb0(%rbp)
L11:
  mov    -0x100(%rbp),%rax
  lea    0x4(%rax),%rdi
  mov    -0xb0(%rbp),%rcx
  mov    -0xb8(%rbp),%rdx
  mov    -0xe0(%rbp),%esi
  mov    -0xf8(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <score_dxt@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L28
  call   <__stack_chk_fail@plt>
L28:
  leave
  ret
```

assistant: ```c
void pack_dxt(unsigned long *px, unsigned char *dest) {
  int i1, i2, best_ninter, err, best_err, ncolors;
  unsigned long uniq[16];
  unsigned long col1, col2, best_col1, best_col2, pack;
  unsigned char *c1, *c2;
  unsigned short *sptr, tmpshort;
  ncolors = 0;
  for (i1 = 0; i1 < 16; i1++) {
    col1 = px[i1] & 0xf8fcf8;
    for (i2 = 0; i2 < ncolors; i2++)
      if (uniq[i2] == col1)
        break;
    if (i2 == ncolors)
      uniq[ncolors++] = col1;
  }
  if (ncolors == 1) {
    best_col1 = uniq[0];
    best_col2 = uniq[0];
    best_err = 1000;
    best_ninter = 3;
  } else {
    best_err = (1 << 30);
    for (i1 = 0; i1 < ncolors - 1; i1++)
      for (i2 = i1 + 1; i2 < ncolors; i2++) {
        err = score_dxt(px, 2, uniq[i1], uniq[i2], &pack);
        if (err < best_err) {
          best_col1 = uniq[i1];
          best_col2 = uniq[i2];
          best_ninter = 2;
          best_err = err;
        }
        err = score_dxt(px, 3, uniq[i1], uniq[i2], &pack);
        if (err < best_err) {
          best_col1 = uniq[i1];
          best_col2 = uniq[i2];
          best_ninter = 3;
          best_err = err;
        }
      }
  }
  c1 = (unsigned char *)&col1;
  c2 = (unsigned char *)&col2;
  col1 = best_col1;
  col2 = best_col2;
  sptr = (unsigned short *)dest;
  sptr[0] = ((unsigned short)c1[0] >> 3) + (((unsigned short)c1[1] >> 2) << 5) + (((unsigned short)c1[2] >> 3) << 11);
  sptr[1] = ((unsigned short)c2[0] >> 3) + (((unsigned short)c2[1] >> 2) << 5) + (((unsigned short)c2[2] >> 3) << 11);
  if ((sptr[0] > sptr[1]) ^ (best_ninter == 3)) {
    tmpshort = sptr[0];
    sptr[0] = sptr[1];
    sptr[1] = tmpshort;
    best_col1 = col2;
    best_col2 = col1;
  }
  score_dxt(px, best_ninter, best_col1, best_col2, (unsigned long *)(dest + 4));
}
```