user: Converte this assembly snippet into its equivalent C code:

```asm
<my_cmd_demo>:
  endbr64
  push   %rbp
  lea    D28(%rip),%rcx
  mov    %edi,%ebp
  push   %rbx
  movq   %rcx,%xmm0
  mov    %rsi,%rbx
  lea    D61(%rip),%rsi
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  lea    D72(%rip),%rax
  mov    %rsp,%rdx
  movq   $0x0,0x10(%rsp)
  movq   %rax,%xmm1
  punpcklqdq %xmm1,%xmm0
  movaps %xmm0,(%rsp)
  call   <check_cmd@plt>
  test   %rax,%rax
  jne    L52
  mov    (%rbx),%rsi
  lea    D71(%rip),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L37
  mov    (%rbx),%rsi
  lea    D78(%rip),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L3
  lea    D36(%rip),%rcx
  mov    $0x2,%edx
  mov    $0x2,%esi
  mov    %ebp,%edi
  call   <check_argc@plt>
  test   %rax,%rax
  jne    L52
  mov    0x8(%rbx),%rdi
  call   <extract_val@plt>
  mov    %rax,%rdi
  lea    -0x1(%rax),%rax
  cmp    $0x2,%rax
  ja     L50
  call   <set_demo@plt>
  xor    %eax,%eax
  call   <get_demo@plt>
  lea    D40(%rip),%rdi
  mov    %eax,%esi
  call   <printf@plt>
  xor    %eax,%eax
L24:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L68
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L37:
  lea    D76(%rip),%rcx
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %ebp,%edi
  call   <check_argc@plt>
  test   %rax,%rax
  jne    L52
  call   <get_demo@plt>
  lea    D63(%rip),%rdi
  mov    %eax,%esi
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L24
L3:
  mov    (%rbx),%rdi
  call   <print_unknown_cmd@plt>
  nopl   0x0(%rax)
L52:
  mov    $0xffffffff,%eax
  jmp    L24
L50:
  mov    0x8(%rbx),%rdi
  call   <print_unknown_arg@plt>
  mov    $0xffffffff,%eax
  jmp    L24
L68:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D28
type: string
name: extract_symbolic_data
arguments: data_label: D61
type: string
name: extract_symbolic_data
arguments: data_label: D72
type: string
name: extract_symbolic_data
arguments: data_label: D71
type: string
name: extract_symbolic_data
arguments: data_label: D78
type: string
name: extract_symbolic_data
arguments: data_label: D36
type: string
name: extract_symbolic_data
arguments: data_label: D40
type: string
name: extract_symbolic_data
arguments: data_label: D76
type: string
name: extract_symbolic_data
arguments: data_label: D63
type: string

tool: D28: set   load demo (1 | 2 | 3)

tool: D61: demo

tool: D72: get   print current demo configuration

tool: D71: get

tool: D78: set

tool: D36: demo set ID

tool: D40: selecting demo %d


tool: 

tool: D63: demo configuration %d


assistant: ```c
int my_cmd_demo(int argc, char **argv) {
  char *usage[] = {"set   load demo (1 | 2 | 3)", "get   print current demo configuration", 0};
  if (check_cmd(argc, "demo", usage))
    return -1;
  if (strcmp("get", argv[0]) == 0) {
    if (check_argc(argc, 1, 1, ""))
      return -1;
    printf("demo configuration %d\n", get_demo());
  } else if (strcmp("set", argv[0]) == 0) {
    if (check_argc(argc, 2, 2, "demo set ID"))
      return -1;
    unsigned long val = extract_val(argv[1]);
    if ((val < 1) || (val > 3)) {
      print_unknown_arg(argv[1]);
      return -1;
    }
    set_demo(val);
    printf("selecting demo %d\n", get_demo());
  } else {
    print_unknown_cmd(argv[0]);
    return -1;
  }
  return 0;
}
```