user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<tv_standard>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rdi
  call   <FS460_get_tv_standard@plt>
  test   %eax,%eax
  jne    L32
  lea    0x10(%rsp),%rdi
  call   <FS460_get_available_tv_standards@plt>
  test   %eax,%eax
  jne    L116
  cmpq   $0x0,0x10(%rsp)
  jne    L106
L89:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L96
  add    $0x20,%rsp
  pop    %rbx
  ret
L32:
  mov    %eax,%esi
  lea    D22(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L89
L116:
  mov    %eax,%esi
  lea    D69(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L89
L106:
  lea    D56(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L57
  mov    0x8(%rsp),%rax
  mov    0x10(%rsp),%rcx
L136:
  add    %rax,%rax
  mov    $0x1,%edx
  cmove  %rdx,%rax
  test   %rax,%rcx
  je     L136
  mov    %rax,0x8(%rsp)
L25:
  mov    0x8(%rsp),%rdi
  call   <FS460_set_tv_standard@plt>
  test   %eax,%eax
  je     L131
  mov    %eax,%esi
  lea    D8(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L89
L57:
  lea    D74(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L146
  mov    0x8(%rsp),%rax
  mov    0x10(%rsp),%rcx
  mov    $0x80000000,%edx
L28:
  shr    %rax
  cmove  %rdx,%rax
  test   %rax,%rcx
  je     L28
  mov    %rax,0x8(%rsp)
  jmp    L25
L146:
  lea    D26(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L25
  lea    D30(%rip),%rdi
  call   <puts@plt>
  jmp    L89
L131:
  lea    0x8(%rsp),%rdi
  call   <FS460_get_tv_standard@plt>
  test   %eax,%eax
  je     L86
  mov    %eax,%esi
  lea    D60(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L89
L86:
  mov    0x8(%rsp),%rdi
  call   <str_TVStandard@plt>
  mov    %rax,%rsi
  lea    D48(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L89
L96:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D22
type_infered: string
name: read_data
arguments: tag: D69
type_infered: string
name: read_data
arguments: tag: D56
type_infered: string
name: read_data
arguments: tag: D8
type_infered: string
name: read_data
arguments: tag: D74
type_infered: string
name: read_data
arguments: tag: D26
type_infered: string
name: read_data
arguments: tag: D30
type_infered: string
name: read_data
arguments: tag: D60
type_infered: string
name: read_data
arguments: tag: D48
type_infered: string

tool: D22: error %u getting tv standard.


tool: D69: error %u getting available tv standards.


tool: D56: +

tool: D8: error %u setting TV standard.


tool: D74: -

tool: 

tool: D30: Invalid command.

tool: D60: error %u getting TV standard after set.


tool: D48:   TV Standard=%s


assistant: ```c
void tv_standard(char *mod) {
  int err;
  unsigned long tv_standard, available_tv_standards;
  err = FS460_get_tv_standard(&tv_standard);
  if (err) {
    printf("error %u getting tv standard.\n", err);
    return;
  }
  err = FS460_get_available_tv_standards(&available_tv_standards);
  if (err) {
    printf("error %u getting available tv standards.\n", err);
    return;
  }
  if (available_tv_standards) {
    if (0 == strcmp(mod, "+")) {
      do {
        tv_standard <<= 1;
        if (!tv_standard)
          tv_standard = 1;
      } while (!(tv_standard & available_tv_standards));
    } else if (0 == strcmp(mod, "-")) {
      do {
        tv_standard >>= 1;
        if (!tv_standard)
          tv_standard = 0x80000000;
      } while (!(tv_standard & available_tv_standards));
    } else if (0 != strcmp(mod, "")) {
      printf("Invalid command.\n");
      return;
    }
    err = FS460_set_tv_standard(tv_standard);
    if (err)
      printf("error %u setting TV standard.\n", err);
    else {
      err = FS460_get_tv_standard(&tv_standard);
      if (err)
        printf("error %u getting TV standard after set.\n", err);
      else
        printf("  TV Standard=%s\n", str_TVStandard(tv_standard));
    }
  }
}
```