user: Converte this assembly snippet into its equivalent C code:

```asm
<mutex_attr_show>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <pthread_mutexattr_gettype@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  je     L30
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L56
L30:
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <mutex_type_str@plt>
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L56:
  lea    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <pthread_mutexattr_getprioceiling@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  je     L20
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D79(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L39
L20:
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L39:
  lea    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <pthread_mutexattr_getprotocol@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  je     L5
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L75
L5:
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <mutex_protocol_str@plt>
  mov    %rax,%rsi
  lea    D50(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L75:
  lea    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <pthread_mutexattr_getpshared@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  je     L35
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L3
L35:
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <mutex_pshared_str@plt>
  mov    %rax,%rsi
  lea    D69(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L3:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L34
  call   <__stack_chk_fail@plt>
L34:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D36
datatype: string
name: unpack_data
arguments: tag: D33
datatype: string
name: unpack_data
arguments: tag: D31
datatype: string
name: unpack_data
arguments: tag: D79
datatype: string
name: unpack_data
arguments: tag: D21
datatype: string
name: unpack_data
arguments: tag: D14
datatype: string
name: unpack_data
arguments: tag: D50
datatype: string
name: unpack_data
arguments: tag: D44
datatype: string
name: unpack_data
arguments: tag: D69
datatype: string

tool: D36: mutex attributes @ %10p:


tool: D33: ERROR %d returned from pthread_mutexattr_gettype


tool: D31: type=%s


tool: D79: ERROR %d returned from pthread_mutexattr_getprioceiling


tool: D21: prio_ceiling=%d


tool: D14: ERROR %d returned from pthread_mutexattr_getprotocol


tool: D50: protocol=%s


tool: D44: ERROR %d returned from pthread_mutexattr_getpshared


tool: D69: pshared=%s


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