user: What is the c source code of the assembly code below?

```asm
<coalesce>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0x2,%eax
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0x1,%eax
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L51
  cmpq   $0x0,-0x10(%rbp)
  je     L51
  mov    -0x28(%rbp),%rax
  jmp    L48
L51:
  cmpq   $0x0,-0x18(%rbp)
  je     L21
  cmpq   $0x0,-0x10(%rbp)
  jne    L21
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  add    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x8(%rbp),%rax
  mov    %eax,%esi
  mov    -0x18(%rbp),%rax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  or     %ecx,%esi
  mov    %esi,%edx
  mov    %edx,(%rax)
  jmp    L63
L21:
  cmpq   $0x0,-0x18(%rbp)
  jne    L55
  cmpq   $0x0,-0x10(%rbp)
  je     L55
  mov    -0x28(%rbp),%rax
  sub    $0x8,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  neg    %rax
  add    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  add    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0x2,%eax
  mov    %rax,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x8(%rbp),%rax
  mov    %eax,%esi
  mov    -0x18(%rbp),%rax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  or     %ecx,%esi
  mov    %esi,%edx
  mov    %edx,(%rax)
  jmp    L63
L55:
  mov    -0x28(%rbp),%rax
  sub    $0x8,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  mov    $0xfffffffffffffffc,%rdx
  sub    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0xfffffff8,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  lea    -0x4(%rax),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  and    $0xfffffff8,%eax
  add    %edx,%eax
  mov    %eax,%eax
  add    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  sub    $0x8,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  neg    %rax
  add    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0x2,%eax
  mov    %rax,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x8(%rbp),%rax
  mov    %eax,%esi
  mov    -0x18(%rbp),%rax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  sub    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  and    $0xfffffff8,%eax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  or     %ecx,%esi
  mov    %esi,%edx
  mov    %edx,(%rax)
L63:
  mov    -0x28(%rbp),%rax
L48:
  pop    %rbp
  ret
```

assistant: ```c
void *coalesce(void *bp) {
  size_t prev_alloc = ((*(unsigned int *)(((char *)(bp)-4))) & 0x2);
  size_t next_alloc = ((*(unsigned int *)(((char *)(((char *)(bp) + ((*(unsigned int *)(((char *)(bp)-4))) & ~0x7))) - 4))) & 0x1);
  size_t size = ((*(unsigned int *)(((char *)(bp)-4))) & ~0x7);
  char *next_block;
  size_t next_size;
  if (prev_alloc && next_alloc)
    return bp;
  else if (prev_alloc && !next_alloc) {
    size += ((*(unsigned int *)(((char *)(((char *)(bp) + ((*(unsigned int *)(((char *)(bp)-4))) & ~0x7))) - 4))) & ~0x7);
    (*(unsigned int *)(((char *)(bp)-4)) = (((size) | (prev_alloc))));
    (*(unsigned int *)(((char *)(bp) + ((*(unsigned int *)(((char *)(bp)-4))) & ~0x7) - 8)) = (((size) | (prev_alloc))));
  } else if (!prev_alloc && next_alloc) {
    bp = ((char *)(bp) - ((*(unsigned int *)(((char *)(bp)-8))) & ~0x7));
    size += ((*(unsigned int *)(((char *)(bp)-4))) & ~0x7);
    prev_alloc = ((*(unsigned int *)(((char *)(bp)-4))) & 0x2);
    (*(unsigned int *)(((char *)(bp)-4)) = (((size) | (prev_alloc))));
    (*(unsigned int *)(((char *)(bp) + ((*(unsigned int *)(((char *)(bp)-4))) & ~0x7) - 8)) = (((size) | (prev_alloc))));
  } else {
    size += ((*(unsigned int *)(((char *)(((char *)(bp) - ((*(unsigned int *)(((char *)(bp)-8))) & ~0x7))) - 4))) & ~0x7) + ((*(unsigned int *)(((char *)(((char *)(bp) + ((*(unsigned int *)(((char *)(bp)-4))) & ~0x7))) - 4))) & ~0x7);
    bp = ((char *)(bp) - ((*(unsigned int *)(((char *)(bp)-8))) & ~0x7));
    prev_alloc = ((*(unsigned int *)(((char *)(bp)-4))) & 0x2);
    (*(unsigned int *)(((char *)(bp)-4)) = (((size) | (prev_alloc))));
    (*(unsigned int *)(((char *)(bp) + ((*(unsigned int *)(((char *)(bp)-4))) & ~0x7) - 8)) = (((size) | (prev_alloc))));
  }
  return bp;
}
```