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

```asm
<simple_adaptive_threshold>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  movslq %r9d,%rbx
  mov    %rdx,-0x48(%rsp)
  mov    %r8d,-0x10(%rsp)
  mov    %ebx,-0x34(%rsp)
  test   %r8d,%r8d
  jle    L103
  mov    %rdi,%r15
  mov    %ebx,%edi
  mov    %ecx,%r13d
  movl   $0x0,-0x14(%rsp)
  imul   %ecx,%edi
  lea    0x1(%rdx),%rax
  mov    %rbx,-0x28(%rsp)
  movslq %esi,%r12
  imul   %esi,%r13d
  movl   $0x0,-0x2c(%rsp)
  movl   $0x0,-0x18(%rsp)
  mov    %edi,-0x8(%rsp)
  mov    %ebx,%edi
  imul   %r13d,%edi
  mov    %rax,-0x20(%rsp)
  mov    %ecx,-0xc(%rsp)
  mov    %edi,-0x4(%rsp)
  mov    %ebx,%edi
  imul   %esi,%edi
  mov    %edi,-0x30(%rsp)
L100:
  mov    -0x18(%rsp),%eax
  mov    -0x34(%rsp),%ebx
  mov    %eax,-0x38(%rsp)
  add    %ebx,%eax
  mov    %eax,-0x18(%rsp)
  mov    -0xc(%rsp),%eax
  test   %eax,%eax
  jle    L32
  mov    -0x10(%rsp),%eax
  mov    -0x18(%rsp),%ebx
  movq   $0x0,-0x58(%rsp)
  movl   $0x0,-0x40(%rsp)
  mov    -0xc(%rsp),%r14d
  cmp    %ebx,%eax
  cmovle %eax,%ebx
  mov    -0x14(%rsp),%eax
  mov    %eax,-0x3c(%rsp)
  nopl   0x0(%rax)
L84:
  mov    -0x40(%rsp),%eax
  mov    -0x34(%rsp),%edi
  mov    %eax,-0x50(%rsp)
  mov    %eax,%r9d
  add    %edi,%eax
  cmp    %eax,%r14d
  mov    %eax,%r8d
  mov    %eax,-0x40(%rsp)
  cmovle %r14d,%r8d
  cmp    %ebx,-0x38(%rsp)
  jge    L23
  mov    %r8d,%ebp
  mov    -0x3c(%rsp),%r10d
  mov    -0x38(%rsp),%edi
  xor    %r11d,%r11d
  xor    %eax,%eax
  sub    %r9d,%ebp
  nopl   (%rax)
L42:
  movslq %r10d,%rdx
  mov    %r9d,%ecx
  add    %r15,%rdx
  cmp    %r9d,%r8d
  jle    L58
  cs nopw 0x0(%rax,%rax,1)
L52:
  movzbl (%rdx),%esi
  add    $0x1,%ecx
  add    %r12,%rdx
  add    %esi,%eax
  cmp    %ecx,%r8d
  jne    L52
  add    %ebp,%r11d
L58:
  add    $0x1,%edi
  add    %r13d,%r10d
  cmp    %ebx,%edi
  jne    L42
  cltd
  mov    -0x20(%rsp),%rcx
  add    -0x58(%rsp),%rcx
  idiv   %r11d
  mov    -0x3c(%rsp),%ebp
  mov    -0x2c(%rsp),%r11d
  mov    -0x38(%rsp),%r10d
  mov    %r8d,%edx
  sub    -0x50(%rsp),%edx
  sub    $0x1,%edx
  lea    (%rcx,%rdx,1),%rdi
  mov    %rdi,-0x50(%rsp)
  nopl   0x0(%rax)
L38:
  cmp    %r9d,%r8d
  jle    L14
  mov    -0x58(%rsp),%rdx
  movslq %r11d,%rdi
  movslq %ebp,%rsi
  add    %r15,%rsi
  add    %rdi,%rdx
  add    -0x50(%rsp),%rdi
  add    -0x48(%rsp),%rdx
L98:
  movzbl (%rsi),%ecx
  cmp    %eax,%ecx
  setg   %cl
  add    $0x1,%rdx
  add    %r12,%rsi
  neg    %ecx
  mov    %cl,-0x1(%rdx)
  cmp    %rdx,%rdi
  jne    L98
L14:
  add    $0x1,%r10d
  add    %r14d,%r11d
  add    %r13d,%ebp
  cmp    %ebx,%r10d
  jne    L38
  mov    -0x30(%rsp),%edi
  add    %edi,-0x3c(%rsp)
  mov    -0x28(%rsp),%rdi
  add    %rdi,-0x58(%rsp)
  cmp    -0x40(%rsp),%r14d
  jg     L84
L32:
  mov    -0x8(%rsp),%ebx
  add    %ebx,-0x2c(%rsp)
  mov    -0x4(%rsp),%ebx
  add    %ebx,-0x14(%rsp)
  mov    -0x18(%rsp),%ebx
  cmp    %ebx,-0x10(%rsp)
  jg     L100
L103:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L23:
  ud2
```

assistant: ```c
void simple_adaptive_threshold(const unsigned char *source, int source_stride, unsigned char *dest, int width, int height, int tile_size) {
  int x_step = tile_size;
  int y_step = tile_size;
  int y, x;
  for (y = 0; y < height; y += y_step) {
    for (x = 0; x < width; x += x_step) {
      int xxmax, yymax, sum, count;
      int yy, xx;
      int mean;
      xxmax = x + x_step;
      if (xxmax > width)
        xxmax = width;
      yymax = y + y_step;
      if (yymax > height)
        yymax = height;
      sum = 0;
      count = 0;
      for (yy = y; yy < yymax; ++yy) {
        for (xx = x; xx < xxmax; ++xx) {
          sum += source[(yy * width + xx) * source_stride];
          ++count;
        }
      }
      mean = sum / count;
      for (yy = y; yy < yymax; ++yy) {
        for (xx = x; xx < xxmax; ++xx) {
          if (source[(yy * width + xx) * source_stride] > mean) {
            dest[(yy * width + xx)] = 255;
          } else {
            dest[(yy * width + xx)] = 0;
          }
        }
      }
    }
  }
}
```