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

```asm
<ibitmap_clip>:
  endbr64
  push   %r15
  mov    %rsi,%rax
  mov    %r9d,%r15d
  sar    $0x2,%r9d
  push   %r14
  sar    %r15d
  and    $0x1,%r9d
  mov    0x4(%r8),%r11d
  push   %r13
  and    $0x1,%r15d
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x8(%rdi),%ebx
  mov    0xc(%rdi),%esi
  mov    (%rdi),%r12d
  mov    0x4(%rdi),%r13d
  mov    (%rax),%ebp
  mov    %rdx,-0x18(%rsp)
  mov    0x4(%rax),%r10d
  mov    0x8(%rax),%r14d
  mov    (%rcx),%edi
  mov    %rcx,-0x10(%rsp)
  mov    %ebx,-0x24(%rsp)
  mov    0xc(%r8),%ecx
  mov    %esi,-0x20(%rsp)
  mov    0xc(%rax),%ebx
  mov    (%rdx),%esi
  mov    0x8(%r8),%eax
  mov    %r9d,-0x1c(%rsp)
  mov    (%r8),%edx
  cmp    -0x24(%rsp),%r12d
  jge    L314
  cmp    -0x20(%rsp),%r13d
  jge    L314
  cmp    %r14d,%ebp
  jge    L314
  cmp    %ebx,%r10d
  jge    L314
  cmp    %eax,%ebp
  jge    L247
  cmp    %ecx,%r10d
  jge    L247
  cmp    %edx,%r14d
  jle    L247
  cmp    %r11d,%ebx
  jle    L247
  cmp    %esi,%r12d
  jle    L218
  mov    %r12d,%r9d
  sub    %esi,%r9d
  test   %r15d,%r15d
  jne    L80
  add    %r9d,%edx
  mov    %r12d,%esi
L218:
  cmp    %edi,%r13d
  jle    L228
L413:
  mov    %r13d,%r9d
  sub    %edi,%r9d
  mov    -0x1c(%rsp),%edi
  test   %edi,%edi
  jne    L327
  add    %r9d,%r11d
  mov    %r13d,%edi
L228:
  mov    %eax,%r12d
  mov    %ecx,%r9d
  sub    %edx,%r12d
  sub    %r11d,%r9d
  mov    %r12d,%r13d
  or     %r9d,%r13d
  js     L210
  mov    -0x24(%rsp),%r13d
  add    %esi,%r12d
  cmp    %r13d,%r12d
  jle    L377
  sub    %r13d,%r12d
  test   %r15d,%r15d
  jne    L167
  sub    %r12d,%eax
L377:
  mov    -0x20(%rsp),%r13d
  add    %edi,%r9d
  cmp    %r13d,%r9d
  jle    L102
L279:
  mov    -0x1c(%rsp),%r12d
  sub    %r13d,%r9d
  test   %r12d,%r12d
  jne    L177
  sub    %r9d,%ecx
L102:
  cmp    %eax,%edx
  setge  %r9b
  cmp    %ecx,%r11d
  setge  %r12b
  or     %r12b,%r9b
  jne    L237
  cmp    %ebp,%edx
  jl     L42
  cmp    %r10d,%r11d
  jl     L76
  mov    %r11d,%r10d
L168:
  cmp    %r14d,%eax
  jle    L69
  sub    %r14d,%eax
  add    %esi,%eax
  test   %r15d,%r15d
  cmovne %eax,%esi
  cmp    %edx,%r14d
  mov    %r14d,%eax
  setle  %r9b
  cmp    %ebx,%ecx
  jg     L144
  mov    %ecx,%ebx
L65:
  cmp    %r10d,%ebx
  jle    L363
  test   %r9b,%r9b
  jne    L363
L71:
  mov    -0x18(%rsp),%rcx
  movd   %eax,%xmm1
  movd   %ebx,%xmm2
  movd   %edx,%xmm0
  movd   %r10d,%xmm3
  punpckldq %xmm2,%xmm1
  xor    %eax,%eax
  mov    %esi,(%rcx)
  punpckldq %xmm3,%xmm0
  mov    -0x10(%rsp),%rsi
  punpcklqdq %xmm1,%xmm0
  mov    %edi,(%rsi)
  movups %xmm0,(%r8)
L136:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L42:
  mov    %ebp,%r12d
  sub    %edx,%r12d
  mov    %ebp,%edx
  add    %esi,%r12d
  test   %r15d,%r15d
  cmove  %r12d,%esi
  cmp    %ebp,%eax
  setle  %r12b
  cmp    %r10d,%r11d
  jl     L207
  mov    %r11d,%r10d
L18:
  test   %r12b,%r12b
  je     L168
L245:
  mov    $0xfffffffb,%eax
  jmp    L136
L76:
  xor    %r12d,%r12d
L207:
  cmp    %r10d,%ecx
  mov    %r10d,%ebp
  setle  %r13b
  sub    %r11d,%ebp
  mov    -0x1c(%rsp),%r11d
  add    %edi,%ebp
  test   %r11d,%r11d
  cmove  %ebp,%edi
  test   %r13b,%r13b
  je     L18
  jmp    L245
  nopl   0x0(%rax)
L144:
  mov    -0x1c(%rsp),%r11d
  sub    %ebx,%ecx
  add    %edi,%ecx
  test   %r11d,%r11d
  cmovne %ecx,%edi
  jmp    L65
  nopl   0x0(%rax)
L69:
  cmp    %ebx,%ecx
  jg     L144
  mov    %ecx,%ebx
  jmp    L71
  nopl   0x0(%rax,%rax,1)
L327:
  sub    %r9d,%ecx
  mov    %r13d,%edi
  jmp    L228
  nopl   0x0(%rax,%rax,1)
L80:
  sub    %r9d,%eax
  mov    %r12d,%esi
  cmp    %edi,%r13d
  jle    L228
  jmp    L413
  nopl   0x0(%rax)
L177:
  add    %r9d,%r11d
  jmp    L102
L167:
  mov    -0x20(%rsp),%r13d
  add    %edi,%r9d
  add    %r12d,%edx
  cmp    %r13d,%r9d
  jle    L102
  jmp    L279
  nopl   0x0(%rax)
L314:
  mov    $0xffffffff,%eax
  jmp    L136
  nopw   0x0(%rax,%rax,1)
L247:
  mov    $0xfffffffe,%eax
  jmp    L136
L210:
  mov    $0xfffffffd,%eax
  jmp    L136
L237:
  mov    $0xfffffffc,%eax
  jmp    L136
L363:
  mov    $0xfffffffa,%eax
  jmp    L136
```

