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

```asm
<x11_create_win>:
  endbr64
  push   %r15
  push   %r14
  mov    %edi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %r9d,%ebp
  push   %rbx
  shl    $0x10,%ebp
  sub    $0x38,%rsp
  mov    0x98(%rsp),%r11d
  mov    0x70(%rsp),%eax
  mov    %edx,0x8(%rsp)
  mov    0x88(%rsp),%edi
  mov    0x90(%rsp),%esi
  mov    %ecx,0xc(%rsp)
  mov    0xa0(%rsp),%r9
  mov    0x78(%rsp),%ebx
  mov    %eax,0x14(%rsp)
  mov    %edi,0x18(%rsp)
  mov    %r11d,%edi
  mov    0x80(%rsp),%r12d
  mov    %esi,0x1c(%rsp)
  shl    $0x10,%ebx
  mov    %r11d,0x24(%rsp)
  shl    $0x10,%r12d
  mov    %r8d,0x10(%rsp)
  mov    %r9,0x28(%rsp)
  call   <count_bits@plt>
  lea    0x8(%rax),%edx
  mov    %eax,%r15d
  lea    0x0(,%rdx,4),%r13d
  mov    %edx,0x20(%rsp)
  mov    %r13d,%edi
  call   <sbrk@plt>
  mov    0x20(%rsp),%edx
  movd   0xc(%rsp),%xmm1
  movd   0x8(%rsp),%xmm4
  or     0x10(%rsp),%ebp
  mov    %rax,%rsi
  shl    $0x10,%edx
  movd   %ebp,%xmm3
  mov    0x24(%rsp),%r11d
  or     0x14(%rsp),%ebx
  or     $0x1,%edx
  punpckldq %xmm3,%xmm1
  or     0x18(%rsp),%r12d
  movd   %edx,%xmm0
  movd   %r11d,%xmm5
  movd   %r12d,%xmm6
  punpckldq %xmm4,%xmm0
  punpcklqdq %xmm1,%xmm0
  movd   0x1c(%rsp),%xmm1
  movups %xmm0,(%rax)
  movd   %ebx,%xmm0
  punpckldq %xmm5,%xmm1
  punpckldq %xmm6,%xmm0
  punpcklqdq %xmm1,%xmm0
  movups %xmm0,0x10(%rax)
  test   %r15d,%r15d
  jle    L49
  mov    0x28(%rsp),%r9
  sub    %r9,%rax
  add    $0x1c,%rax
  cmp    $0x8,%rax
  jbe    L78
  lea    -0x1(%r15),%eax
  cmp    $0x2,%eax
  jbe    L78
  mov    %r15d,%edx
  xor    %eax,%eax
  shr    $0x2,%edx
  shl    $0x4,%rdx
  nopl   0x0(%rax,%rax,1)
L17:
  movdqu (%r9,%rax,1),%xmm2
  movups %xmm2,0x20(%rsi,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L17
  mov    %r15d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r15b
  je     L49
  mov    %eax,%edi
  lea    0x0(,%rdi,4),%rdx
  mov    (%r9,%rdi,4),%edi
  mov    %edi,0x20(%rsi,%rdx,1)
  lea    0x1(%rax),%edi
  cmp    %edi,%r15d
  jle    L49
  mov    0x4(%r9,%rdx,1),%edi
  add    $0x2,%eax
  mov    %edi,0x24(%rsi,%rdx,1)
  cmp    %eax,%r15d
  jle    L49
  mov    0x8(%r9,%rdx,1),%eax
  mov    %eax,0x28(%rsi,%rdx,1)
L49:
  mov    %r14d,%edi
  mov    %r13d,%edx
  call   <write@plt>
  add    $0x38,%rsp
  mov    %r13d,%edi
  pop    %rbx
  neg    %edi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <sbrk@plt>
  nop
L78:
  mov    %r15d,%ecx
  xor    %eax,%eax
  nopl   (%rax)
L47:
  mov    (%r9,%rax,4),%edx
  mov    %edx,0x20(%rsi,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L47
  jmp    L49
```

assistant: ```c
void x11_create_win(int sock, struct x11_connection *conn, uint32_t id, uint32_t parent, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t border, uint16_t group, uint32_t visual, uint32_t flags, uint32_t *list) {
  uint16_t flag_count = count_bits(flags);
  uint16_t length = 8 + flag_count;
  uint32_t *packet = sbrk(length * 4);
  packet[0] = 0x01 | length << 16;
  packet[1] = id;
  packet[2] = parent;
  packet[3] = x | y << 16;
  packet[4] = w | h << 16;
  packet[5] = border << 16 | group;
  packet[6] = visual;
  packet[7] = flags;
  int i;
  for (i = 0; i < flag_count; i++)
    packet[8 + i] = list[i];
  write(sock, packet, length * 4);
  sbrk(-(length * 4));
  return;
  (void)conn;
}
```