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

```asm
<kernel_dtrsv_t_3_lib4_new>:
  endbr64
  test   %edi,%edi
  jle    L65
  push   %r15
  mov    %edi,%r10d
  mov    %rsi,%r11
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  cmp    $0x4,%edi
  jg     L64
  pxor   %xmm0,%xmm0
  lea    0x18(%rsi),%rsi
  lea    0x8(%r9),%rbp
  mov    $0x3,%r13d
  movapd %xmm0,%xmm2
  movapd %xmm0,%xmm1
L41:
  cmp    %r10d,%r13d
  jge    L57
  sub    %r13d,%r10d
  cmp    $0x1,%r10d
  je     L39
  mov    %r10d,%r12d
  lea    0x20(%rsi),%r13
  lea    0x40(%rsi),%rcx
  shr    %r12d
  lea    -0x1(%r12),%eax
  cmp    $0x1,%eax
  jbe    L133
  lea    -0x3(%r12),%eax
  movupd 0x30(%rsi),%xmm5
  movupd 0x20(%rsi),%xmm3
  mov    %rbp,%rdi
  and    $0xfffffffe,%eax
  mov    $0x2,%r15d
  add    $0x4,%eax
L83:
  movupd (%rdi),%xmm4
  movupd -0x40(%rcx),%xmm6
  mov    %r15d,%edx
  add    $0x2,%r15d
  lea    -0x20(%rcx),%r14
  mov    %rcx,%r13
  add    $0x20,%rdi
  add    $0x20,%rcx
  mulpd  %xmm4,%xmm6
  addsd  %xmm6,%xmm1
  unpckhpd %xmm6,%xmm6
  addsd  %xmm1,%xmm6
  movapd %xmm3,%xmm1
  movupd -0x20(%rcx),%xmm3
  mulpd  %xmm4,%xmm1
  mulpd  %xmm3,%xmm4
  movapd %xmm1,%xmm7
  unpckhpd %xmm1,%xmm1
  addsd  %xmm4,%xmm0
  addsd  %xmm2,%xmm7
  unpckhpd %xmm4,%xmm4
  addsd  %xmm1,%xmm7
  addsd  %xmm0,%xmm4
  movupd -0x50(%rcx),%xmm1
  movupd -0x10(%rdi),%xmm0
  mulpd  %xmm0,%xmm1
  mulpd  %xmm0,%xmm5
  movapd %xmm1,%xmm2
  unpckhpd %xmm1,%xmm1
  addsd  %xmm6,%xmm2
  addsd  %xmm2,%xmm1
  movapd %xmm5,%xmm2
  unpckhpd %xmm5,%xmm5
  addsd  %xmm7,%xmm2
  addsd  %xmm5,%xmm2
  movupd -0x10(%rcx),%xmm5
  mulpd  %xmm5,%xmm0
  addsd  %xmm0,%xmm4
  unpckhpd %xmm0,%xmm0
  addsd  %xmm4,%xmm0
  cmp    %r15d,%eax
  jne    L83
L13:
  xor    %eax,%eax
  nop
L116:
  movupd (%rdi,%rax,1),%xmm4
  movupd (%r14,%rax,1),%xmm3
  add    $0x1,%edx
  mulpd  %xmm4,%xmm3
  addsd  %xmm3,%xmm1
  unpckhpd %xmm3,%xmm3
  addsd  %xmm3,%xmm1
  movupd 0x0(%r13,%rax,1),%xmm3
  mulpd  %xmm4,%xmm3
  addsd  %xmm3,%xmm2
  unpckhpd %xmm3,%xmm3
  addsd  %xmm3,%xmm2
  movupd (%rcx,%rax,1),%xmm3
  add    $0x10,%rax
  mulpd  %xmm4,%xmm3
  addsd  %xmm3,%xmm0
  unpckhpd %xmm3,%xmm3
  addsd  %xmm3,%xmm0
  cmp    %edx,%r12d
  ja     L116
  mov    %r10d,%edx
  and    $0xfffffffe,%edx
  mov    %edx,%eax
  shl    $0x3,%rax
  add    %rax,%rsi
  add    %rax,%rbp
  cmp    %r10d,%edx
  je     L57
L39:
  movsd  0x0(%rbp),%xmm3
  movsd  (%rsi),%xmm4
  mulsd  %xmm3,%xmm4
  addsd  %xmm4,%xmm1
  movsd  0x20(%rsi),%xmm4
  mulsd  %xmm3,%xmm4
  mulsd  0x40(%rsi),%xmm3
  addsd  %xmm4,%xmm2
  addsd  %xmm3,%xmm0
L57:
  movsd  0x10(%r9),%xmm3
  movsd  0x8(%r9),%xmm4
  movsd  (%r9),%xmm5
  subsd  %xmm0,%xmm3
  test   %ebx,%ebx
  je     L66
  mulsd  0x10(%r8),%xmm3
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  movsd  %xmm3,0x10(%r9)
  movsd  0x10(%r11),%xmm0
  mulsd  %xmm3,%xmm0
  mulsd  0x30(%r11),%xmm3
  addsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm3
  subsd  %xmm3,%xmm4
  mulsd  0x8(%r8),%xmm4
  movsd  %xmm4,0x8(%r9)
  mulsd  0x8(%r11),%xmm4
  subsd  %xmm4,%xmm5
  subsd  %xmm0,%xmm5
  mulsd  (%r8),%xmm5
  movsd  %xmm5,(%r9)
  ret
  nopl   (%rax)
L64:
  movsd  0x18(%rsi),%xmm1
  shl    $0x2,%edx
  pxor   %xmm3,%xmm3
  lea    0x20(%r9),%rbp
  movsd  0x18(%r9),%xmm0
  movsd  0x38(%rsi),%xmm2
  movslq %edx,%rdi
  lea    0x0(,%rdi,8),%r12
  mulsd  %xmm0,%xmm1
  mulsd  %xmm0,%xmm2
  mulsd  0x58(%rsi),%xmm0
  lea    (%rsi,%r12,1),%rsi
  addsd  %xmm3,%xmm1
  addsd  %xmm3,%xmm2
  addsd  %xmm3,%xmm0
  cmp    $0xb,%r10d
  jle    L93
  lea    -0xc(%r10),%r14d
  shl    $0x4,%rdi
  lea    (%rsi,%r12,1),%rdx
  mov    %rbp,%rcx
  shr    $0x3,%r14d
  mov    %r14d,%r15d
  mov    %r15,%rax
  shl    $0x6,%rax
  lea    0x60(%r9,%rax,1),%r13
  mov    %rsi,%rax
  nopw   0x0(%rax,%rax,1)
L107:
  movsd  (%rcx),%xmm6
  movsd  (%rax),%xmm7
  add    $0x40,%rcx
  movsd  -0x38(%rcx),%xmm5
  movsd  -0x30(%rcx),%xmm4
  mulsd  %xmm6,%xmm7
  movsd  -0x28(%rcx),%xmm3
  addsd  %xmm1,%xmm7
  movsd  0x20(%rax),%xmm1
  mulsd  %xmm6,%xmm1
  mulsd  0x40(%rax),%xmm6
  addsd  %xmm2,%xmm1
  movsd  0x28(%rax),%xmm2
  addsd  %xmm0,%xmm6
  movsd  0x8(%rax),%xmm0
  mulsd  %xmm5,%xmm2
  mulsd  %xmm5,%xmm0
  mulsd  0x48(%rax),%xmm5
  addsd  %xmm1,%xmm2
  movsd  0x10(%rax),%xmm1
  addsd  %xmm7,%xmm0
  movsd  0x38(%rax),%xmm7
  mulsd  %xmm4,%xmm1
  addsd  %xmm6,%xmm5
  movsd  (%rdx),%xmm6
  mulsd  %xmm3,%xmm7
  addsd  %xmm0,%xmm1
  movsd  0x30(%rax),%xmm0
  mulsd  %xmm4,%xmm0
  mulsd  0x50(%rax),%xmm4
  addsd  %xmm2,%xmm0
  movsd  -0x18(%rcx),%xmm2
  addsd  %xmm5,%xmm4
  movsd  0x18(%rax),%xmm5
  mulsd  %xmm3,%xmm5
  addsd  %xmm0,%xmm7
  movsd  -0x8(%rcx),%xmm0
  mulsd  0x58(%rax),%xmm3
  add    %rdi,%rax
  addsd  %xmm1,%xmm5
  movsd  -0x10(%rcx),%xmm1
  addsd  %xmm3,%xmm4
  movsd  -0x20(%rcx),%xmm3
  mulsd  %xmm3,%xmm6
  addsd  %xmm5,%xmm6
  movsd  0x20(%rdx),%xmm5
  mulsd  %xmm3,%xmm5
  mulsd  0x40(%rdx),%xmm3
  addsd  %xmm7,%xmm5
  addsd  %xmm4,%xmm3
  movsd  0x8(%rdx),%xmm4
  mulsd  %xmm2,%xmm4
  addsd  %xmm6,%xmm4
  movsd  0x28(%rdx),%xmm6
  mulsd  %xmm2,%xmm6
  mulsd  0x48(%rdx),%xmm2
  addsd  %xmm5,%xmm6
  movsd  0x10(%rdx),%xmm5
  addsd  %xmm3,%xmm2
  mulsd  %xmm1,%xmm5
  addsd  %xmm4,%xmm5
  movsd  0x30(%rdx),%xmm4
  mulsd  %xmm1,%xmm4
  mulsd  0x50(%rdx),%xmm1
  addsd  %xmm6,%xmm4
  addsd  %xmm2,%xmm1
  movsd  0x38(%rdx),%xmm2
  mulsd  %xmm0,%xmm2
  movapd %xmm1,%xmm3
  movsd  0x18(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  mulsd  0x58(%rdx),%xmm0
  add    %rdi,%rdx
  addsd  %xmm4,%xmm2
  addsd  %xmm5,%xmm1
  addsd  %xmm3,%xmm0
  cmp    %r13,%rcx
  jne    L107
  lea    0x1(%r15),%rax
  lea    0xc(,%r14,8),%r13d
  imul   %rax,%rdi
  shl    $0x6,%rax
  add    %rax,%rbp
  add    %rdi,%rsi
L7:
  lea    -0x3(%r10),%eax
  cmp    %eax,%r13d
  jge    L41
  lea    -0x4(%r10),%r14d
  mov    %rsi,%rax
  mov    %rbp,%rdx
  xor    %ecx,%ecx
  sub    %r13d,%r14d
  shr    $0x2,%r14d
  lea    0x1(%r14),%edi
  nopw   0x0(%rax,%rax,1)
L12:
  movupd (%rdx),%xmm9
  movupd (%rax),%xmm3
  add    $0x1,%ecx
  add    $0x20,%rdx
  movupd -0x10(%rdx),%xmm6
  movupd 0x10(%rax),%xmm8
  mulpd  %xmm9,%xmm3
  movupd 0x30(%rax),%xmm7
  movupd 0x50(%rax),%xmm10
  mulpd  %xmm6,%xmm8
  mulpd  %xmm6,%xmm7
  mulpd  %xmm10,%xmm6
  addsd  %xmm3,%xmm1
  unpckhpd %xmm3,%xmm3
  movapd %xmm3,%xmm5
  movupd 0x20(%rax),%xmm3
  mulpd  %xmm9,%xmm3
  addsd  %xmm1,%xmm5
  movapd %xmm8,%xmm1
  unpckhpd %xmm8,%xmm8
  addsd  %xmm5,%xmm1
  addsd  %xmm3,%xmm2
  unpckhpd %xmm3,%xmm3
  movapd %xmm3,%xmm4
  movupd 0x40(%rax),%xmm3
  addsd  %xmm8,%xmm1
  add    %r12,%rax
  mulpd  %xmm9,%xmm3
  addsd  %xmm2,%xmm4
  movapd %xmm7,%xmm2
  unpckhpd %xmm7,%xmm7
  addsd  %xmm4,%xmm2
  addsd  %xmm3,%xmm0
  unpckhpd %xmm3,%xmm3
  addsd  %xmm7,%xmm2
  addsd  %xmm0,%xmm3
  movapd %xmm6,%xmm0
  unpckhpd %xmm6,%xmm6
  addsd  %xmm3,%xmm0
  addsd  %xmm6,%xmm0
  cmp    %ecx,%edi
  ja     L12
  imul   %rdi,%r12
  shl    $0x5,%rdi
  lea    0x4(%r13,%r14,4),%r13d
  add    %rdi,%rbp
  add    %r12,%rsi
  jmp    L41
  nopw   0x0(%rax,%rax,1)
L66:
  divsd  0x50(%r11),%xmm3
  movsd  %xmm3,0x10(%r9)
  pop    %rbx
  pop    %rbp
  movsd  0x10(%r11),%xmm0
  pop    %r12
  pop    %r13
  pop    %r14
  mulsd  %xmm3,%xmm0
  pop    %r15
  mulsd  0x30(%r11),%xmm3
  addsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm3
  subsd  %xmm3,%xmm4
  divsd  0x28(%r11),%xmm4
  movsd  %xmm4,0x8(%r9)
  mulsd  0x8(%r11),%xmm4
  subsd  %xmm4,%xmm5
  subsd  %xmm0,%xmm5
  divsd  (%r11),%xmm5
  movsd  %xmm5,(%r9)
  ret
  nopw   0x0(%rax,%rax,1)
L65:
  ret
L133:
  mov    %rsi,%r14
  mov    %rbp,%rdi
  xor    %edx,%edx
  jmp    L13
L93:
  mov    $0x4,%r13d
  jmp    L7
```

