user: Translate the below assembly code into C programming language:

```asm
<trap_water>:
  endbr64
  xor    %eax,%eax
  test   %esi,%esi
  jle    L33
  push   %r13
  lea    0x0(,%rsi,4),%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %r13d,%edi
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    %r13d,%edi
  mov    %rax,%r12
  call   <malloc@plt>
  mov    0x0(%rbp),%edx
  movslq %ebx,%r10
  lea    -0x2(%rbx),%r9d
  shl    $0x2,%r10
  mov    %rax,%rdi
  mov    %edx,(%r12)
  lea    -0x4(%rbp,%r10,1),%r11
  cmp    $0x1,%ebx
  je     L52
  mov    %r9d,%ecx
  mov    %rbp,%rsi
  lea    0x4(%r12),%rax
  lea    0x8(%r12,%rcx,4),%r8
  sub    %r12,%rsi
  xchg   %ax,%ax
L30:
  mov    (%rsi,%rax,1),%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
  add    $0x4,%rax
  mov    %edx,-0x4(%rax)
  cmp    %r8,%rax
  jne    L30
  mov    (%r11),%eax
  mov    %eax,-0x4(%rdi,%r10,1)
L1:
  movslq %r9d,%rsi
  shl    $0x2,%r9
  mov    %rbp,%r8
  mov    -0x4(%rdi,%r10,1),%edx
  shl    $0x2,%rsi
  sub    %rdi,%r8
  lea    (%rdi,%rsi,1),%rax
  sub    $0x4,%rsi
  sub    %r9,%rsi
  add    %rdi,%rsi
L6:
  mov    (%r8,%rax,1),%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
  sub    $0x4,%rax
  mov    %edx,0x4(%rax)
  cmp    %rsi,%rax
  jne    L6
  lea    -0x1(%rbx),%eax
  cmp    $0x2,%eax
  jbe    L29
  mov    %ebx,%edx
  mov    %rdi,%rsi
  mov    %rbp,%rcx
  mov    %r12,%rax
  shr    $0x2,%edx
  pxor   %xmm2,%xmm2
  sub    %r12,%rsi
  sub    %r12,%rcx
  shl    $0x4,%rdx
  add    %r12,%rdx
L74:
  movdqu (%rax),%xmm3
  movdqu (%rsi,%rax,1),%xmm0
  movdqu (%rsi,%rax,1),%xmm4
  movdqu (%rcx,%rax,1),%xmm5
  add    $0x10,%rax
  pcmpgtd %xmm3,%xmm0
  movdqa %xmm3,%xmm1
  pand   %xmm0,%xmm1
  pandn  %xmm4,%xmm0
  por    %xmm1,%xmm0
  psubd  %xmm5,%xmm0
  paddd  %xmm0,%xmm2
  cmp    %rdx,%rax
  jne    L74
  movdqa %xmm2,%xmm0
  mov    %ebx,%esi
  psrldq $0x8,%xmm0
  and    $0xfffffffc,%esi
  paddd  %xmm0,%xmm2
  movdqa %xmm2,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm2
  movd   %xmm2,%eax
  test   $0x3,%bl
  je     L98
L48:
  movslq %esi,%r8
  mov    (%rdi,%r8,4),%edx
  mov    (%r12,%r8,4),%r9d
  lea    0x0(,%r8,4),%rcx
  cmp    %r9d,%edx
  cmovg  %r9d,%edx
  sub    0x0(%rbp,%r8,4),%edx
  add    %edx,%eax
  lea    0x1(%rsi),%edx
  cmp    %edx,%ebx
  jle    L98
  mov    0x4(%r12,%rcx,1),%edx
  mov    0x4(%rdi,%rcx,1),%r8d
  cmp    %r8d,%edx
  cmovg  %r8d,%edx
  add    $0x2,%esi
  sub    0x4(%rbp,%rcx,1),%edx
  add    %edx,%eax
  cmp    %ebx,%esi
  jge    L98
  mov    0x8(%rdi,%rcx,1),%edx
  mov    0x8(%r12,%rcx,1),%esi
  cmp    %esi,%edx
  cmovg  %esi,%edx
  sub    0x8(%rbp,%rcx,1),%edx
  add    %edx,%eax
L98:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L33:
  ret
L29:
  xor    %esi,%esi
  xor    %eax,%eax
  jmp    L48
  nop
L52:
  mov    (%r11),%eax
  mov    %eax,-0x4(%rdi,%r10,1)
  cmp    $0xffffffff,%r9d
  jne    L1
  mov    (%r12),%eax
  mov    (%rdi),%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  sub    0x0(%rbp),%eax
  jmp    L98
```

assistant: ```c
int trap_water(int *height, int height_size) {
  int *max_left, *max_right;
  int water = 0, i, n = height_size;
  if (n < 1) {
    return water;
  }
  max_left = (int *)malloc(sizeof(int) * n);
  max_right = (int *)malloc(sizeof(int) * n);
  max_left[0] = height[0];
  for (i = 1; i < n; ++i) {
    max_left[i] = (((max_left[i - 1]) < (height[i])) ? (height[i]) : (max_left[i - 1]));
  }
  max_right[n - 1] = height[n - 1];
  for (i = n - 2; i >= 0; --i) {
    max_right[i] = (((max_right[i + 1]) < (height[i])) ? (height[i]) : (max_right[i + 1]));
  }
  for (i = 0; i < n; ++i) {
    water += (((max_left[i]) > (max_right[i])) ? (max_right[i]) : (max_left[i])) - height[i];
  }
  return water;
}
```