user: 请从给定的汇编指令推导出C源代码:

```asm
<max_subarray_optimal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x68,%rsp
  mov    %edx,-0x4c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  test   %edx,%edx
  jle    L100
  lea    -0x1(%rsi),%edx
  mov    %rdi,%r15
  movslq %esi,%rax
  mov    %esi,%edi
  and    $0xfffffffc,%edi
  mov    %edx,-0x50(%rbp)
  xor    %r14d,%r14d
  mov    %esi,%r8d
  lea    0x4(,%rdx,4),%rcx
  mov    %esi,%edx
  mov    %edi,-0x54(%rbp)
  mov    %r14d,%r13d
  lea    0xf(,%rax,4),%rax
  shr    $0x2,%edx
  mov    %rcx,-0x78(%rbp)
  mov    %rax,%rdi
  and    $0xff0,%eax
  lea    -0x1(%rdx),%ecx
  movl   $0x0,-0x5c(%rbp)
  mov    %rax,-0x80(%rbp)
  sub    $0x8,%rax
  add    $0x1,%rcx
  and    $0xfffffffffffff000,%rdi
  movl   $0x0,-0x58(%rbp)
  shl    $0x4,%rcx
  mov    %rdi,-0x70(%rbp)
  mov    %rcx,%r14
  mov    %rax,-0x88(%rbp)
  nopl   0x0(%rax,%rax,1)
L56:
  mov    %rsp,%rax
  sub    -0x70(%rbp),%rax
  mov    %rsp,-0x68(%rbp)
  cmp    %rax,%rsp
  je     L139
L130:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L130
L139:
  mov    -0x80(%rbp),%rax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L108
  mov    -0x88(%rbp),%rax
  orq    $0x0,(%rsp,%rax,1)
L108:
  mov    %rsp,%rbx
  test   %r8d,%r8d
  jle    L42
  mov    -0x78(%rbp),%rdx
  xor    %esi,%esi
  mov    %rbx,%rdi
  mov    %r8d,-0x44(%rbp)
  call   <memset@plt>
  mov    -0x44(%rbp),%r8d
L42:
  mov    -0x58(%rbp),%r10d
  mov    -0x5c(%rbp),%r12d
  mov    %r13d,%r11d
  mov    %r14,%r13
  mov    %r10d,%r14d
  nopl   0x0(%rax)
L87:
  test   %r8d,%r8d
  jle    L49
  cmpl   $0x2,-0x50(%rbp)
  jbe    L150
  movslq %r12d,%rax
  lea    (%r15,%rax,4),%rdx
  xor    %eax,%eax
L151:
  movdqu (%rbx,%rax,1),%xmm0
  movdqu (%rdx,%rax,1),%xmm2
  paddd  %xmm2,%xmm0
  movups %xmm0,(%rbx,%rax,1)
  add    $0x10,%rax
  cmp    %r13,%rax
  jne    L151
  mov    -0x54(%rbp),%eax
  mov    %eax,%edx
  cmp    %r8d,%eax
  je     L49
L53:
  mov    %r8d,%esi
  sub    %edx,%esi
  cmp    $0x1,%esi
  je     L71
  movslq %r12d,%rcx
  lea    (%rbx,%rdx,4),%rdi
  add    %rdx,%rcx
  movq   (%rdi),%xmm1
  mov    %esi,%edx
  movq   (%r15,%rcx,4),%xmm0
  and    $0xfffffffe,%edx
  add    %edx,%eax
  paddd  %xmm1,%xmm0
  movq   %xmm0,(%rdi)
  cmp    %edx,%esi
  je     L49
L71:
  movslq %eax,%rdx
  add    %r12d,%eax
  cltq
  mov    (%r15,%rax,4),%eax
  add    %eax,(%rbx,%rdx,4)
L49:
  mov    %r8d,%esi
  mov    %rbx,%rdi
  mov    %r11d,-0x48(%rbp)
  mov    %r8d,-0x44(%rbp)
  call   <max_subarray@plt>
  mov    -0x48(%rbp),%r11d
  mov    -0x44(%rbp),%r8d
  cmp    %eax,%r11d
  cmovl  %eax,%r11d
  add    $0x1,%r14d
  add    %r8d,%r12d
  cmp    %r14d,-0x4c(%rbp)
  jg     L87
  mov    %r13,%r14
  mov    %r11d,%r13d
  addl   $0x1,-0x58(%rbp)
  mov    -0x68(%rbp),%rsp
  add    %r8d,-0x5c(%rbp)
  mov    -0x58(%rbp),%eax
  cmp    %eax,-0x4c(%rbp)
  jne    L56
  mov    %r11d,%r14d
L143:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  lea    -0x28(%rbp),%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L150:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L53
L100:
  xor    %r14d,%r14d
  jmp    L143
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int max_subarray_optimal(int array[], int width, int height) {
  int max = 0;
  int current = 0;
  for (int row = 0; row < height; row++) {
    int column_sums[width];
    for (int i = 0; i < width; i++) {
      column_sums[i] = 0;
    }
    for (int r = row; r < height; r++) {
      for (int c = 0; c < width; c++) {
        column_sums[c] += array[r * width + c];
      }
      current = max_subarray(column_sums, width);
      if (current > max)
        max = current;
    }
  }
  return max;
}
```