user: What would the C source look like for the assembly code provided here?

```asm
<simple_adaptive_threshold>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,-0x40(%rbp)
  mov    %r8d,-0x4c(%rbp)
  mov    %r9d,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L156
L77:
  movl   $0x0,-0x28(%rbp)
  jmp    L137
L105:
  mov    -0x28(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jle    L121
  mov    -0x40(%rbp),%eax
  mov    %eax,-0x24(%rbp)
L121:
  mov    -0x2c(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jle    L155
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
L155:
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L82
L36:
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L107
L60:
  mov    -0x14(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  imul   -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %eax,-0x1c(%rbp)
  addl   $0x1,-0x18(%rbp)
  addl   $0x1,-0x10(%rbp)
L107:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L60
  addl   $0x1,-0x14(%rbp)
L82:
  mov    -0x14(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L36
  mov    -0x1c(%rbp),%eax
  cltd
  idivl  -0x18(%rbp)
  mov    %eax,-0x4(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L15
L1:
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L72
L23:
  mov    -0x14(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  imul   -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    %eax,-0x4(%rbp)
  jge    L118
  mov    -0x14(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0xff,(%rax)
  jmp    L158
L118:
  mov    -0x14(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L158:
  addl   $0x1,-0x10(%rbp)
L72:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L23
  addl   $0x1,-0x14(%rbp)
L15:
  mov    -0x14(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L1
  mov    -0xc(%rbp),%eax
  add    %eax,-0x28(%rbp)
L137:
  mov    -0x28(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L105
  mov    -0x8(%rbp),%eax
  add    %eax,-0x2c(%rbp)
L156:
  mov    -0x2c(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L77
  nop
  nop
  pop    %rbp
  ret
```

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;
          }
        }
      }
    }
  }
}
```