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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0xd8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  movq   $0x0,0xc0(%rsp)
  call   <init_pt6312@plt>
  lea    D3(%rip),%rdi
  call   <printf@plt>
  cmp    $0x2,%ebx
  je     L25
  lea    0x10(%rsp),%rbx
  lea    D43(%rip),%r13
  lea    0x8(%rsp),%r12
  lea    D65(%rip),%rbp
  lea    D87(%rip),%r15
  nopw   0x0(%rax,%rax,1)
L47:
  mov    $0x16,%edx
  xor    %esi,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    %r13,%rdi
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  cmp    $0x16,%eax
  ja     L47
  test   %eax,%eax
  je     L80
  sub    $0x1,%eax
  mov    %r15,%rdi
  lea    0xc0(%rsp),%r14
  mov    %eax,0x8(%rsp)
  call   <printf@plt>
  mov    %r14,%rsi
  lea    D20(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    $0x2,%edx
  lea    D5(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L51
  lea    0xc(%rsp),%rdx
  lea    0xc2(%rsp),%rdi
  lea    D26(%rip),%rsi
  call   <sscanf@plt>
  mov    0xc(%rsp),%eax
L62:
  mov    0x8(%rsp),%ecx
  movzbl %ah,%esi
  movzbl %al,%eax
  mov    %rbx,%rdi
  movslq %esi,%rsi
  lea    (%rcx,%rcx,1),%edx
  lea    0x1(%rdx),%ecx
  movslq %edx,%rdx
  movslq %ecx,%rcx
  mov    %rsi,0x10(%rsp,%rcx,8)
  xor    %esi,%esi
  mov    %rax,0x10(%rsp,%rdx,8)
  mov    $0x16,%edx
  call   <updateDisplay@plt>
  jmp    L47
  nopl   0x0(%rax)
L51:
  mov    %r14,%rdi
  call   <atoi@plt>
  mov    %eax,0xc(%rsp)
  jmp    L62
L25:
  mov    0x8(%rbp),%rbp
  lea    D113(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L91
  lea    D34(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L55
  lea    0x10(%rsp),%rbp
  mov    $0x16,%edx
  xor    %esi,%esi
L92:
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    $0x16,%edx
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <updateDisplay@plt>
  nopw   0x0(%rax,%rax,1)
L80:
  xor    %eax,%eax
  call   <close_pt6312@plt>
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0xd8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L55:
  lea    D44(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L9
  lea    D60(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L80
L9:
  lea    D16(%rip),%rdi
  call   <printf@plt>
  jmp    L80
L91:
  lea    0x10(%rsp),%rbp
  mov    $0x16,%edx
  mov    $0xff,%esi
  jmp    L92
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D3
type: string
name: unpack_data
arguments: data_tag: D43
type: string
name: unpack_data
arguments: data_tag: D65
type: string
name: unpack_data
arguments: data_tag: D87
type: string
name: unpack_data
arguments: data_tag: D20
type: string
name: unpack_data
arguments: data_tag: D5
type: string
name: unpack_data
arguments: data_tag: D26
type: string
name: unpack_data
arguments: data_tag: D113
type: string
name: unpack_data
arguments: data_tag: D34
type: string
name: unpack_data
arguments: data_tag: D44
type: string
name: unpack_data
arguments: data_tag: D60
type: string
name: unpack_data
arguments: data_tag: D16
type: string

tool: D3: === DISPLAY TEST ===



tool: D43: Grid? [1-22, 0:end] 

tool: D65: %d

tool: D87: Value (16bit) ? 

tool: D20: %6s

tool: D5: 0x

tool: D26: %X

tool: D113: --all-grids

tool: D34: --clear

tool: D44: --help

tool: D60: -h

tool: D16: Usage:
   --all-grids: show all grids activated
   --clear: deactivate all grids
   --help: show this text

   No parameters: test individual grids interactively



assistant: ```c
int main(int argc, char *argv[]) {
  uint8_t data[22];
  int grid;
  char val[8] = {0};
  init_pt6312();
  printf("=== DISPLAY TEST ===\n\n");
  if (argc == 2) {
    if (!strcmp(argv[1], "--all-grids")) {
      memset(data, 255, 22);
      updateDisplay(data, 0, 22);
    } else if (!strcmp(argv[1], "--clear")) {
      memset(data, 0, 22);
      updateDisplay(data, 0, 22);
    } else if (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")) {
      printf("Usage:\n   --all-grids: show all grids activated\n"
             "   --clear: deactivate all grids\n"
             "   --help: show this text\n\n"
             "   No parameters: test individual grids interactively\n\n");
    }
  } else
    while (1) {
      memset(data, 0, 22);
      printf("Grid? [1-22, 0:end] ");
      scanf("%d", &grid);
      if (grid < 0 || grid > 22)
        continue;
      else if (!grid)
        break;
      grid--;
      printf("Value (16bit) ? ");
      scanf("%6s", &val);
      uint16_t num;
      if (!strncmp(val, "0x", 2))
        sscanf(&val[2], "%X", &num);
      else
        num = atoi(val);
      data[grid * 2 + 1] = (uint8_t)((num & 0xFF00) >> 8);
      data[grid * 2] = (uint8_t)(num & 0xFF);
      updateDisplay(data, 0, 22);
    }
  close_pt6312();
  return 0;
}
```