user: What would the C source look like for the assembly code provided here?

```asm
<kernel_dgema_1_lib4>:
  endbr64
  push   %rbx
  mov    %esi,%ebx
  mov    %rdx,%rsi
  mov    %ecx,%r10d
  test   %ebx,%ebx
  je     L121
  cmp    $0x1,%ebx
  je     L86
  cmp    $0x2,%ebx
  je     L247
  lea    -0x3(%rdi),%r11d
  mov    $0x0,%eax
  test   %r11d,%r11d
  jle    L180
  shl    $0x2,%r9d
  movslq %r9d,%r9
  shl    $0x3,%r9
  shl    $0x2,%r10d
  movslq %r10d,%r10
  shl    $0x3,%r10
  mov    %r8,%rdx
  mov    %rsi,%rax
  mov    $0x0,%ecx
L254:
  movsd  (%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x10(%rdx)
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x18(%rdx)
  add    %r9,%rdx
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  add    %r10,%rax
  add    $0x4,%ecx
  cmp    %r11d,%ecx
  jl     L254
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  add    $0x1,%eax
  mov    %eax,%edx
  imul   %rdx,%r9
  add    %r9,%r8
  imul   %rdx,%r10
  add    %r10,%rsi
  shl    $0x2,%eax
L180:
  cmp    %eax,%edi
  jle    L159
  movsd  (%rsi),%xmm0
  movsd  %xmm0,0x8(%r8)
  lea    0x1(%rax),%edx
  cmp    %edx,%edi
  je     L159
  movsd  0x8(%rsi),%xmm0
  movsd  %xmm0,0x10(%r8)
  add    $0x2,%eax
  cmp    %eax,%edi
  je     L159
  movsd  0x10(%rsi),%xmm0
  movsd  %xmm0,0x18(%r8)
  jmp    L159
L121:
  lea    -0x3(%rdi),%r11d
  test   %r11d,%r11d
  jle    L109
  shl    $0x2,%r10d
  movslq %r10d,%r10
  shl    $0x3,%r10
  lea    0x0(,%r9,4),%ecx
  movslq %ecx,%rcx
  shl    $0x3,%rcx
  mov    %r8,%rdx
  mov    %rsi,%rax
L211:
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x10(%rdx)
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,0x18(%rdx)
  add    %r10,%rax
  add    %rcx,%rdx
  add    $0x4,%ebx
  cmp    %r11d,%ebx
  jl     L211
  lea    -0x4(%rdi),%ebx
  shr    $0x2,%ebx
  add    $0x1,%ebx
  mov    %ebx,%edx
  mov    %r10,%rax
  imul   %rdx,%rax
  add    %rax,%rsi
  imul   %rdx,%rcx
  add    %rcx,%r8
  shl    $0x2,%ebx
L109:
  cmp    %ebx,%edi
  jle    L159
  sub    $0x1,%edi
  sub    %ebx,%edi
  mov    $0x0,%eax
L166:
  movsd  (%rsi,%rax,8),%xmm0
  movsd  %xmm0,(%r8,%rax,8)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rdi,%rdx
  jne    L166
L159:
  pop    %rbx
  ret
L86:
  lea    -0x3(%rdi),%ebx
  test   %ebx,%ebx
  jle    L73
  lea    0x0(,%r9,4),%r11d
  movslq %r11d,%r11
  shl    $0x3,%r11
  shl    $0x2,%r10d
  movslq %r10d,%r10
  shl    $0x3,%r10
  mov    %r8,%rdx
  mov    %rsi,%rax
  mov    $0x0,%ecx
L266:
  movsd  (%rax),%xmm0
  movsd  %xmm0,0x18(%rdx)
  add    %r11,%rdx
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,0x10(%rdx)
  add    %r10,%rax
  add    $0x4,%ecx
  cmp    %ebx,%ecx
  jl     L266
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  add    $0x1,%eax
  mov    %eax,%edx
  imul   %rdx,%r11
  add    %r11,%r8
  imul   %rdx,%r10
  add    %r10,%rsi
  shl    $0x2,%eax
L14:
  cmp    %eax,%edi
  jle    L159
  movsd  (%rsi),%xmm0
  movsd  %xmm0,0x18(%r8)
  lea    0x1(%rax),%edx
  cmp    %edx,%edi
  je     L159
  lea    0x0(,%r9,4),%ecx
  movslq %ecx,%rcx
  lea    (%r8,%rcx,8),%rdx
  movsd  0x8(%rsi),%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x2,%eax
  cmp    %eax,%edi
  je     L159
  movsd  0x10(%rsi),%xmm0
  movsd  %xmm0,0x8(%rdx)
  jmp    L159
L73:
  mov    $0x0,%eax
  jmp    L14
L247:
  lea    -0x3(%rdi),%ebx
  test   %ebx,%ebx
  jle    L265
  lea    0x0(,%r9,4),%r11d
  movslq %r11d,%r11
  shl    $0x3,%r11
  shl    $0x2,%r10d
  movslq %r10d,%rcx
  shl    $0x3,%rcx
  mov    %r8,%rdx
  mov    %rsi,%rax
  mov    $0x0,%r10d
L177:
  movsd  (%rax),%xmm0
  movsd  %xmm0,0x10(%rdx)
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x18(%rdx)
  add    %r11,%rdx
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  add    %rcx,%rax
  add    $0x4,%r10d
  cmp    %ebx,%r10d
  jl     L177
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  add    $0x1,%eax
  mov    %eax,%edx
  imul   %rdx,%r11
  add    %r11,%r8
  imul   %rdx,%rcx
  add    %rcx,%rsi
  shl    $0x2,%eax
L233:
  cmp    %eax,%edi
  jle    L159
  movsd  (%rsi),%xmm0
  movsd  %xmm0,0x10(%r8)
  lea    0x1(%rax),%edx
  cmp    %edx,%edi
  je     L159
  movsd  0x8(%rsi),%xmm0
  movsd  %xmm0,0x18(%r8)
  add    $0x2,%eax
  cmp    %eax,%edi
  je     L159
  movsd  0x18(%rsi),%xmm0
  lea    0x0(,%r9,4),%ecx
  movslq %ecx,%rcx
  movsd  %xmm0,(%r8,%rcx,8)
  jmp    L159
L265:
  mov    $0x0,%eax
  jmp    L233
```

