user: 请从给定的汇编指令推导出C源代码：

```asm
<sg_get_sense_sat_pt_fixed_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  movl   $0x0,-0x4(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jle    L10
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  and    $0xf,%eax
  cmp    $0x1,%al
  je     L52
  mov    -0x20(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x28(%rbp),%rdx
  add    %rdx,%rcx
  lea    D3(%rip),%rdx
  mov    %eax,%esi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <my_snprintf@plt>
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
L52:
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  and    $0x40,%eax
  test   %al,%al
  je     L12
  mov    $0x2b,%r10d
  jmp    L26
L12:
  mov    $0x20,%r10d
L26:
  mov    -0x18(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x18(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%r9d
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%r8d
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x20(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    -0x4(%rbp),%esi
  movslq %esi,%rdi
  mov    -0x28(%rbp),%rsi
  add    %rsi,%rdi
  push   %r10
  push   %rcx
  mov    %edx,%ecx
  lea    D8(%rip),%rdx
  mov    %eax,%esi
  mov    $0x0,%eax
  call   <my_snprintf@plt>
  add    $0x10,%rsp
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  and    $0x20,%eax
  test   %al,%al
  je     L51
  mov    $0x2b,%r9d
  jmp    L8
L51:
  mov    $0x20,%r9d
L8:
  mov    -0x18(%rbp),%rax
  add    $0xb,%rax
  movzbl (%rax),%eax
  movzbl %al,%esi
  mov    -0x18(%rbp),%rax
  add    $0xa,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x18(%rbp),%rax
  add    $0x9,%rax
  movzbl (%rax),%eax
  movzbl %al,%r8d
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%r10d
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  shr    $0x7,%al
  movzbl %al,%edx
  mov    -0x20(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    -0x4(%rbp),%edi
  movslq %edi,%r11
  mov    -0x28(%rbp),%rdi
  add    %r11,%rdi
  sub    $0x8,%rsp
  push   %r9
  push   %rsi
  push   %rcx
  mov    %r8d,%r9d
  mov    %r10d,%r8d
  mov    %edx,%ecx
  lea    D5(%rip),%rdx
  mov    %eax,%esi
  mov    $0x0,%eax
  call   <my_snprintf@plt>
  add    $0x20,%rsp
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L17
L10:
  nop
L17:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D3
type_guessed: string
name: retrieve_data
arguments: tag: D8
type_guessed: string
name: retrieve_data
arguments: tag: D5
type_guessed: string

tool: D3:   >> expected Sense key: Recovered Error ??


tool: D8:   error=0x%x, status=0x%x, device=0x%x, sector_count(7:0)=0x%x%c


tool: D5:   extend=%d, log_index=0x%x, lba_high,mid,low(7:0)=0x%x,0x%x,0x%x%c


assistant: ```c
void sg_get_sense_sat_pt_fixed_str(const unsigned char *sp, int slen, int blen, char *b) {
  int n = 0;
  slen = slen;
  if (blen < 1)
    return;
  if (0x1 != (0xf & sp[2]))
    n += my_snprintf(b + n, blen - n,
                     "  >> expected Sense key: "
                     "Recovered Error ??\n");
  n += my_snprintf(b + n, blen - n,
                   "  error=0x%x, status=0x%x, "
                   "device=0x%x, sector_count(7:0)=0x%x%c\n",
                   sp[3], sp[4], sp[5], sp[6], ((0x40 & sp[8]) ? '+' : ' '));
  n += my_snprintf(b + n, blen - n,
                   "  extend=%d, log_index=0x%x, "
                   "lba_high,mid,low(7:0)=0x%x,0x%x,0x%x%c\n",
                   (!!(0x80 & sp[8])), (0xf & sp[8]), sp[9], sp[10], sp[11], ((0x20 & sp[8]) ? '+' : ' '));
}
```