user: Converte this assembly snippet into its equivalent C code:

```asm
<XDrawVString>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r13
  mov    %esi,%r12d
  mov    %edx,0x24(%rsp)
  mov    %ecx,0x28(%rsp)
  mov    %r8d,0x2c(%rsp)
  mov    %r9,%rbx
  mov    %r9,%rsi
  mov    0x78(%rsp),%rdi
  call   <FontTextWidth@plt>
  mov    %rax,%r14
  mov    %eax,%ebp
  mov    0x78(%rsp),%rdi
  call   <FontHeight@plt>
  mov    %rax,%r15
  mov    $0x1,%r8d
  mov    %eax,0x20(%rsp)
  mov    %eax,%ecx
  mov    %r14d,%edx
  mov    %r12d,0x14(%rsp)
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <XCreatePixmap@plt>
  mov    %eax,%r12d
  mov    $0x1,%r8d
  mov    %r14d,%ecx
  mov    0x20(%rsp),%edx
  mov    0x14(%rsp),%esi
  mov    %r13,%rdi
  call   <XCreatePixmap@plt>
  mov    %eax,0xc(%rsp)
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    %r12d,0x8(%rsp)
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <XCreateGC@plt>
  mov    %eax,%r12d
  mov    $0x0,%edx
  mov    %eax,%esi
  mov    %r13,%rdi
  call   <XSetBackground@plt>
  mov    0x78(%rsp),%rdi
  mov    (%rdi),%edx
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <XSetFont@plt>
  mov    $0x0,%edx
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <XSetForeground@plt>
  sub    $0x8,%rsp
  push   %r15
  mov    %r14d,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %r12d,%edx
  mov    0x18(%rsp),%esi
  mov    %r13,%rdi
  call   <XFillRectangle@plt>
  mov    %r14d,(%rsp)
  mov    %r15d,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %r12d,%edx
  mov    0x1c(%rsp),%esi
  mov    %r13,%rdi
  call   <XFillRectangle@plt>
  mov    $0x1,%edx
  mov    %r12d,0x20(%rsp)
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <XSetForeground@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%r12d
  mov    0x88(%rsp),%rdi
  call   <FontAscent@plt>
  mov    %r12d,(%rsp)
  mov    %rbx,%r9
  mov    %eax,%r8d
  mov    $0x0,%ecx
  mov    0x20(%rsp),%edx
  mov    0x18(%rsp),%esi
  mov    %r13,%rdi
  call   <XDrawImageString@plt>
  lea    0xe(%r14),%edi
  mov    %r14d,%eax
  add    $0x7,%eax
  cmovns %eax,%edi
  sar    $0x3,%edi
  imul   %r15d,%edi
  mov    $0x1,%esi
  call   <XtCalloc@plt>
  mov    %rax,0x28(%rsp)
  mov    D24(%rip),%r12
  mov    (%r12),%ebx
  mov    %r13,%rdi
  call   <DefaultScreen@plt>
  mov    %eax,%esi
  mov    %r13,%rdi
  call   <DefaultVisual@plt>
  mov    %eax,%esi
  push   $0x0
  push   $0x8
  push   %r15
  push   %r14
  mov    0x48(%rsp),%r9
  mov    $0x0,%r8d
  mov    %ebx,%ecx
  mov    $0x1,%edx
  mov    %r13,%rdi
  call   <XCreateImage@plt>
  mov    %rax,%rbx
  mov    D15(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,0x18(%rbx)
  mov    %rax,0x20(%rbx)
  add    $0x28,%rsp
  push   $0x0
  push   $0x0
  push   %rbx
  mov    (%r12),%eax
  push   %rax
  push   $0x1
  mov    %r15d,%r9d
  mov    %r14d,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    0x38(%rsp),%esi
  mov    %r13,%rdi
  call   <XGetSubImage@plt>
  add    $0x30,%rsp
  lea    0xe(%r15),%edi
  mov    %r15d,%eax
  add    $0x7,%eax
  cmovns %eax,%edi
  sar    $0x3,%edi
  imul   %r14d,%edi
  mov    $0x1,%esi
  call   <XtCalloc@plt>
  mov    %rax,0x18(%rsp)
  mov    (%r12),%r12d
  mov    %r13,%rdi
  call   <DefaultScreen@plt>
  mov    %eax,%esi
  mov    %r13,%rdi
  call   <DefaultVisual@plt>
  mov    %eax,%esi
  push   $0x0
  push   $0x8
  push   %r14
  push   %r15
  mov    0x38(%rsp),%r9
  mov    $0x0,%r8d
  mov    %r12d,%ecx
  mov    $0x1,%edx
  mov    %r13,%rdi
  call   <XCreateImage@plt>
  mov    %rax,%r12
  mov    D15(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,0x18(%r12)
  mov    %rax,0x20(%r12)
  add    $0x20,%rsp
  test   %r15d,%r15d
  jle    L79
  mov    $0x0,%esi
  mov    $0x80,%r8d
  lea    -0x1(%r14),%r10d
  mov    0x20(%rsp),%r11d
  jmp    L64
L63:
  add    $0x1,%edx
  cmp    %edx,%ebp
  je     L30
L5:
  mov    %esi,%ecx
  imul   0x8(%rbx),%ecx
  movslq %ecx,%rcx
  lea    0x7(%rdx),%eax
  test   %edx,%edx
  cmovns %edx,%eax
  sar    $0x3,%eax
  cltq
  add    (%rbx),%rcx
  movsbl (%rcx,%rax,1),%r15d
  mov    %edx,%ecx
  and    $0x7,%ecx
  mov    %r8d,%eax
  sar    %cl,%eax
  test   %eax,%r15d
  je     L63
  mov    %r10d,%eax
  sub    %edx,%eax
  imul   0x8(%r12),%eax
  cltq
  add    %rdi,%rax
  add    (%r12),%rax
  or     %r9b,(%rax)
  jmp    L63
L30:
  add    $0x1,%esi
  cmp    %esi,%r11d
  je     L79
L64:
  test   %ebp,%ebp
  jle    L30
  lea    0x7(%rsi),%edi
  test   %esi,%esi
  cmovns %esi,%edi
  sar    $0x3,%edi
  movslq %edi,%rdi
  mov    %esi,%ecx
  and    $0x7,%ecx
  mov    %r8d,%eax
  sar    %cl,%eax
  mov    %eax,%r9d
  mov    $0x0,%edx
  jmp    L5
L79:
  mov    0x78(%rsp),%rdi
  call   <FontAscent@plt>
  mov    0x28(%rsp),%ebp
  sub    %eax,%ebp
  mov    $0x0,%eax
  cmovs  %eax,%ebp
  mov    0x2c(%rsp),%r15d
  sub    %r14d,%r15d
  mov    0x10(%r12),%eax
  push   %rax
  mov    0xc(%r12),%eax
  push   %rax
  push   $0x0
  push   $0x0
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    %r12,%rcx
  mov    0x30(%rsp),%edx
  mov    0x2c(%rsp),%esi
  mov    %r13,%rdi
  call   <XPutImage@plt>
  add    $0x20,%rsp
  mov    D28(%rip),%rax
  mov    (%rax),%edx
  mov    0x24(%rsp),%r14d
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <XSetFillStyle@plt>
  mov    0xc(%rsp),%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <XSetStipple@plt>
  mov    %r15d,%ecx
  mov    %ebp,%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <XSetTSOrigin@plt>
  mov    0xc(%r12),%r9d
  sub    $0x8,%rsp
  mov    0x10(%r12),%eax
  push   %rax
  mov    %r15d,%r8d
  mov    %ebp,%ecx
  mov    %r14d,%edx
  mov    0x24(%rsp),%esi
  mov    %r13,%rdi
  call   <XFillRectangle@plt>
  mov    D31(%rip),%rax
  mov    (%rax),%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <XSetFillStyle@plt>
  mov    0x20(%rsp),%esi
  mov    %r13,%rdi
  call   <XFreeGC@plt>
  mov    %rbx,%rdi
  call   <XDestroyImage@plt>
  mov    %r12,%rdi
  call   <XDestroyImage@plt>
  mov    0x18(%rsp),%esi
  mov    %r13,%rdi
  call   <XFreePixmap@plt>
  mov    0x1c(%rsp),%esi
  mov    %r13,%rdi
  call   <XFreePixmap@plt>
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void XDrawVString(Display *display, Window win, GC gc, int x, int y, char *str, int len, XFontStruct *f) {
  XImage *before, *after;
  char *dest, *source;
  int xloop, yloop, xdest, ydest;
  Pixmap pix, rotpix;
  int width, height;
  GC drawGC;
  width = (int)FontTextWidth(f, str);
  height = (int)FontHeight(f);
  pix = XCreatePixmap(display, win, width, height, 1);
  rotpix = XCreatePixmap(display, win, height, width, 1);
  drawGC = XCreateGC(display, pix, 0L, NULL);
  XSetBackground(display, drawGC, 0);
  XSetFont(display, drawGC, f->fid);
  XSetForeground(display, drawGC, 0);
  XFillRectangle(display, pix, drawGC, 0, 0, width, height);
  XFillRectangle(display, rotpix, drawGC, 0, 0, height, width);
  XSetForeground(display, drawGC, 1);
  XDrawImageString(display, pix, drawGC, 0, (int)FontAscent(f), str, strlen(str));
  source = (char *)XtCalloc((((width + 7) / 8) * height), 1);
  before = XCreateImage(display, DefaultVisual(display, DefaultScreen(display)), 1, XYPixmap, 0, source, width, height, 8, 0);
  before->byte_order = before->bitmap_bit_order = MSBFirst;
  XGetSubImage(display, pix, 0, 0, width, height, 1L, XYPixmap, before, 0, 0);
  source = (char *)XtCalloc((((height + 7) / 8) * width), 1);
  after = XCreateImage(display, DefaultVisual(display, DefaultScreen(display)), 1, XYPixmap, 0, source, height, width, 8, 0);
  after->byte_order = after->bitmap_bit_order = MSBFirst;
  for (yloop = 0; yloop < height; yloop++) {
    for (xloop = 0; xloop < width; xloop++) {
      source = before->data + (xloop / 8) + (yloop * before->bytes_per_line);
      if (*source & (128 >> (xloop % 8))) {
        dest = after->data + (yloop / 8) + ((width - 1 - xloop) * after->bytes_per_line);
        *dest |= (128 >> (yloop % 8));
      }
    }
  }
  xdest = x - (int)FontAscent(f);
  if (xdest < 0)
    xdest = 0;
  ydest = y - width;
  XPutImage(display, rotpix, drawGC, after, 0, 0, 0, 0, after->width, after->height);
  XSetFillStyle(display, gc, FillStippled);
  XSetStipple(display, gc, rotpix);
  XSetTSOrigin(display, gc, xdest, ydest);
  XFillRectangle(display, win, gc, xdest, ydest, after->width, after->height);
  XSetFillStyle(display, gc, FillSolid);
  XFreeGC(display, drawGC);
  XDestroyImage(before);
  XDestroyImage(after);
  XFreePixmap(display, pix);
  XFreePixmap(display, rotpix);
}
```