user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  cmp    $0x2,%edi
  jne    L3
  mov    0x8(%rsi),%rdi
  call   <XOpenDisplay@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L74
  lea    0x8(%rsp),%rdx
  lea    0x4(%rsp),%rsi
  mov    %rax,%rdi
  call   <XeviQueryVersion@plt>
  test   %eax,%eax
  je     L40
  mov    0x8(%rsp),%edx
  mov    0x4(%rsp),%esi
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x10(%rsp),%rcx
  xor    %edx,%edx
  xor    %esi,%esi
  lea    0xc(%rsp),%r8
  mov    %r13,%rdi
  call   <XeviGetVisualInfo@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L56
  xor    %ebp,%ebp
  xor    %ebx,%ebx
  lea    D31(%rip),%r12
  nopl   0x0(%rax,%rax,1)
L63:
  mov    0x10(%rsp),%rax
  mov    %ebx,%esi
  mov    %r12,%rdi
  add    $0x1,%ebx
  add    %rbp,%rax
  add    $0x28,%rbp
  mov    0x10(%rax),%ecx
  mov    0x20(%rax),%r9d
  mov    0x4(%rax),%r8d
  mov    0x8(%rax),%rdx
  push   %rcx
  mov    0x14(%rax),%ecx
  push   %rcx
  mov    0x18(%rax),%ecx
  push   %rcx
  mov    0x1c(%rax),%ecx
  push   %rcx
  mov    (%rax),%ecx
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x20,%rsp
  cmp    %ebx,0xc(%rsp)
  jg     L63
L56:
  mov    %r13,%rdi
  call   <XCloseDisplay@plt>
  xor    %eax,%eax
L14:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L85
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L3:
  mov    (%rsi),%rsi
  lea    D6(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  or     $0xffffffff,%eax
  jmp    L14
L40:
  lea    D18(%rip),%rdi
  call   <puts@plt>
  or     $0xffffffff,%eax
  jmp    L14
L74:
  mov    0x8(%rbx),%rsi
  lea    D27(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  or     $0xffffffff,%eax
  jmp    L14
L85:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D5
type_infered: string
name: extract_symbolic_data
arguments: tag: D31
type_infered: string
name: extract_symbolic_data
arguments: tag: D6
type_infered: string
name: extract_symbolic_data
arguments: tag: D18
type_infered: string
name: extract_symbolic_data
arguments: tag: D27
type_infered: string

tool: D5: EVI Extension version: %d.%d


tool: D31: %02d vid=0x%02lx screen=%d level=%d type=%u value=%u min=%u max=%u conflicts=%u


tool: D6: Usage: %s display


tool: D18: EVI extension not present

tool: D27: Cannot open display %s


assistant: ```c
int main(int argc, char **argv) {
  Display *display = NULL;
  int major_version, minor_version;
  ExtendedVisualInfo *evi;
  int count;
  int i;
  if (argc == 2) {
    if (!(display = XOpenDisplay(argv[1]))) {
      printf("Cannot open display %s\n", argv[1]);
      return -1;
    }
  } else {
    printf("Usage: %s display\n", argv[0]);
    return -1;
  }
  if (!display && !(display = XOpenDisplay(NULL))) {
    printf("Cannot open default display\n");
    return -1;
  }
  if (!XeviQueryVersion(display, &major_version, &minor_version)) {
    printf("EVI extension not present\n");
    return -1;
  }
  printf("EVI Extension version: %d.%d\n", major_version, minor_version);
  XeviGetVisualInfo(display, NULL, 0, &evi, &count);
  for (i = 0; i < count; i++) {
    printf("%02d vid=0x%02lx screen=%d level=%d type=%u value=%u"
           " min=%u max=%u conflicts=%u\n",
           i, (long unsigned)evi[i].core_visual_id, evi[i].screen, evi[i].level, evi[i].transparency_type, evi[i].transparency_value, evi[i].min_hw_colormaps, evi[i].max_hw_colormaps, evi[i].num_colormap_conflicts);
  }
  XCloseDisplay(display);
  return 0;
}
```