assistant: ```c
int ibitmap_clip(const int *clipdst, const int *clipsrc, int *x, int *y, int *rectsrc, int clip) {
  int dcl = clipdst[0];
  int dct = clipdst[1];
  int dcr = clipdst[2];
  int dcb = clipdst[3];
  int scl = clipsrc[0];
  int sct = clipsrc[1];
  int scr = clipsrc[2];
  int scb = clipsrc[3];
  int dx = *x;
  int dy = *y;
  int sl = rectsrc[0];
  int st = rectsrc[1];
  int sr = rectsrc[2];
  int sb = rectsrc[3];
  int hflip, vflip;
  int w, h, d;
  hflip = (clip & 2) ? 1 : 0;
  vflip = (clip & 4) ? 1 : 0;
  if (dcr <= dcl || dcb <= dct || scr <= scl || scb <= sct)
    return -1;
  if (sr <= scl || sb <= sct || sl >= scr || st >= scb)
    return -2;
  if (dx < dcl) {
    d = dcl - dx;
    dx = dcl;
    if (!hflip)
      sl += d;
    else
      sr -= d;
  }
  if (dy < dct) {
    d = dct - dy;
    dy = dct;
    if (!vflip)
      st += d;
    else
      sb -= d;
  }
  w = sr - sl;
  h = sb - st;
  if (w < 0 || h < 0)
    return -3;
  if (dx + w > dcr) {
    d = dx + w - dcr;
    if (!hflip)
      sr -= d;
    else
      sl += d;
  }
  if (dy + h > dcb) {
    d = dy + h - dcb;
    if (!vflip)
      sb -= d;
    else
      st += d;
  }
  if (sl >= sr || st >= sb)
    return -4;
  if (sl < scl) {
    d = scl - sl;
    sl = scl;
    if (!hflip)
      dx += d;
  }
  if (st < sct) {
    d = sct - st;
    st = sct;
    if (!vflip)
      dy += d;
  }
  if (sl >= sr || st >= sb)
    return -5;
  if (sr > scr) {
    d = sr - scr;
    sr = scr;
    if (hflip)
      dx += d;
  }
  if (sb > scb) {
    d = sb - scb;
    sb = scb;
    if (vflip)
      dy += d;
  }
  if (sl >= sr || st >= sb)
    return -6;
  *x = dx;
  *y = dy;
  rectsrc[0] = sl;
  rectsrc[1] = st;
  rectsrc[2] = sr;
  rectsrc[3] = sb;
  return 0;
}
```