user: Please show me the C implementation that matches the assembly code listed below:

```asm
<cta_audio_block>:
  endbr64
  mov    %esi,%eax
  mov    $0xaaaaaaab,%edx
  imul   %rdx,%rax
  shr    $0x21,%rax
  lea    (%rax,%rax,2),%eax
  cmp    %eax,%esi
  jne    L30
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %esi,%r12d
  test   %esi,%esi
  je     L6
  mov    $0x0,%ebx
  jmp    L64
L42:
  call   <audio_format@plt>
L77:
  add    $0x3,%rbx
  cmp    %ebx,%r12d
  jbe    L6
L64:
  movzbl 0x0(%rbp,%rbx,1),%edi
  sar    $0x3,%edi
  and    $0xf,%edi
  movzbl 0x2(%rbp,%rbx,1),%eax
  shr    $0x3,%al
  movzbl %al,%eax
  cmp    $0xf,%edi
  jne    L42
  cmp    $0xb,%eax
  je     L23
  cmp    $0xd,%eax
  je     L65
  mov    %eax,%edi
  call   <audio_ext_format@plt>
  jmp    L77
L23:
  mov    $0xb,%edi
  call   <audio_ext_format@plt>
  movzbl 0x0(%rbp,%rbx,1),%edi
  and    $0x7,%edi
  call   <mpeg_h_3d_audio_level@plt>
  jmp    L77
L65:
  mov    $0xd,%edi
  call   <audio_ext_format@plt>
  jmp    L77
L6:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L30:
  ret
```

assistant: ```c
void cta_audio_block(const unsigned char *x, unsigned int length) {
  int i, format, ext_format = 0;
  if (length % 3) {
    (void)("Broken CTA audio block length %d\n", length);
    return;
  }
  for (i = 0; i < length; i += 3) {
    format = (x[i] & 0x78) >> 3;
    ext_format = (x[i + 2] & 0xf8) >> 3;
    if (format != 15)
      (void)("    %s, max channels %d\n", audio_format(format), (x[i] & 0x07) + 1);
    else if (ext_format == 11)
      (void)("    %s, MPEG-H 3D Audio Level: %s\n", audio_ext_format(ext_format), mpeg_h_3d_audio_level(x[i] & 0x07));
    else if (ext_format == 13)
      (void)("    %s, max channels %d\n", audio_ext_format(ext_format), (((x[i + 1] & 0x80) >> 3) | ((x[i] & 0x80) >> 4) | (x[i] & 0x07)) + 1);
    else
      (void)("    %s, max channels %d\n", audio_ext_format(ext_format), (x[i] & 0x07) + 1);
    (void)("      Supported sample rates (kHz):%s%s%s%s%s%s%s\n", (x[i + 1] & 0x40) ? " 192" : "", (x[i + 1] & 0x20) ? " 176.4" : "", (x[i + 1] & 0x10) ? " 96" : "", (x[i + 1] & 0x08) ? " 88.2" : "", (x[i + 1] & 0x04) ? " 48" : "", (x[i + 1] & 0x02) ? " 44.1" : "", (x[i + 1] & 0x01) ? " 32" : "");
    if (format == 1 || ext_format == 13) {
      (void)("      Supported sample sizes (bits):%s%s%s\n", (x[i + 2] & 0x04) ? " 24" : "", (x[i + 2] & 0x02) ? " 20" : "", (x[i + 2] & 0x01) ? " 16" : "");
    } else if (format <= 8) {
      (void)("      Maximum bit rate: %d kb/s\n", x[i + 2] * 8);
    } else if (format == 14) {
      (void)("      Profile: %d\n", x[i + 2] & 7);
    } else if (ext_format == 11 && (x[i + 2] & 1)) {
      (void)("      Supports MPEG-H 3D Audio Low Complexity Profile\n");
    } else if ((ext_format >= 4 && ext_format <= 6) || ext_format == 8 || ext_format == 10) {
      (void)("      AAC audio frame lengths:%s%s\n", (x[i + 2] & 4) ? " 1024_TL" : "", (x[i + 2] & 2) ? " 960_TL" : "");
      if (ext_format >= 8 && (x[i + 2] & 1))
        (void)("      Supports %s signaled MPEG Surround data\n", (x[i + 2] & 1) ? "implicitly and explicitly" : "only implicitly");
      if (ext_format == 6 && (x[i + 2] & 1))
        (void)("      Supports 22.2ch System H\n");
    }
  }
}
```