user: Translate the below assembly code into C programming language:

```asm
<get_fps>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x810,%rsp
  mov    %rdi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  lea    D7(%rip),%rdi
  call   <system@plt>
  lea    D23(%rip),%rcx
  test   %eax,%eax
  jne    L31
L66:
  lea    0x400(%rsp),%rbx
  mov    %r12,%r8
  lea    D32(%rip),%rdx
  mov    $0x400,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  lea    D80(%rip),%rsi
  mov    %rbx,%rdi
  call   <popen@plt>
  mov    %rax,%rbx
  mov    %rsp,%rbp
  mov    %rax,%rdx
  mov    $0x400,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  mov    $0xd,%edx
  lea    D44(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    D103(%rip),%rbp
  test   %eax,%eax
  je     L1
L25:
  mov    %rbx,%rdi
  call   <pclose@plt>
L12:
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  movq   %rbp,%xmm0
  add    $0x810,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L31:
  lea    D88(%rip),%rdi
  call   <system@plt>
  lea    D89(%rip),%rcx
  test   %eax,%eax
  je     L66
  lea    D56(%rip),%rdi
  call   <system@plt>
  mov    D103(%rip),%rbp
  test   %eax,%eax
  jne    L12
  lea    D90(%rip),%rcx
  jmp    L66
L1:
  lea    0xd(%rsp),%rdi
  mov    $0x0,%esi
  call   <strtod@plt>
  movq   %xmm0,%rbp
  jmp    L25
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D7
data_type: string
name: parse_data
arguments: data_label: D23
data_type: string
name: parse_data
arguments: data_label: D32
data_type: string
name: parse_data
arguments: data_label: D80
data_type: string
name: parse_data
arguments: data_label: D44
data_type: string
name: parse_data
arguments: data_label: D103
data_type: byte[8]
name: parse_data
arguments: data_label: D88
data_type: string
name: parse_data
arguments: data_label: D89
data_type: string
name: parse_data
arguments: data_label: D56
data_type: string
name: parse_data
arguments: data_label: D90
data_type: string

tool: D7: which mplayer2

tool: D23: mplayer2

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

tool: D80: r

tool: D44: ID_VIDEO_FPS=

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

tool: D88: which mplayer

tool: D89: mplayer

tool: D56: which mpv

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