user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<mutex_attr_show>:
  endbr64
  push   %r12
  mov    %rdi,%rsi
  push   %rbp
  mov    %rdi,%rbp
  lea    D60(%rip),%rdi
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%r12
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <pthread_mutexattr_gettype@plt>
  test   %eax,%eax
  je     L89
  mov    %eax,%esi
  lea    D84(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L27:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <pthread_mutexattr_getprioceiling@plt>
  mov    %eax,%esi
  test   %eax,%eax
  je     L42
  lea    D77(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L66:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <pthread_mutexattr_getprotocol@plt>
  mov    %eax,%esi
  test   %eax,%eax
  je     L46
  lea    D1(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L22:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <pthread_mutexattr_getpshared@plt>
  mov    %eax,%esi
  test   %eax,%eax
  je     L75
  lea    D15(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L24:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L13
  add    $0x18,%rsp
  pop    %rbp
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L89:
  mov    0x4(%rsp),%edi
  call   <mutex_type_str@plt>
  lea    D31(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L27
  nop
L75:
  mov    0x4(%rsp),%edi
  call   <mutex_pshared_str@plt>
  lea    D67(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L24
  nopl   0x0(%rax)
L46:
  mov    0x4(%rsp),%edi
  call   <mutex_protocol_str@plt>
  lea    D48(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L22
  nop
L42:
  mov    0x4(%rsp),%esi
  lea    D20(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L66
L13:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D60
data_type: string
name: read_data
arguments: tag: D84
data_type: string
name: read_data
arguments: tag: D77
data_type: string
name: read_data
arguments: tag: D1
data_type: string
name: read_data
arguments: tag: D15
data_type: string
name: read_data
arguments: tag: D31
data_type: string
name: read_data
arguments: tag: D67
data_type: string
name: read_data
arguments: tag: D48
data_type: string
name: read_data
arguments: tag: D20
data_type: string

tool: D60: mutex attributes @ %10p:


tool: D84: ERROR %d returned from pthread_mutexattr_gettype


tool: D77: ERROR %d returned from pthread_mutexattr_getprioceiling


tool: D1: ERROR %d returned from pthread_mutexattr_getprotocol


tool: D15: ERROR %d returned from pthread_mutexattr_getpshared


tool: D31: type=%s


tool: D67: pshared=%s


tool: D48: protocol=%s


tool: D20: prio_ceiling=%d


assistant: ```c
void mutex_attr_show(const pthread_mutexattr_t *attr) {
  int rc;
  int val;
  printf("mutex attributes @ %10p:\n", attr);
  rc = pthread_mutexattr_gettype(attr, &val);
  if (rc != 0)
    printf("ERROR %d returned from pthread_mutexattr_gettype\n", rc);
  else
    printf("type=%s\n", mutex_type_str(val));
  rc = pthread_mutexattr_getprioceiling(attr, &val);
  if (rc != 0)
    printf("ERROR %d returned from pthread_mutexattr_getprioceiling\n", rc);
  else
    printf("prio_ceiling=%d\n", val);
  rc = pthread_mutexattr_getprotocol(attr, &val);
  if (rc != 0)
    printf("ERROR %d returned from pthread_mutexattr_getprotocol\n", rc);
  else
    printf("protocol=%s\n", mutex_protocol_str(val));
  rc = pthread_mutexattr_getpshared(attr, &val);
  if (rc != 0)
    printf("ERROR %d returned from pthread_mutexattr_getpshared\n", rc);
  else
    printf("pshared=%s\n", mutex_pshared_str(val));
}
```