user: What would the C source look like for the assembly code provided here?

```asm
<tv_standard>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rbp
  mov    %rbp,%rdi
  call   <FS460_get_tv_standard@plt>
  test   %eax,%eax
  jne    L134
  lea    0x10(%rsp),%rdi
  call   <FS460_get_available_tv_standards@plt>
  test   %eax,%eax
  jne    L76
  cmpq   $0x0,0x10(%rsp)
  jne    L102
L44:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L243
  add    $0x28,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L134:
  mov    %eax,%esi
  lea    D24(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L44
  nopw   0x0(%rax,%rax,1)
L102:
  lea    D63(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L195
  mov    0x8(%rsp),%rdi
  mov    0x10(%rsp),%rax
  nopw   0x0(%rax,%rax,1)
L244:
  add    %rdi,%rdi
  je     L32
  test   %rdi,%rax
  je     L244
L95:
  mov    %rdi,0x8(%rsp)
L239:
  call   <FS460_set_tv_standard@plt>
  mov    %eax,%esi
  test   %eax,%eax
  je     L24
  lea    D69(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L44
  nopl   (%rax)
L32:
  mov    %rax,%rdi
  and    $0x1,%edi
  jne    L95
  mov    $0x1,%edi
  jmp    L244
  nopw   0x0(%rax,%rax,1)
L76:
  mov    %eax,%esi
  lea    D19(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L44
  nopl   (%rax)
L24:
  mov    %rbp,%rdi
  call   <FS460_get_tv_standard@plt>
  mov    %eax,%esi
  test   %eax,%eax
  je     L210
  lea    D31(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L44
  nopl   0x0(%rax)
L195:
  lea    D77(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L37
  mov    0x10(%rsp),%rax
  mov    0x8(%rsp),%rdi
  mov    %rax,%rdx
  and    $0x80000000,%edx
  nopw   0x0(%rax,%rax,1)
L150:
  shr    %rdi
  je     L189
L41:
  test   %rdi,%rax
  jne    L95
  shr    %rdi
  jne    L41
L189:
  mov    $0x80000000,%edi
  test   %rdx,%rdx
  je     L150
  jmp    L95
  nopw   0x0(%rax,%rax,1)
L210:
  mov    0x8(%rsp),%rdi
  call   <str_TVStandard@plt>
  lea    D17(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L37:
  lea    D53(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L203
  mov    0x8(%rsp),%rdi
  jmp    L239
L203:
  lea    D55(%rip),%rdi
  call   <puts@plt>
  jmp    L44
L243:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D24
type_infered: string
name: extract_symbolic_data
arguments: label: D63
type_infered: string
name: extract_symbolic_data
arguments: label: D69
type_infered: string
name: extract_symbolic_data
arguments: label: D19
type_infered: string
name: extract_symbolic_data
arguments: label: D31
type_infered: string
name: extract_symbolic_data
arguments: label: D77
type_infered: string
name: extract_symbolic_data
arguments: label: D17
type_infered: string
name: extract_symbolic_data
arguments: label: D53
type_infered: string
name: extract_symbolic_data
arguments: label: D55
type_infered: string

tool: D24: error %u getting tv standard.


tool: D63: +

tool: D69: error %u setting TV standard.


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


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


tool: D77: -

tool: D17:   TV Standard=%s


tool: 

tool: D55: Invalid command.

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));
    }
  }
}
```