user: Please show me the C implementation that matches the assembly code listed below:

```asm
<GC_X_variable_stack>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,(%rsp)
  mov    %rdx,0x8(%rsp)
  test   %rdi,%rdi
  je     L107
  mov    %rcx,%r14
  lea    (%rdi,%rsi,1),%r15
  mov    0x8(%r15),%r13
  lea    0x10(%r15),%r12
  cmp    %r15,%rdx
  je     L81
  lea    0x10(%r15,%r13,8),%rax
  cmp    %rax,%rdx
  jne    L53
L81:
  lea    -0x1(%r13),%rbx
  test   %r13,%r13
  jne    L67
L107:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  mov    0x10(%r12),%rbp
  mov    0x8(%r12),%rbx
  add    $0x10,%r12
  sub    $0x3,%r13
  add    (%rsp),%rbx
  mov    0x8(%rsp),%rsi
  mov    %rbx,%rdi
  call   <SHALLOWER_STACK_ADDRESS@plt>
  test   %rax,%rax
  jne    L211
L19:
  add    $0x8,%r12
  lea    -0x1(%r13),%rbx
  test   %r13,%r13
  je     L107
L67:
  mov    (%r12),%rax
  test   %rax,%rax
  je     L6
  mov    (%rsp),%rcx
  lea    (%rax,%rcx,1),%rbp
  mov    0x8(%rsp),%rsi
  mov    %rbp,%rdi
  call   <SHALLOWER_STACK_ADDRESS@plt>
  mov    %rbx,%r13
  test   %rax,%rax
  je     L19
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <X_source@plt>
  mov    %rbp,%rdi
  call   <gcX@plt>
  jmp    L19
L211:
  test   %rbp,%rbp
  je     L19
L37:
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <X_source@plt>
  mov    %rbx,%rdi
  call   <gcX@plt>
  add    $0x8,%rbx
  sub    $0x1,%rbp
  jne    L37
  jmp    L19
L79:
  mov    0x10(%r12),%rbp
  mov    0x8(%r12),%rbx
  add    $0x10,%r12
  sub    $0x3,%r13
  add    (%rsp),%rbx
  test   %rbp,%rbp
  je     L101
L32:
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <X_source@plt>
  mov    %rbx,%rdi
  call   <gcX@plt>
  add    $0x8,%rbx
  sub    $0x1,%rbp
  jne    L32
L101:
  add    $0x8,%r12
  lea    -0x1(%r13),%rbx
  test   %r13,%r13
  je     L36
L218:
  mov    (%r12),%rbp
  test   %rbp,%rbp
  je     L79
  add    (%rsp),%rbp
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <X_source@plt>
  mov    %rbp,%rdi
  call   <gcX@plt>
  mov    %rbx,%r13
  jmp    L101
L36:
  mov    (%r15),%r15
  test   %r15,%r15
  je     L107
  add    (%rsp),%r15
  mov    0x8(%r15),%r13
  lea    0x10(%r15),%r12
  cmp    0x8(%rsp),%r15
  je     L81
  lea    0x10(%r15,%r13,8),%rax
  cmp    %rax,0x8(%rsp)
  je     L81
L53:
  lea    -0x1(%r13),%rbx
  test   %r13,%r13
  jne    L218
  jmp    L36
```

assistant: ```c
void GC_X_variable_stack(void **var_stack, long delta, void *limit, void *stack_mem) {
  long size, count;
  void ***p, **a;
  while (var_stack) {
    var_stack = (void **)((char *)var_stack + delta);
    size = *(long *)(var_stack + 1);
    p = (void ***)(var_stack + 2);
    if ((var_stack == limit) || (var_stack + size + 2 == limit)) {
      while (size--) {
        a = *p;
        if (!a) {
          count = ((long *)p)[2];
          a = ((void ***)p)[1];
          p += 2;
          size -= 2;
          a = (void **)((char *)a + delta);
          if (SHALLOWER_STACK_ADDRESS(a, limit)) {
            while (count--) {
              X_source(stack_mem, a);
              gcX(a);
              a++;
            }
          }
        } else {
          a = (void **)((char *)a + delta);
          if (SHALLOWER_STACK_ADDRESS(a, limit)) {
            X_source(stack_mem, a);
            gcX(a);
          }
        }
        p++;
      }
      return;
    }
    while (size--) {
      a = *p;
      if (!a) {
        count = ((long *)p)[2];
        a = ((void ***)p)[1];
        p += 2;
        size -= 2;
        a = (void **)((char *)a + delta);
        while (count--) {
          X_source(stack_mem, a);
          gcX(a);
          a++;
        }
      } else {
        a = (void **)((char *)a + delta);
        X_source(stack_mem, a);
        gcX(a);
      }
      p++;
    }
    var_stack = *var_stack;
  }
}
```