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

```asm
<max_area_2>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  movslq %edx,%r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  cmp    %ecx,%r12d
  je     L107
  lea    (%r12,%rcx,1),%eax
  mov    %ecx,%r14d
  mov    %r12d,%edx
  mov    %esi,0xc(%rsp)
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  mov    %ebx,%ecx
  lea    0x1(%rbx),%ebp
  call   <max_area_2>
  mov    0xc(%rsp),%esi
  mov    %r14d,%ecx
  mov    %ebp,%edx
  mov    %r13,%rdi
  mov    %eax,%r15d
  call   <max_area_2>
  movslq %ebx,%rcx
  mov    0x4(%r13,%rcx,4),%edx
  mov    0x0(%r13,%rcx,4),%ecx
  cmp    %ecx,%edx
  cmovg  %ecx,%edx
  cmp    %eax,%r15d
  cmovl  %eax,%r15d
  lea    (%rdx,%rdx,1),%r8d
  cmp    %r15d,%r8d
  cmovl  %r15d,%r8d
  cmp    %ebx,%r12d
  jl     L126
  cmp    %r14d,%ebp
  jge    L72
L126:
  cmp    %ebp,%r14d
  jg     L57
  sub    $0x1,%ebx
  movslq %ebx,%rax
  mov    0x0(%r13,%rax,4),%eax
  cmp    %eax,%edx
  cmovg  %eax,%edx
  mov    %ebp,%eax
  sub    %ebx,%eax
  add    $0x1,%eax
  imul   %edx,%eax
  cmp    %eax,%r8d
  cmovl  %eax,%r8d
  xor    %ecx,%ecx
  cmp    %ebx,%r12d
  jl     L127
L72:
  add    $0x18,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L74:
  sub    $0x1,%ebx
  mov    $0x1,%ecx
  movslq %ebx,%rax
  mov    0x0(%r13,%rax,4),%eax
  cmp    %eax,%edx
  cmovg  %eax,%edx
  mov    %ebp,%eax
  sub    %ebx,%eax
  add    $0x1,%eax
  imul   %edx,%eax
  cmp    %eax,%r8d
  cmovl  %eax,%r8d
L127:
  cmp    %ebp,%r14d
  jle    L43
L57:
  cmp    %ebx,%r12d
  je     L33
  movslq %ebp,%rax
  movslq %ebx,%rcx
  mov    0x4(%r13,%rax,4),%eax
  cmp    %eax,-0x4(%r13,%rcx,4)
  jge    L74
  add    $0x1,%ebp
L45:
  cmp    %eax,%edx
  cmovg  %eax,%edx
  mov    %ebp,%eax
  sub    %ebx,%eax
  add    $0x1,%eax
  imul   %edx,%eax
  cmp    %eax,%r8d
  cmovl  %eax,%r8d
  cmp    %ebp,%r14d
  jg     L57
  cmp    %ebx,%r12d
  jl     L126
  jmp    L72
  cs nopw 0x0(%rax,%rax,1)
L33:
  add    $0x1,%ebp
  movslq %ebp,%rax
  mov    0x0(%r13,%rax,4),%eax
  jmp    L45
  nopl   (%rax)
L107:
  mov    (%rdi,%r12,4),%r8d
  jmp    L72
L43:
  lea    -0x1(%rbx),%eax
  lea    0x1(%rbp),%edi
  cltq
  jmp    1040 <max_area_2.cold>
```

assistant: ```c
int max_area_2(int *heights, int size, int from, int to) {
  if (from == to) {
    return heights[from];
  }
  int mid = (from + to) / 2;
  int max = max_area_2(heights, size, from, mid);
  int max_right = max_area_2(heights, size, mid + 1, to);
  if (max_right > max) {
    max = max_right;
  }
  int left = mid, right = mid + 1;
  int minHeight = heights[right] < heights[left] ? heights[right] : heights[left];
  int candidate = minHeight * 2;
  if (candidate > max) {
    max = candidate;
  }
  while (left > from || right < to) {
    if (right < to && (left == from || heights[left - 1] < heights[right + 1])) {
      right++;
      if (heights[right] < minHeight) {
        minHeight = heights[right];
      }
    } else {
      left--;
      if (heights[left] < minHeight) {
        minHeight = heights[left];
      }
    }
    candidate = minHeight * (right - left + 1);
    if (candidate > max) {
      max = candidate;
    }
  }
  return max;
}
```