assistant: ```c
void kernel_dgema_1_lib4(int kmax, int kna, double *A, int sda, double *C, int sdc) {
  const int bs = 4;
  int k;
  if (kna == 0) {
    k = 0;
    for (; k < kmax - 3; k += 4) {
      C[0 + bs * 0] = A[0 + bs * 0];
      C[1 + bs * 0] = A[1 + bs * 0];
      C[2 + bs * 0] = A[2 + bs * 0];
      C[3 + bs * 0] = A[3 + bs * 0];
      A += bs * sda;
      C += bs * sdc;
    }
    for (; k < kmax; k++) {
      C[0 + bs * 0] = A[0 + bs * 0];
      A += 1;
      C += 1;
    }
    return;
  } else if (kna == 1) {
    k = 0;
    for (; k < kmax - 3; k += 4) {
      C[3 + bs * 0] = A[0 + bs * 0];
      C += bs * sdc;
      C[0 + bs * 0] = A[1 + bs * 0];
      C[1 + bs * 0] = A[2 + bs * 0];
      C[2 + bs * 0] = A[3 + bs * 0];
      A += bs * sda;
    }
    if (k >= kmax) {
      return;
    }
    C[3 + bs * 0] = A[0 + bs * 0];
    k++;
    if (k == kmax) {
      return;
    }
    C += bs * sdc;
    C[0 + bs * 0] = A[1 + bs * 0];
    k++;
    if (k == kmax) {
      return;
    }
    C[1 + bs * 0] = A[2 + bs * 0];
    return;
  } else if (kna == 2) {
    k = 0;
    for (; k < kmax - 3; k += 4) {
      C[2 + bs * 0] = A[0 + bs * 0];
      C[3 + bs * 0] = A[1 + bs * 0];
      C += bs * sdc;
      C[0 + bs * 0] = A[2 + bs * 0];
      C[1 + bs * 0] = A[3 + bs * 0];
      A += bs * sda;
    }
    if (k >= kmax) {
      return;
    }
    C[2 + bs * 0] = A[0 + bs * 0];
    k++;
    if (k == kmax) {
      return;
    }
    C[3 + bs * 0] = A[1 + bs * 0];
    k++;
    if (k == kmax) {
      return;
    }
    C += bs * sdc;
    C[0 + bs * 0] = A[3 + bs * 0];
    return;
  } else {
    k = 0;
    for (; k < kmax - 3; k += 4) {
      C[1 + bs * 0] = A[0 + bs * 0];
      C[2 + bs * 0] = A[1 + bs * 0];
      C[3 + bs * 0] = A[2 + bs * 0];
      C += bs * sdc;
      C[0 + bs * 0] = A[3 + bs * 0];
      A += bs * sda;
    }
    if (k >= kmax) {
      return;
    }
    C[1 + bs * 0] = A[0 + bs * 0];
    k++;
    if (k == kmax) {
      return;
    }
    C[2 + bs * 0] = A[1 + bs * 0];
    k++;
    if (k == kmax) {
      return;
    }
    C[3 + bs * 0] = A[2 + bs * 0];
    return;
  }
}
```