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

```asm
<get_fps>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  lea    D54(%rip),%rdi
  push   %rbp
  sub    $0x828,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x818(%rsp)
  xor    %eax,%eax
  call   <system@plt>
  lea    D104(%rip),%rcx
  test   %eax,%eax
  jne    L51
L58:
  lea    0x410(%rsp),%rbp
  mov    %r12,%r8
  mov    $0x400,%esi
  lea    D96(%rip),%rdx
  mov    %rbp,%rdi
  lea    0x10(%rsp),%r12
  call   <snprintf@plt>
  mov    %rbp,%rdi
  lea    D22(%rip),%rsi
  call   <popen@plt>
  mov    $0x400,%esi
  mov    %r12,%rdi
  mov    %rax,%rdx
  mov    %rax,%rbp
  call   <fgets@plt>
  mov    $0xd,%edx
  lea    D59(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  movsd  D9(%rip),%xmm0
  test   %eax,%eax
  je     L57
L59:
  mov    %rbp,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <pclose@plt>
  movsd  0x8(%rsp),%xmm0
L34:
  mov    0x818(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L60
  add    $0x828,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L51:
  lea    D76(%rip),%rdi
  call   <system@plt>
  lea    D66(%rip),%rcx
  test   %eax,%eax
  je     L58
  lea    D58(%rip),%rdi
  call   <system@plt>
  movsd  D9(%rip),%xmm0
  test   %eax,%eax
  jne    L34
  lea    D103(%rip),%rcx
  jmp    L58
  nop
L57:
  lea    0x1d(%rsp),%rdi
  xor    %esi,%esi
  call   <strtod@plt>
  jmp    L59
L60:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D54
datatype: string
name: disassemble_data
arguments: label: D104
datatype: string
name: disassemble_data
arguments: label: D96
datatype: string
name: disassemble_data
arguments: label: D22
datatype: string
name: disassemble_data
arguments: label: D59
datatype: string
name: disassemble_data
arguments: label: D9
datatype: byte[8]
name: disassemble_data
arguments: label: D76
datatype: string
name: disassemble_data
arguments: label: D66
datatype: string
name: disassemble_data
arguments: label: D58
datatype: string
name: disassemble_data
arguments: label: D103
datatype: string

tool: D54: which mplayer2

tool: D104: mplayer2

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

tool: D22: r

tool: D59: ID_VIDEO_FPS=

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

tool: D76: which mplayer

tool: D66: mplayer

tool: D58: which mpv

tool: D103: 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;
}
```