assistant: ```c
void kernel_dtrsv_t_3_lib4_new(int kmax, double *A, int sda, int use_inv_diag_A, double *inv_diag_A, double *x) {
  if (kmax <= 0)
    return;
  const int bs = 4;
  int k;
  double *tA, *tx;
  tA = A;
  tx = x;
  double x_0, x_1, x_2, x_3, y_0 = 0, y_1 = 0, y_2 = 0;
  k = 3;
  if (kmax > 4) {
    x_3 = x[3];
    y_0 += A[3 + bs * 0] * x_3;
    y_1 += A[3 + bs * 1] * x_3;
    y_2 += A[3 + bs * 2] * x_3;
    k = 4;
    A += 4 + (sda - 1) * bs;
    x += 4;
    for (; k < kmax - 7; k += 8) {
      x_0 = x[0];
      x_1 = x[1];
      x_2 = x[2];
      x_3 = x[3];
      y_0 += A[0 + bs * 0] * x_0;
      y_1 += A[0 + bs * 1] * x_0;
      y_2 += A[0 + bs * 2] * x_0;
      y_0 += A[1 + bs * 0] * x_1;
      y_1 += A[1 + bs * 1] * x_1;
      y_2 += A[1 + bs * 2] * x_1;
      y_0 += A[2 + bs * 0] * x_2;
      y_1 += A[2 + bs * 1] * x_2;
      y_2 += A[2 + bs * 2] * x_2;
      y_0 += A[3 + bs * 0] * x_3;
      y_1 += A[3 + bs * 1] * x_3;
      y_2 += A[3 + bs * 2] * x_3;
      A += sda * bs;
      x += 4;
      x_0 = x[0];
      x_1 = x[1];
      x_2 = x[2];
      x_3 = x[3];
      y_0 += A[0 + bs * 0] * x_0;
      y_1 += A[0 + bs * 1] * x_0;
      y_2 += A[0 + bs * 2] * x_0;
      y_0 += A[1 + bs * 0] * x_1;
      y_1 += A[1 + bs * 1] * x_1;
      y_2 += A[1 + bs * 2] * x_1;
      y_0 += A[2 + bs * 0] * x_2;
      y_1 += A[2 + bs * 1] * x_2;
      y_2 += A[2 + bs * 2] * x_2;
      y_0 += A[3 + bs * 0] * x_3;
      y_1 += A[3 + bs * 1] * x_3;
      y_2 += A[3 + bs * 2] * x_3;
      A += sda * bs;
      x += 4;
    }
    for (; k < kmax - 3; k += 4) {
      x_0 = x[0];
      x_1 = x[1];
      x_2 = x[2];
      x_3 = x[3];
      y_0 += A[0 + bs * 0] * x_0;
      y_1 += A[0 + bs * 1] * x_0;
      y_2 += A[0 + bs * 2] * x_0;
      y_0 += A[1 + bs * 0] * x_1;
      y_1 += A[1 + bs * 1] * x_1;
      y_2 += A[1 + bs * 2] * x_1;
      y_0 += A[2 + bs * 0] * x_2;
      y_1 += A[2 + bs * 1] * x_2;
      y_2 += A[2 + bs * 2] * x_2;
      y_0 += A[3 + bs * 0] * x_3;
      y_1 += A[3 + bs * 1] * x_3;
      y_2 += A[3 + bs * 2] * x_3;
      A += sda * bs;
      x += 4;
    }
  } else {
    A += 3;
    x += 1;
  }
  for (; k < kmax; k++) {
    x_0 = x[0];
    y_0 += A[0 + bs * 0] * x_0;
    y_1 += A[0 + bs * 1] * x_0;
    y_2 += A[0 + bs * 2] * x_0;
    A += 1;
    x += 1;
  }
  A = tA;
  x = tx;
  if (use_inv_diag_A) {
    y_2 = x[2] - y_2;
    y_2 *= inv_diag_A[2];
    x[2] = y_2;
    y_0 += A[2 + bs * 0] * y_2;
    y_1 += A[2 + bs * 1] * y_2;
    y_1 = x[1] - y_1;
    y_1 *= inv_diag_A[1];
    x[1] = y_1;
    y_0 = x[0] - A[1 + bs * 0] * y_1 - y_0;
    y_0 *= inv_diag_A[0];
    x[0] = y_0;
  } else {
    y_2 = x[2] - y_2;
    y_2 /= A[2 + bs * 2];
    x[2] = y_2;
    y_0 += A[2 + bs * 0] * y_2;
    y_1 += A[2 + bs * 1] * y_2;
    y_1 = x[1] - y_1;
    y_1 /= A[1 + bs * 1];
    x[1] = y_1;
    y_0 = x[0] - A[1 + bs * 0] * y_1 - y_0;
    y_0 /= A[0 + bs * 0];
    x[0] = y_0;
  }
}
```