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

```asm
<main>:
  endbr64
  push   %r13
  lea    D83(%rip),%rdi
  push   %r12
  lea    D94(%rip),%r12
  push   %rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <getenv@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L68
L56:
  mov    %rbp,%rdx
  mov    %r12,%rsi
  lea    D60(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <XOpenDisplay@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L28
L59:
  lea    0x4(%rsp),%r12
  lea    D109(%rip),%rsi
  mov    %rbp,%rdi
  mov    %r12,%r8
  mov    %r12,%rcx
  lea    D8(%rip),%r13
  mov    %r12,%rdx
  call   <XQueryExtension@plt>
  test   %eax,%eax
  je     L22
L25:
  mov    %r13,%rsi
  lea    D29(%rip),%r13
  xor    %eax,%eax
  mov    %r13,%rdi
  call   <printf@plt>
  mov    %r12,%r8
  mov    %r12,%rcx
  mov    %r12,%rdx
  lea    D100(%rip),%rsi
  mov    %rbp,%rdi
  call   <XQueryExtension@plt>
  lea    D64(%rip),%rsi
  test   %eax,%eax
  jne    L83
  lea    D112(%rip),%rdi
  call   <printf@plt>
L52:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L86
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L83:
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L52
L22:
  mov    %r13,%rsi
  lea    D88(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L25
L28:
  mov    %r12,%rsi
  lea    D82(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L59
L68:
  mov    %r12,%rsi
  lea    D90(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L56
L86:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D83
type: string
name: disassemble_data
arguments: label: D94
type: string
name: disassemble_data
arguments: label: D60
type: string
name: disassemble_data
arguments: label: D109
type: string
name: disassemble_data
arguments: label: D8
type: string
name: disassemble_data
arguments: label: D29
type: string
name: disassemble_data
arguments: label: D100
type: string
name: disassemble_data
arguments: label: D64
type: string
name: disassemble_data
arguments: label: D112
type: string
name: disassemble_data
arguments: label: D88
type: string
name: disassemble_data
arguments: label: D82
type: string
name: disassemble_data
arguments: label: D90
type: string

tool: D83: DISPLAY

tool: D94: X display

tool: D60: info:  %s:	%s


tool: D109: GLX

tool: D8: X Ext. "GLX"

tool: D29: info:  %s:	present


tool: D100: NV-GLX

tool: D64: X Ext. "NV-GLX"

tool: D112: info:  %s:	not present; OK for non-nVidia drivers


tool: D88: fatal: %s:	not present; see the Xorg log for details


tool: D82: fatal: %s:	failed to open connection


tool: D90: fatal: %s:	DISPLAY not set


assistant: ```c
int main(int argc, char *argv[]) {
  const char *msg1 = "X display";
  char *dpyname = getenv("DISPLAY");
  if (!dpyname)
    ({
      printf("fatal: %s:\t"
             "DISPLAY not set"
             "\n",
             msg1);
      exit(1);
    });
  printf("info:  %s:\t"
         "%s"
         "\n",
         msg1, dpyname);
  Display *dpy = XOpenDisplay(dpyname);
  if (!dpy)
    ({
      printf("fatal: %s:\t"
             "failed to open connection"
             "\n",
             msg1);
      exit(1);
    });
  msg1 = "X Ext. \"GLX\"";
  int dummy;
  if (!XQueryExtension(dpy, "GLX", &dummy, &dummy, &dummy))
    ({
      printf("fatal: %s:\t"
             "not present; see the Xorg log for details"
             "\n",
             msg1);
      exit(1);
    });
  printf("info:  %s:\t"
         "present"
         "\n",
         msg1);
  msg1 = "X Ext. \"NV-GLX\"";
  if (!XQueryExtension(dpy, "NV-GLX", &dummy, &dummy, &dummy))
    printf("info:  %s:\t"
           "not present; OK for non-nVidia drivers"
           "\n",
           msg1);
  else
    printf("info:  %s:\t"
           "present"
           "\n",
           msg1);
  return 0;
}
```