user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r13
  lea    D116(%rip),%rdi
  push   %r12
  lea    D56(%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     L81
L4:
  mov    %rbp,%rdx
  mov    %r12,%rsi
  lea    D36(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <XOpenDisplay@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L76
L59:
  lea    0x4(%rsp),%r12
  lea    D40(%rip),%rsi
  mov    %rbp,%rdi
  mov    %r12,%r8
  mov    %r12,%rcx
  lea    D107(%rip),%r13
  mov    %r12,%rdx
  call   <XQueryExtension@plt>
  test   %eax,%eax
  je     L66
L7:
  mov    %r13,%rsi
  lea    D102(%rip),%r13
  xor    %eax,%eax
  mov    %r13,%rdi
  call   <printf@plt>
  mov    %r12,%r8
  mov    %r12,%rcx
  mov    %r12,%rdx
  lea    D95(%rip),%rsi
  mov    %rbp,%rdi
  call   <XQueryExtension@plt>
  lea    D83(%rip),%rsi
  test   %eax,%eax
  jne    L23
  lea    D12(%rip),%rdi
  call   <printf@plt>
L14:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L83
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L23:
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L14
L66:
  mov    %r13,%rsi
  lea    D103(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L7
L76:
  mov    %r12,%rsi
  lea    D86(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L59
L81:
  mov    %r12,%rsi
  lea    D109(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L4
L83:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D116
data_type: string
name: extract_symbolic_data
arguments: data_tag: D56
data_type: string
name: extract_symbolic_data
arguments: data_tag: D36
data_type: string
name: extract_symbolic_data
arguments: data_tag: D40
data_type: string
name: extract_symbolic_data
arguments: data_tag: D107
data_type: string
name: extract_symbolic_data
arguments: data_tag: D102
data_type: string
name: extract_symbolic_data
arguments: data_tag: D95
data_type: string
name: extract_symbolic_data
arguments: data_tag: D83
data_type: string
name: extract_symbolic_data
arguments: data_tag: D12
data_type: string
name: extract_symbolic_data
arguments: data_tag: D103
data_type: string
name: extract_symbolic_data
arguments: data_tag: D86
data_type: string
name: extract_symbolic_data
arguments: data_tag: D109
data_type: string

tool: D116: DISPLAY

tool: D56: X display

tool: D36: info:  %s:	%s


tool: D40: GLX

tool: D107: X Ext. "GLX"

tool: D102: info:  %s:	present


tool: D95: NV-GLX

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

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


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


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


tool: D109: 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;
}
```