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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xd8,%rsp
  mov    %edi,%r14d
  mov    %rsi,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  movq   $0x0,0xc0(%rsp)
  call   <init_pt6312@plt>
  lea    D101(%rip),%rdi
  call   <printf@plt>
  lea    D58(%rip),%rbp
  lea    D65(%rip),%rbx
  lea    D87(%rip),%r13
  lea    D115(%rip),%r12
  cmp    $0x2,%r14d
  jne    L114
  mov    0x8(%r15),%rbx
  lea    D30(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L6
  lea    D61(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L103
  lea    D111(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L8
  lea    D4(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L117
L8:
  lea    D12(%rip),%rdi
  call   <printf@plt>
  jmp    L117
L6:
  lea    0x10(%rsp),%rbx
  mov    $0x16,%edx
  mov    $0xff,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    $0x16,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <updateDisplay@plt>
L117:
  mov    $0x0,%eax
  call   <close_pt6312@plt>
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L118
  mov    $0x0,%eax
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L103:
  lea    0x10(%rsp),%rbx
  mov    $0x16,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    $0x16,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <updateDisplay@plt>
  jmp    L117
L85:
  lea    0xc0(%rsp),%rdi
  call   <atoi@plt>
  mov    %eax,0xc(%rsp)
L89:
  mov    0xc(%rsp),%edx
  mov    0x8(%rsp),%eax
  add    %eax,%eax
  lea    0x1(%rax),%ecx
  movslq %ecx,%rcx
  movzbl %dh,%esi
  movslq %esi,%rsi
  mov    %rsi,0x10(%rsp,%rcx,8)
  cltq
  movzbl %dl,%edx
  mov    %rdx,0x10(%rsp,%rax,8)
  lea    0x10(%rsp),%rdi
  mov    $0x16,%edx
  mov    $0x0,%esi
  call   <updateDisplay@plt>
L114:
  lea    0x10(%rsp),%rdi
  mov    $0x16,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    %rbp,%rdi
  call   <printf@plt>
  lea    0x8(%rsp),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  cmp    $0x16,%eax
  ja     L114
  test   %eax,%eax
  je     L117
  sub    $0x1,%eax
  mov    %eax,0x8(%rsp)
  mov    %r13,%rdi
  call   <printf@plt>
  lea    0xc0(%rsp),%r14
  mov    %r14,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    $0x2,%edx
  lea    D96(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L85
  lea    0xc(%rsp),%rdx
  lea    0xc2(%rsp),%rdi
  lea    D79(%rip),%rsi
  call   <sscanf@plt>
  jmp    L89
L118:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D101
datatype: string
name: disassemble_data
arguments: data_label: D58
datatype: string
name: disassemble_data
arguments: data_label: D65
datatype: string
name: disassemble_data
arguments: data_label: D87
datatype: string
name: disassemble_data
arguments: data_label: D115
datatype: string
name: disassemble_data
arguments: data_label: D30
datatype: string
name: disassemble_data
arguments: data_label: D61
datatype: string
name: disassemble_data
arguments: data_label: D111
datatype: string
name: disassemble_data
arguments: data_label: D4
datatype: string
name: disassemble_data
arguments: data_label: D12
datatype: string
name: disassemble_data
arguments: data_label: D96
datatype: string
name: disassemble_data
arguments: data_label: D79
datatype: string

tool: D101: === DISPLAY TEST ===



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

tool: D65: %d

tool: D87: Value (16bit) ? 

tool: D115: %6s

tool: D30: --all-grids

tool: D61: --clear

tool: D111: --help

tool: D4: -h

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

   No parameters: test individual grids interactively



tool: D96: 0x

tool: D79: %X

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