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

```asm
<zipmapXSet>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  mov    %r9d,%esi
  push   %r13
  mov    %r9d,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %edx,%ebx
  mov    %ebx,%edi
  sub    $0x38,%rsp
  mov    %ecx,0xc(%rsp)
  mov    0x70(%rsp),%r15
  mov    %r8,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <zipmapXRequiredLength@plt>
  mov    %eax,%r12d
  test   %r15,%r15
  je     L27
  movl   $0x0,(%r15)
  xor    %r8d,%r8d
  mov    %ebx,%edx
  mov    %r14,%rsi
  lea    0x24(%rsp),%rcx
  mov    %rbp,%rdi
  call   <zipmapXLookupRaw@plt>
  mov    %rax,%rcx
  test   %rax,%rax
  je     L90
  movl   $0x1,(%r15)
L25:
  mov    %rcx,%rdi
  mov    %rcx,0x18(%rsp)
  call   <zipmapXRawEntryLength@plt>
  mov    0x18(%rsp),%rcx
  cmp    %eax,%r12d
  mov    %eax,%r15d
  ja     L43
  sub    %r12d,%eax
  cmp    $0x3,%eax
  jbe    L5
  mov    %rcx,%r8
  mov    %r15d,%edx
  mov    %r15d,%esi
  mov    %r12d,%edi
  sub    %rbp,%r8
  not    %edx
  add    0x24(%rsp),%edx
  add    %rcx,%rsi
  add    %rcx,%rdi
  sub    %r8d,%edx
  mov    %r8,0x18(%rsp)
  call   <memmove@plt>
  mov    0x24(%rsp),%esi
  mov    %rbp,%rdi
  add    %r12d,%esi
  sub    %r15d,%esi
  mov    %esi,0x24(%rsp)
  call   <zipmapResize@plt>
  mov    0x18(%rsp),%r8
  mov    %rax,%rbp
  mov    %r8d,%r8d
  lea    (%rax,%r8,1),%rcx
L4:
  xor    %r12d,%r12d
L81:
  mov    %rcx,%rdi
  mov    %ebx,%esi
  mov    %rcx,0x18(%rsp)
  call   <zipmapEncodeLength@plt>
  mov    0x18(%rsp),%rcx
  mov    %ebx,%edx
  mov    %r14,%rsi
  movslq %eax,%r15
  add    %rcx,%r15
  mov    %r15,%rdi
  add    %rbx,%r15
  call   <memcpy@plt>
  mov    0xc(%rsp),%eax
  add    $0x4,%r15
  mov    %r13d,%esi
  mov    %eax,-0x4(%r15)
  mov    %r15,%rdi
  call   <zipmapEncodeLength@plt>
  mov    0x10(%rsp),%rsi
  mov    %r13d,%edx
  cltq
  add    %rax,%r15
  mov    %r12b,(%r15)
  lea    0x1(%r15),%rdi
  call   <memcpy@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  add    $0x38,%rsp
  mov    %rbp,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L5:
  mov    %eax,%r12d
  jmp    L81
  nopl   0x0(%rax,%rax,1)
L27:
  lea    0x24(%rsp),%rcx
  xor    %r8d,%r8d
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <zipmapXLookupRaw@plt>
  mov    %rax,%rcx
  test   %rax,%rax
  jne    L25
L90:
  mov    0x24(%rsp),%esi
  mov    %rbp,%rdi
  add    %r12d,%esi
  call   <zipmapResize@plt>
  mov    %rax,%rbp
  mov    0x24(%rsp),%eax
  lea    -0x1(%rbp,%rax,1),%rcx
  mov    0x24(%rsp),%eax
  add    %r12d,%eax
  mov    %eax,0x24(%rsp)
  movzbl 0x0(%rbp),%eax
  cmp    $0xfd,%al
  ja     L4
  add    $0x1,%eax
  mov    %al,0x0(%rbp)
  jmp    L4
  xchg   %ax,%ax
L43:
  mov    0x24(%rsp),%esi
  sub    %rbp,%rcx
  mov    %rbp,%rdi
  mov    %rcx,0x18(%rsp)
  add    %r12d,%esi
  sub    %eax,%esi
  call   <zipmapResize@plt>
  mov    0x18(%rsp),%r8
  mov    %r15d,%edx
  mov    %r12d,%edi
  not    %edx
  mov    %r15d,%esi
  add    0x24(%rsp),%edx
  mov    %rax,%rbp
  mov    %r8d,%ecx
  sub    %r8d,%edx
  sub    %r15d,%r12d
  add    %rax,%rcx
  add    %rcx,%rsi
  add    %rcx,%rdi
  mov    %rcx,0x18(%rsp)
  call   <memmove@plt>
  add    %r12d,0x24(%rsp)
  mov    0x18(%rsp),%rcx
  jmp    L4
L24:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned char *zipmapXSet(unsigned char *zm, unsigned char *key, unsigned int klen, unsigned int timestamp, unsigned char *val, unsigned int vlen, int *update) {
  unsigned int zmlen, offset;
  unsigned int freelen, reqlen = zipmapXRequiredLength(klen, vlen);
  unsigned int empty, vempty;
  unsigned char *p = NULL;
  unsigned int *ts = NULL;
  freelen = reqlen;
  if (update)
    *update = 0;
  p = zipmapXLookupRaw(zm, key, klen, &zmlen, ts);
  if (p == NULL) {
    zm = zipmapResize(zm, zmlen + reqlen);
    p = zm + zmlen - 1;
    zmlen = zmlen + reqlen;
    if (zm[0] < 254)
      zm[0]++;
  } else {
    if (update)
      *update = 1;
    freelen = zipmapXRawEntryLength(p);
    if (freelen < reqlen) {
      offset = p - zm;
      zm = zipmapResize(zm, zmlen - freelen + reqlen);
      p = zm + offset;
      memmove(p + reqlen, p + freelen, zmlen - (offset + freelen + 1));
      zmlen = zmlen - freelen + reqlen;
      freelen = reqlen;
    }
  }
  empty = freelen - reqlen;
  if (empty >= 4) {
    offset = p - zm;
    memmove(p + reqlen, p + freelen, zmlen - (offset + freelen + 1));
    zmlen -= empty;
    zm = zipmapResize(zm, zmlen);
    p = zm + offset;
    vempty = 0;
  } else {
    vempty = empty;
  }
  p += zipmapEncodeLength(p, klen);
  memcpy(p, key, klen);
  p += klen;
  *(unsigned int *)p = timestamp;
  p += sizeof(unsigned int);
  p += zipmapEncodeLength(p, vlen);
  *p++ = vempty;
  memcpy(p, val, vlen);
  return zm;
}
```