user: 下面的汇编指令对应的C源代码是什么：

```asm
<bin_search_diagonal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8,-0x68(%rbp)
  mov    %r9,-0x70(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %rax,%r10
  mov    $0x0,%r11d
  mov    -0x60(%rbp),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    -0x70(%rbp),%rdx
  mov    %rdx,-0x30(%rbp)
  mov    -0x60(%rbp),%rcx
  mov    0x10(%rbp),%rdx
  add    %rcx,%rdx
  sub    -0x70(%rbp),%rdx
  mov    %rdx,-0x28(%rbp)
  mov    0x10(%rbp),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    -0x28(%rbp),%rdx
  cmp    -0x68(%rbp),%rdx
  jg     L108
  mov    -0x20(%rbp),%rdx
  cmp    0x10(%rbp),%rdx
  jle    L113
L108:
  mov    $0x0,%eax
  jmp    L43
L124:
  mov    -0x28(%rbp),%rdx
  sub    -0x38(%rbp),%rdx
  mov    %rdx,%rcx
  shr    $0x3f,%rcx
  add    %rcx,%rdx
  sar    %rdx
  mov    %rdx,%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rdx,-0x10(%rbp)
  mov    -0x20(%rbp),%rdx
  sub    -0x30(%rbp),%rdx
  mov    %rdx,%rcx
  shr    $0x3f,%rcx
  add    %rcx,%rdx
  sar    %rdx
  mov    %rdx,%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x10(%rbp),%rdx
  imul   %rax,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x58(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x8(%rbp),%rdx
  mov    (%rcx,%rdx,4),%edx
  cmp    %edx,0x18(%rbp)
  jne    L119
  mov    -0x10(%rbp),%rax
  sub    -0x60(%rbp),%rax
  jmp    L43
L119:
  mov    -0x10(%rbp),%rdx
  imul   %rax,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x58(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x8(%rbp),%rdx
  mov    (%rcx,%rdx,4),%edx
  cmp    %edx,0x18(%rbp)
  jle    L28
  mov    -0x10(%rbp),%rdx
  add    $0x1,%rdx
  mov    %rdx,-0x38(%rbp)
  mov    -0x8(%rbp),%rdx
  add    $0x1,%rdx
  mov    %rdx,-0x30(%rbp)
  jmp    L113
L28:
  mov    -0x10(%rbp),%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x28(%rbp)
  mov    -0x8(%rbp),%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x20(%rbp)
L113:
  mov    -0x38(%rbp),%rdx
  cmp    -0x28(%rbp),%rdx
  jg     L114
  mov    -0x30(%rbp),%rdx
  cmp    -0x20(%rbp),%rdx
  jle    L124
L114:
  mov    -0x28(%rbp),%rax
  cmp    -0x60(%rbp),%rax
  jge    L32
  mov    $0x0,%eax
  jmp    L43
L32:
  mov    -0x38(%rbp),%rax
  cmp    -0x68(%rbp),%rax
  jle    L99
  mov    -0x68(%rbp),%rax
  sub    -0x60(%rbp),%rax
  jmp    L43
L99:
  mov    -0x28(%rbp),%rax
  sub    -0x60(%rbp),%rax
L43:
  pop    %rbp
  ret
```

assistant: ```c
ssize_t bin_search_diagonal(size_t M, size_t N, int matrix[M][N], ssize_t row_l, ssize_t row_r, ssize_t col_l, ssize_t col_r, int val) {
  ssize_t x_l = row_l;
  ssize_t y_l = col_l;
  ssize_t x_r = row_l + col_r - col_l;
  ssize_t y_r = col_r;
  if (x_r > row_r || y_r > col_r) {
    return 0;
  }
  while (x_l <= x_r && y_l <= y_r) {
    ssize_t mid_x = x_l + (x_r - x_l) / 2;
    ssize_t mid_y = y_l + (y_r - y_l) / 2;
    if (matrix[mid_x][mid_y] == val) {
      return mid_x - row_l;
    } else if (matrix[mid_x][mid_y] < val) {
      x_l = mid_x + 1;
      y_l = mid_y + 1;
    } else {
      x_r = mid_x - 1;
      y_r = mid_y - 1;
    }
  }
  if (x_r < row_l) {
    return 0;
  } else if (x_l > row_r) {
    return row_r - row_l;
  } else {
    return x_r - row_l;
  }
}
```