user: Converte this assembly snippet into its equivalent C code:

```asm
<kernel_dtrsv_t_1_lib4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x54(%rbp)
  mov    %esi,-0x58(%rbp)
  mov    %rdx,-0x60(%rbp)
  mov    %ecx,-0x64(%rbp)
  mov    %r8,-0x70(%rbp)
  cmpl   $0x0,-0x54(%rbp)
  jle    L2
  movl   $0x4,-0x40(%rbp)
  movl   $0x4,-0x3c(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x70(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movl   $0x1,-0x44(%rbp)
  cmpl   $0x4,-0x54(%rbp)
  jle    L113
  mov    -0x70(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movl   $0x4,-0x44(%rbp)
  mov    -0x64(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x40(%rbp),%eax
  add    $0x4,%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x60(%rbp)
  addq   $0x20,-0x70(%rbp)
  jmp    L54
L96:
  mov    -0x70(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x60(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x64(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x60(%rbp)
  addq   $0x20,-0x70(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x60(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x64(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x60(%rbp)
  addq   $0x20,-0x70(%rbp)
  addl   $0x8,-0x44(%rbp)
L54:
  mov    -0x54(%rbp),%eax
  sub    $0x7,%eax
  cmp    %eax,-0x44(%rbp)
  jl     L96
  jmp    L62
L40:
  mov    -0x70(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x60(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x64(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x60(%rbp)
  addq   $0x20,-0x70(%rbp)
  addl   $0x4,-0x44(%rbp)
L62:
  mov    -0x54(%rbp),%eax
  sub    $0x3,%eax
  cmp    %eax,-0x44(%rbp)
  jl     L40
  jmp    L75
L113:
  addq   $0x8,-0x60(%rbp)
  addq   $0x8,-0x70(%rbp)
  jmp    L75
L34:
  mov    -0x70(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x60(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  addq   $0x8,-0x60(%rbp)
  addq   $0x8,-0x70(%rbp)
  addl   $0x1,-0x44(%rbp)
L75:
  mov    -0x44(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L34
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x70(%rbp)
  cmpl   $0x0,-0x58(%rbp)
  je     L48
  mov    -0x70(%rbp),%rax
  movsd  (%rax),%xmm0
  subsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  -0x38(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L108
L48:
  mov    -0x70(%rbp),%rax
  movsd  (%rax),%xmm0
  subsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  movsd  (%rax),%xmm1
  movsd  -0x38(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L108
L2:
  nop
L108:
  pop    %rbp
  ret
```

assistant: ```c
void kernel_dtrsv_t_1_lib4(int kmax, int inverted_diag, double *A, int sda, double *x) {
  if (kmax <= 0)
    return;
  const int lda = 4;
  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;
  k = 1;
  if (kmax > 4) {
    x_1 = x[1];
    x_2 = x[2];
    x_3 = x[3];
    y_0 += A[1 + lda * 0] * x_1;
    y_0 += A[2 + lda * 0] * x_2;
    y_0 += A[3 + lda * 0] * x_3;
    k = 4;
    A += 4 + (sda - 1) * lda;
    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 + lda * 0] * x_0;
      y_0 += A[1 + lda * 0] * x_1;
      y_0 += A[2 + lda * 0] * x_2;
      y_0 += A[3 + lda * 0] * 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 + lda * 0] * x_0;
      y_0 += A[1 + lda * 0] * x_1;
      y_0 += A[2 + lda * 0] * x_2;
      y_0 += A[3 + lda * 0] * 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 + lda * 0] * x_0;
      y_0 += A[1 + lda * 0] * x_1;
      y_0 += A[2 + lda * 0] * x_2;
      y_0 += A[3 + lda * 0] * x_3;
      A += sda * bs;
      x += 4;
    }
  } else {
    A += 1;
    x += 1;
  }
  for (; k < kmax; k++) {
    x_0 = x[0];
    y_0 += A[0 + lda * 0] * x_0;
    A += 1;
    x += 1;
  }
  A = tA;
  x = tx;
  if (inverted_diag) {
    y_0 = x[0] - y_0;
    y_0 *= A[0 + lda * 0];
    x[0] = y_0;
  } else {
    y_0 = x[0] - y_0;
    y_0 /= A[0 + lda * 0];
    x[0] = y_0;
  }
}
```