user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_max_sum_without_consecutive_elements_v2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L104
  cmpl   $0x0,-0x2c(%rbp)
  js     L104
  cmpl   $0x0,-0x30(%rbp)
  js     L104
  mov    -0x2c(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jle    L162
L104:
  mov    $0x0,%eax
  jmp    L119
L162:
  mov    -0x2c(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jne    L38
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L119
L38:
  mov    -0x30(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L135
  mov    $0x0,%eax
  jmp    L119
L135:
  mov    -0x30(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,(%rax)
  movl   $0x1,-0x18(%rbp)
  jmp    L117
L85:
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  cmpl   $0x1,-0x18(%rbp)
  jle    L94
  mov    -0x18(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L89
L20:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jle    L131
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
L131:
  subl   $0x1,-0x14(%rbp)
L89:
  cmpl   $0x0,-0x14(%rbp)
  jns    L20
  jmp    L168
L94:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jle    L168
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
L168:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x18(%rbp)
L117:
  mov    -0x18(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jle    L85
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%eax
L119:
  leave
  ret
```

assistant: ```c
int get_max_sum_without_consecutive_elements_v2(int *array, int low, int high) {
  int index, inner_index, max, temp_max;
  int *max_array;
  if (!array || (low < 0) || (high < 0) || (low > high)) {
    return (0);
  }
  if (low == high) {
    return (array[low]);
  }
  max_array = (int *)malloc(sizeof(int) * (high - low + 1));
  if (!max_array) {
    return (0);
  }
  memset(max_array, 0, sizeof(int) * (high - low + 1));
  max_array[0] = array[0];
  for (index = 1; index <= high; ++index) {
    max = max_array[index - 1];
    if ((index - 2) >= 0) {
      for (inner_index = index - 2; inner_index >= 0; --inner_index) {
        temp_max = array[index] + max_array[inner_index];
        if (temp_max > max) {
          max = temp_max;
        }
      }
    } else {
      temp_max = array[index];
      if (temp_max > max) {
        max = temp_max;
      }
    }
    max_array[index] = max;
  }
  max = max_array[high];
  free(max_array);
  return (max);
}
```