user: Demonstrate the C code that generates the assembly output below:

```asm
<get_fps>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  lea    D0(%rip),%rdi
  push   %rbp
  sub    $0x828,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x818(%rsp)
  xor    %eax,%eax
  call   <system@plt>
  lea    D75(%rip),%rcx
  test   %eax,%eax
  jne    L57
L31:
  lea    0x410(%rsp),%rbp
  mov    %r12,%r8
  mov    $0x400,%esi
  lea    D28(%rip),%rdx
  mov    %rbp,%rdi
  lea    0x10(%rsp),%r12
  call   <snprintf@plt>
  mov    %rbp,%rdi
  lea    D51(%rip),%rsi
  call   <popen@plt>
  mov    $0x400,%esi
  mov    %r12,%rdi
  mov    %rax,%rdx
  mov    %rax,%rbp
  call   <fgets@plt>
  mov    $0xd,%edx
  lea    D17(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  movsd  D40(%rip),%xmm0
  test   %eax,%eax
  je     L63
L4:
  mov    %rbp,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <pclose@plt>
  movsd  0x8(%rsp),%xmm0
L64:
  mov    0x818(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x828,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L57:
  lea    D22(%rip),%rdi
  call   <system@plt>
  lea    D81(%rip),%rcx
  test   %eax,%eax
  je     L31
  lea    D58(%rip),%rdi
  call   <system@plt>
  movsd  D40(%rip),%xmm0
  test   %eax,%eax
  jne    L64
  lea    D39(%rip),%rcx
  jmp    L31
  nop
L63:
  lea    0x1d(%rsp),%rdi
  xor    %esi,%esi
  call   <strtod@plt>
  jmp    L4
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D0
datatype: string
name: disassemble_data
arguments: label: D75
datatype: string
name: disassemble_data
arguments: label: D28
datatype: string
name: disassemble_data
arguments: label: D51
datatype: string
name: disassemble_data
arguments: label: D17
datatype: string
name: disassemble_data
arguments: label: D40
datatype: byte[8]
name: disassemble_data
arguments: label: D22
datatype: string
name: disassemble_data
arguments: label: D81
datatype: string
name: disassemble_data
arguments: label: D58
datatype: string
name: disassemble_data
arguments: label: D39
datatype: string

tool: D0: which mplayer2

tool: D75: mplayer2

tool: D28: LANGUAGE=en LANG=en %s "%s" -identify -frames 0 2>/dev/null | grep ID_VIDEO_FPS

tool: D51: r

tool: D17: ID_VIDEO_FPS=

tool: {"D40": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D22: which mplayer

tool: D81: mplayer

tool: D58: which mpv

tool: D39: mpv

assistant: ```c
double get_fps(const char *uri) {
  int rc;
  double ret = -1;
  const char *binary;
  char buffer[1024];
  char cmd[1024];
  ssize_t bytes;
  FILE *fp;
  rc = system("which "
              "mplayer2");
  if (rc == 0) {
    binary = "mplayer2";
    goto found_player;
  }
  rc = system("which "
              "mplayer");
  if (rc == 0) {
    binary = "mplayer";
    goto found_player;
  }
  rc = system("which "
              "mpv");
  if (rc == 0) {
    binary = "mpv";
    goto found_player;
  }
  goto exit;
found_player:
  snprintf(cmd, 1024, "LANGUAGE=en LANG=en %s \"%s\" -identify -frames 0 2>/dev/null | grep ID_VIDEO_FPS", binary, uri);
  fp = popen(cmd, "r");
  fgets(buffer, 1024, fp);
  if (!(strncmp(buffer, "ID_VIDEO_FPS=", 13))) {
    ret = strtod(buffer + 13, NULL);
  }
  pclose(fp);
exit:
  return ret;
}
```