user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<xrectsel>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rsi,0x20(%rsp)
  mov    %rdx,0x28(%rsp)
  mov    %rcx,0x30(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    $0x0,%edi
  call   <XOpenDisplay@plt>
  test   %rax,%rax
  je     L23
  mov    %rax,%rbx
  mov    %rax,%rdi
  call   <DefaultRootWindow@plt>
  mov    %eax,%r14d
  mov    %eax,0x14(%rsp)
  mov    D165(%rip),%rax
  mov    (%rax),%esi
  mov    %rbx,%rdi
  call   <XCreateFontCursor@plt>
  mov    %eax,%esi
  mov    %eax,0x3c(%rsp)
  mov    D99(%rip),%rax
  mov    (%rax),%r8d
  mov    D12(%rip),%rax
  mov    (%rax),%ecx
  mov    D92(%rip),%rax
  or     (%rax),%ecx
  mov    D88(%rip),%rax
  or     (%rax),%ecx
  sub    $0x8,%rsp
  mov    D39(%rip),%rax
  mov    (%rax),%eax
  push   %rax
  push   %rsi
  mov    D32(%rip),%rax
  mov    (%rax),%eax
  push   %rax
  mov    %r8d,%r9d
  mov    D23(%rip),%rax
  mov    (%rax),%edx
  mov    %r14d,%esi
  mov    %rbx,%rdi
  call   <XGrabPointer@plt>
  mov    D54(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x6c(%rsp)
  mov    D149(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x68(%rsp)
  movl   $0x1,0x64(%rsp)
  add    $0x20,%rsp
  lea    0x44(%rsp),%rcx
  mov    D63(%rip),%rax
  mov    (%rax),%edx
  mov    D3(%rip),%rax
  or     (%rax),%edx
  mov    D152(%rip),%rax
  or     (%rax),%edx
  mov    %r14d,%esi
  mov    %rbx,%rdi
  call   <XCreateGC@plt>
  mov    %eax,0x38(%rsp)
  movl   $0x0,0x10(%rsp)
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%r14d
  mov    $0x0,%r15d
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  movl   $0x0,0x8(%rsp)
  lea    0x50(%rsp),%r13
  jmp    L46
L55:
  mov    0x58(%rsp),%r12d
  mov    0x5c(%rsp),%ebp
  mov    %ebp,0x10(%rsp)
  mov    %r12d,0xc(%rsp)
  mov    $0x0,%r14d
  mov    $0x0,%r15d
  movl   $0x1,0x8(%rsp)
L46:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <XNextEvent@plt>
  mov    0x50(%rsp),%rax
  mov    D168(%rip),%rdx
  cmp    (%rdx),%rax
  je     L55
  mov    D130(%rip),%rdx
  cmp    (%rdx),%rax
  je     L10
  mov    D129(%rip),%rdx
  cmp    (%rdx),%rax
  jne    L46
  sub    $0x8,%rsp
  push   %r14
  mov    %r15d,%r9d
  mov    %ebp,%r8d
  mov    %r12d,%ecx
  mov    0x48(%rsp),%r13d
  mov    %r13d,%edx
  mov    0x24(%rsp),%esi
  mov    %rbx,%rdi
  call   <XDrawRectangle@plt>
  mov    %rbx,%rdi
  call   <XFlush@plt>
  mov    D39(%rip),%rax
  mov    (%rax),%esi
  mov    %rbx,%rdi
  call   <XUngrabPointer@plt>
  mov    0x4c(%rsp),%esi
  mov    %rbx,%rdi
  call   <XFreeCursor@plt>
  mov    %r13d,%esi
  mov    %rbx,%rdi
  call   <XFreeGC@plt>
  mov    $0x1,%esi
  mov    %rbx,%rdi
  call   <XSync@plt>
  mov    0x28(%rsp),%rax
  mov    %r12d,(%rax)
  mov    0x30(%rsp),%rax
  mov    %ebp,(%rax)
  mov    0x38(%rsp),%rax
  mov    %r15d,(%rax)
  mov    0x40(%rsp),%rax
  mov    %r14d,(%rax)
  mov    %rbx,%rdi
  call   <XCloseDisplay@plt>
  add    $0x10,%rsp
L23:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L72
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L10:
  cmpl   $0x0,0x8(%rsp)
  je     L46
  sub    $0x8,%rsp
  push   %r14
  mov    %r15d,%r9d
  mov    %ebp,%r8d
  mov    %r12d,%ecx
  mov    0x48(%rsp),%edx
  mov    0x24(%rsp),%esi
  mov    %rbx,%rdi
  call   <XDrawRectangle@plt>
  mov    0x68(%rsp),%r12d
  mov    0x6c(%rsp),%ebp
  add    $0x10,%rsp
  mov    0xc(%rsp),%eax
  mov    %eax,%r15d
  sub    %r12d,%r15d
  cmp    %r12d,%eax
  jge    L43
  mov    %r12d,%r15d
  sub    %eax,%r15d
  mov    %eax,%r12d
L43:
  mov    0x10(%rsp),%eax
  mov    %eax,%r14d
  sub    %ebp,%r14d
  cmp    %ebp,%eax
  jge    L2
  mov    %ebp,%r14d
  sub    %eax,%r14d
  mov    %eax,%ebp
L2:
  sub    $0x8,%rsp
  push   %r14
  mov    %r15d,%r9d
  mov    %ebp,%r8d
  mov    %r12d,%ecx
  mov    0x48(%rsp),%edx
  mov    0x24(%rsp),%esi
  mov    %rbx,%rdi
  call   <XDrawRectangle@plt>
  mov    %rbx,%rdi
  call   <XFlush@plt>
  add    $0x10,%rsp
  jmp    L46
L72:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void xrectsel(unsigned *x_sel, unsigned *y_sel, unsigned *w_sel, unsigned *h_sel) {
  Display *dpy = XOpenDisplay(NULL);
  if (!dpy)
    return;
  Window root = DefaultRootWindow(dpy);
  XEvent ev;
  GC sel_gc;
  XGCValues sel_gv;
  int btn_pressed = 0;
  int x = 0, y = 0;
  unsigned int width = 0, height = 0;
  int start_x = 0, start_y = 0;
  Cursor cursor;
  cursor = XCreateFontCursor(dpy, XC_crosshair);
  XGrabPointer(dpy, root, True, PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime);
  sel_gv.function = GXinvert;
  sel_gv.subwindow_mode = IncludeInferiors;
  sel_gv.line_width = 1;
  sel_gc = XCreateGC(dpy, root, GCFunction | GCSubwindowMode | GCLineWidth, &sel_gv);
  for (;;) {
    XNextEvent(dpy, &ev);
    if (ev.type == ButtonPress) {
      btn_pressed = 1;
      x = start_x = ev.xbutton.x_root;
      y = start_y = ev.xbutton.y_root;
      width = height = 0;
    } else if (ev.type == MotionNotify) {
      if (!btn_pressed)
        continue;
      XDrawRectangle(dpy, root, sel_gc, x, y, width, height);
      x = ev.xbutton.x_root;
      y = ev.xbutton.y_root;
      if (x > start_x) {
        width = x - start_x;
        x = start_x;
      } else {
        width = start_x - x;
      }
      if (y > start_y) {
        height = y - start_y;
        y = start_y;
      } else {
        height = start_y - y;
      }
      XDrawRectangle(dpy, root, sel_gc, x, y, width, height);
      XFlush(dpy);
    } else if (ev.type == ButtonRelease)
      break;
  }
  XDrawRectangle(dpy, root, sel_gc, x, y, width, height);
  XFlush(dpy);
  XUngrabPointer(dpy, CurrentTime);
  XFreeCursor(dpy, cursor);
  XFreeGC(dpy, sel_gc);
  XSync(dpy, 1);
  *x_sel = x;
  *y_sel = y;
  *w_sel = width;
  *h_sel = height;
  XCloseDisplay(dpy);
}
```