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

```asm
<kernel_dgema_3_lib4>:
  endbr64
  push   %rbx
  mov    %esi,%ebx
  mov    %ecx,%r10d
  mov    %rdx,%rsi
  lea    -0x3(%rdi),%r11d
  test   %ebx,%ebx
  je     L131
  cmp    $0x1,%ebx
  je     L222
  cmp    $0x2,%ebx
  je     L42
  xor    %eax,%eax
  test   %r11d,%r11d
  jle    L296
  shl    $0x2,%r9d
  shl    $0x2,%r10d
  mov    %r8,%rdx
  mov    %rsi,%rax
  movslq %r9d,%r9
  movslq %r10d,%r10
  xor    %ecx,%ecx
  shl    $0x3,%r9
  shl    $0x3,%r10
  nopl   0x0(%rax)
L248:
  movsd  (%rax),%xmm0
  add    $0x4,%ecx
  movsd  %xmm0,0x8(%rdx)
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x10(%rdx)
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x18(%rdx)
  movsd  0x20(%rax),%xmm0
  movsd  %xmm0,0x28(%rdx)
  movsd  0x28(%rax),%xmm0
  movsd  %xmm0,0x30(%rdx)
  movsd  0x30(%rax),%xmm0
  movsd  %xmm0,0x38(%rdx)
  movsd  0x40(%rax),%xmm0
  movsd  %xmm0,0x48(%rdx)
  movsd  0x48(%rax),%xmm0
  movsd  %xmm0,0x50(%rdx)
  movsd  0x50(%rax),%xmm0
  movsd  %xmm0,0x58(%rdx)
  movsd  0x18(%rax),%xmm0
  add    %r9,%rdx
  movsd  %xmm0,(%rdx)
  movsd  0x38(%rax),%xmm0
  movsd  %xmm0,0x20(%rdx)
  movsd  0x58(%rax),%xmm0
  add    %r10,%rax
  movsd  %xmm0,0x40(%rdx)
  cmp    %ecx,%r11d
  jg     L248
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  lea    0x1(%rax),%edx
  imul   %rdx,%r9
  mov    %rdx,%rax
  imul   %rdx,%r10
  shl    $0x2,%eax
  add    %r9,%r8
  add    %r10,%rsi
L296:
  cmp    %eax,%edi
  jle    L102
  movsd  (%rsi),%xmm0
  lea    0x1(%rax),%edx
  movsd  %xmm0,0x8(%r8)
  movsd  0x20(%rsi),%xmm0
  movsd  %xmm0,0x28(%r8)
  movsd  0x40(%rsi),%xmm0
  movsd  %xmm0,0x48(%r8)
  cmp    %edx,%edi
  je     L102
  movsd  0x8(%rsi),%xmm0
  add    $0x2,%eax
  movsd  %xmm0,0x10(%r8)
  movsd  0x28(%rsi),%xmm0
  movsd  %xmm0,0x30(%r8)
  movsd  0x48(%rsi),%xmm0
  movsd  %xmm0,0x50(%r8)
  cmp    %eax,%edi
  je     L102
  movsd  0x10(%rsi),%xmm0
  movsd  %xmm0,0x18(%r8)
  movsd  0x30(%rsi),%xmm0
  movsd  %xmm0,0x38(%r8)
  movsd  0x50(%rsi),%xmm0
  movsd  %xmm0,0x58(%r8)
L102:
  pop    %rbx
  ret
  nopl   0x0(%rax,%rax,1)
L222:
  test   %r11d,%r11d
  jle    L10
  lea    0x0(,%r9,4),%ebx
  mov    %r8,%rdx
  mov    %rsi,%rax
  xor    %ecx,%ecx
  shl    $0x2,%r10d
  movslq %ebx,%rbx
  movslq %r10d,%r10
  shl    $0x3,%rbx
  shl    $0x3,%r10
  nopl   0x0(%rax,%rax,1)
L260:
  movsd  (%rax),%xmm0
  add    $0x4,%ecx
  movsd  %xmm0,0x18(%rdx)
  movsd  0x20(%rax),%xmm0
  movsd  %xmm0,0x38(%rdx)
  movsd  0x40(%rax),%xmm0
  movsd  %xmm0,0x58(%rdx)
  movsd  0x8(%rax),%xmm0
  add    %rbx,%rdx
  movsd  %xmm0,(%rdx)
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,0x10(%rdx)
  movsd  0x28(%rax),%xmm0
  movsd  %xmm0,0x20(%rdx)
  movsd  0x30(%rax),%xmm0
  movsd  %xmm0,0x28(%rdx)
  movsd  0x38(%rax),%xmm0
  movsd  %xmm0,0x30(%rdx)
  movsd  0x48(%rax),%xmm0
  movsd  %xmm0,0x40(%rdx)
  movsd  0x50(%rax),%xmm0
  movsd  %xmm0,0x48(%rdx)
  movsd  0x58(%rax),%xmm0
  add    %r10,%rax
  movsd  %xmm0,0x50(%rdx)
  cmp    %ecx,%r11d
  jg     L260
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  lea    0x1(%rax),%edx
  imul   %rdx,%rbx
  mov    %rdx,%rax
  imul   %rdx,%r10
  shl    $0x2,%eax
  add    %rbx,%r8
  add    %r10,%rsi
L46:
  cmp    %eax,%edi
  jle    L102
  movsd  (%rsi),%xmm0
  lea    0x1(%rax),%edx
  movsd  %xmm0,0x18(%r8)
  movsd  0x20(%rsi),%xmm0
  movsd  %xmm0,0x38(%r8)
  movsd  0x40(%rsi),%xmm0
  movsd  %xmm0,0x58(%r8)
  cmp    %edx,%edi
  je     L102
  lea    0x0(,%r9,4),%ecx
  movsd  0x8(%rsi),%xmm0
  add    $0x2,%eax
  movslq %ecx,%rcx
  lea    (%r8,%rcx,8),%rdx
  movsd  %xmm0,(%rdx)
  movsd  0x28(%rsi),%xmm0
  movsd  %xmm0,0x20(%rdx)
  movsd  0x48(%rsi),%xmm0
  movsd  %xmm0,0x40(%rdx)
  cmp    %eax,%edi
  je     L102
  movsd  0x10(%rsi),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x30(%rsi),%xmm0
  movsd  %xmm0,0x28(%rdx)
  movsd  0x50(%rsi),%xmm0
  movsd  %xmm0,0x48(%rdx)
  pop    %rbx
  ret
  nopw   0x0(%rax,%rax,1)
L131:
  test   %r11d,%r11d
  jle    L164
  shl    $0x2,%r10d
  lea    0x0(,%r9,4),%ecx
  mov    %r8,%rdx
  mov    %rsi,%rax
  movslq %r10d,%r10
  movslq %ecx,%rcx
  shl    $0x3,%r10
  shl    $0x3,%rcx
  nopl   0x0(%rax)
L135:
  movsd  (%rax),%xmm0
  add    $0x4,%ebx
  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)
  movsd  0x20(%rax),%xmm0
  movsd  %xmm0,0x20(%rdx)
  movsd  0x28(%rax),%xmm0
  movsd  %xmm0,0x28(%rdx)
  movsd  0x30(%rax),%xmm0
  movsd  %xmm0,0x30(%rdx)
  movsd  0x38(%rax),%xmm0
  movsd  %xmm0,0x38(%rdx)
  movsd  0x40(%rax),%xmm0
  movsd  %xmm0,0x40(%rdx)
  movsd  0x48(%rax),%xmm0
  movsd  %xmm0,0x48(%rdx)
  movsd  0x50(%rax),%xmm0
  movsd  %xmm0,0x50(%rdx)
  movsd  0x58(%rax),%xmm0
  add    %r10,%rax
  movsd  %xmm0,0x58(%rdx)
  add    %rcx,%rdx
  cmp    %ebx,%r11d
  jg     L135
  lea    -0x4(%rdi),%ebx
  mov    %r10,%rax
  shr    $0x2,%ebx
  lea    0x1(%rbx),%edx
  imul   %rdx,%rax
  mov    %rdx,%rbx
  imul   %rdx,%rcx
  shl    $0x2,%ebx
  add    %rax,%rsi
  add    %rcx,%r8
L164:
  cmp    %ebx,%edi
  jle    L102
  lea    0x30(%rsi),%rax
  mov    %edi,%edx
  lea    0x50(%r8),%r9
  sub    %ebx,%edx
  lea    0x20(%rsi),%rcx
  lea    0x40(%rsi),%r10
  cmp    %rax,%r8
  setae  %al
  cmp    %rcx,%r9
  setbe  %cl
  or     %ecx,%eax
  lea    0x50(%rsi),%rcx
  cmp    %rcx,%r8
  setae  %cl
  cmp    %r10,%r9
  setbe  %r9b
  or     %r9d,%ecx
  and    %ecx,%eax
  lea    -0x1(%rdx),%ecx
  cmp    $0x1,%ecx
  seta   %cl
  test   %cl,%al
  je     L230
  mov    %r8,%rax
  sub    %rsi,%rax
  add    $0x38,%rax
  cmp    $0x40,%rax
  jbe    L230
  movupd (%rsi),%xmm1
  mov    %edx,%eax
  shr    %eax
  movups %xmm1,(%r8)
  movupd 0x20(%rsi),%xmm2
  movups %xmm2,0x20(%r8)
  movupd 0x40(%rsi),%xmm3
  movups %xmm3,0x40(%r8)
  cmp    $0x1,%eax
  je     L86
  movupd 0x10(%rsi),%xmm4
  movups %xmm4,0x10(%r8)
  movupd 0x30(%rsi),%xmm5
  movups %xmm5,0x30(%r8)
  movupd 0x50(%rsi),%xmm6
  movups %xmm6,0x50(%r8)
L86:
  mov    %edx,%ecx
  and    $0xfffffffe,%ecx
  mov    %ecx,%eax
  shl    $0x3,%rax
  add    %rax,%rsi
  add    %r8,%rax
  cmp    %ecx,%edx
  je     L102
  movsd  (%rsi),%xmm0
  movsd  %xmm0,(%rax)
  movsd  0x20(%rsi),%xmm0
  movsd  %xmm0,0x20(%rax)
  movsd  0x40(%rsi),%xmm0
  movsd  %xmm0,0x40(%rax)
  pop    %rbx
  ret
  nopw   0x0(%rax,%rax,1)
L42:
  test   %r11d,%r11d
  jle    L258
  shl    $0x2,%r10d
  lea    0x0(,%r9,4),%ebx
  mov    %r8,%rdx
  mov    %rsi,%rax
  movslq %r10d,%rcx
  movslq %ebx,%rbx
  xor    %r10d,%r10d
  shl    $0x3,%rbx
  shl    $0x3,%rcx
  nopl   0x0(%rax)
L48:
  movsd  (%rax),%xmm0
  add    $0x4,%r10d
  movsd  %xmm0,0x10(%rdx)
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x18(%rdx)
  movsd  0x20(%rax),%xmm0
  movsd  %xmm0,0x30(%rdx)
  movsd  0x28(%rax),%xmm0
  movsd  %xmm0,0x38(%rdx)
  movsd  0x40(%rax),%xmm0
  movsd  %xmm0,0x50(%rdx)
  movsd  0x48(%rax),%xmm0
  movsd  %xmm0,0x58(%rdx)
  movsd  0x10(%rax),%xmm0
  add    %rbx,%rdx
  movsd  %xmm0,(%rdx)
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x30(%rax),%xmm0
  movsd  %xmm0,0x20(%rdx)
  movsd  0x38(%rax),%xmm0
  movsd  %xmm0,0x28(%rdx)
  movsd  0x50(%rax),%xmm0
  movsd  %xmm0,0x40(%rdx)
  movsd  0x58(%rax),%xmm0
  add    %rcx,%rax
  movsd  %xmm0,0x48(%rdx)
  cmp    %r10d,%r11d
  jg     L48
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  lea    0x1(%rax),%edx
  imul   %rdx,%rbx
  mov    %rdx,%rax
  imul   %rdx,%rcx
  shl    $0x2,%eax
  add    %rbx,%r8
  add    %rcx,%rsi
L234:
  cmp    %eax,%edi
  jle    L102
  movsd  (%rsi),%xmm0
  lea    0x1(%rax),%edx
  movsd  %xmm0,0x10(%r8)
  movsd  0x20(%rsi),%xmm0
  movsd  %xmm0,0x30(%r8)
  movsd  0x40(%rsi),%xmm0
  movsd  %xmm0,0x50(%r8)
  cmp    %edx,%edi
  je     L102
  movsd  0x8(%rsi),%xmm0
  add    $0x2,%eax
  movsd  %xmm0,0x18(%r8)
  movsd  0x28(%rsi),%xmm0
  movsd  %xmm0,0x38(%r8)
  movsd  0x48(%rsi),%xmm0
  movsd  %xmm0,0x58(%r8)
  cmp    %eax,%edi
  je     L102
  lea    0x0(,%r9,4),%ecx
  movsd  0x18(%rsi),%xmm0
  movslq %ecx,%rcx
  lea    (%r8,%rcx,8),%rax
  movsd  %xmm0,(%rax)
  movsd  0x38(%rsi),%xmm0
  movsd  %xmm0,0x20(%rax)
  movsd  0x58(%rsi),%xmm0
  movsd  %xmm0,0x40(%rax)
  pop    %rbx
  ret
  nopl   0x0(%rax,%rax,1)
L230:
  movsd  (%rsi),%xmm0
  lea    0x1(%rbx),%eax
  movsd  %xmm0,(%r8)
  movsd  0x20(%rsi),%xmm0
  movsd  %xmm0,0x20(%r8)
  movsd  0x40(%rsi),%xmm0
  movsd  %xmm0,0x40(%r8)
  cmp    %eax,%edi
  jle    L102
  movsd  0x8(%rsi),%xmm0
  lea    0x2(%rbx),%eax
  movsd  %xmm0,0x8(%r8)
  movsd  0x28(%rsi),%xmm0
  movsd  %xmm0,0x28(%r8)
  movsd  0x48(%rsi),%xmm0
  movsd  %xmm0,0x48(%r8)
  cmp    %eax,%edi
  jle    L102
  movsd  0x10(%rsi),%xmm0
  add    $0x3,%ebx
  movsd  %xmm0,0x10(%r8)
  movsd  0x30(%rsi),%xmm0
  movsd  %xmm0,0x30(%r8)
  movsd  0x50(%rsi),%xmm0
  movsd  %xmm0,0x50(%r8)
  cmp    %ebx,%edi
  jle    L102
  movsd  0x18(%rsi),%xmm0
  pop    %rbx
  movsd  %xmm0,0x18(%r8)
  movsd  0x38(%rsi),%xmm0
  movsd  %xmm0,0x38(%r8)
  movsd  0x58(%rsi),%xmm0
  movsd  %xmm0,0x58(%r8)
  ret
L10:
  xor    %eax,%eax
  jmp    L46
L258:
  xor    %eax,%eax
  jmp    L234
```

assistant: ```c
void kernel_dgema_3_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];
      C[0 + bs * 1] = A[0 + bs * 1];
      C[1 + bs * 1] = A[1 + bs * 1];
      C[2 + bs * 1] = A[2 + bs * 1];
      C[3 + bs * 1] = A[3 + bs * 1];
      C[0 + bs * 2] = A[0 + bs * 2];
      C[1 + bs * 2] = A[1 + bs * 2];
      C[2 + bs * 2] = A[2 + bs * 2];
      C[3 + bs * 2] = A[3 + bs * 2];
      A += bs * sda;
      C += bs * sdc;
    }
    for (; k < kmax; k++) {
      C[0 + bs * 0] = A[0 + bs * 0];
      C[0 + bs * 1] = A[0 + bs * 1];
      C[0 + bs * 2] = A[0 + bs * 2];
      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[3 + bs * 1] = A[0 + bs * 1];
      C[3 + bs * 2] = A[0 + bs * 2];
      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];
      C[0 + bs * 1] = A[1 + bs * 1];
      C[1 + bs * 1] = A[2 + bs * 1];
      C[2 + bs * 1] = A[3 + bs * 1];
      C[0 + bs * 2] = A[1 + bs * 2];
      C[1 + bs * 2] = A[2 + bs * 2];
      C[2 + bs * 2] = A[3 + bs * 2];
      A += bs * sda;
    }
    if (k >= kmax) {
      return;
    }
    C[3 + bs * 0] = A[0 + bs * 0];
    C[3 + bs * 1] = A[0 + bs * 1];
    C[3 + bs * 2] = A[0 + bs * 2];
    k++;
    if (k == kmax) {
      return;
    }
    C += bs * sdc;
    C[0 + bs * 0] = A[1 + bs * 0];
    C[0 + bs * 1] = A[1 + bs * 1];
    C[0 + bs * 2] = A[1 + bs * 2];
    k++;
    if (k == kmax) {
      return;
    }
    C[1 + bs * 0] = A[2 + bs * 0];
    C[1 + bs * 1] = A[2 + bs * 1];
    C[1 + bs * 2] = A[2 + bs * 2];
    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[2 + bs * 1] = A[0 + bs * 1];
      C[3 + bs * 1] = A[1 + bs * 1];
      C[2 + bs * 2] = A[0 + bs * 2];
      C[3 + bs * 2] = A[1 + bs * 2];
      C += bs * sdc;
      C[0 + bs * 0] = A[2 + bs * 0];
      C[1 + bs * 0] = A[3 + bs * 0];
      C[0 + bs * 1] = A[2 + bs * 1];
      C[1 + bs * 1] = A[3 + bs * 1];
      C[0 + bs * 2] = A[2 + bs * 2];
      C[1 + bs * 2] = A[3 + bs * 2];
      A += bs * sda;
    }
    if (k >= kmax) {
      return;
    }
    C[2 + bs * 0] = A[0 + bs * 0];
    C[2 + bs * 1] = A[0 + bs * 1];
    C[2 + bs * 2] = A[0 + bs * 2];
    k++;
    if (k == kmax) {
      return;
    }
    C[3 + bs * 0] = A[1 + bs * 0];
    C[3 + bs * 1] = A[1 + bs * 1];
    C[3 + bs * 2] = A[1 + bs * 2];
    k++;
    if (k == kmax) {
      return;
    }
    C += bs * sdc;
    C[0 + bs * 0] = A[3 + bs * 0];
    C[0 + bs * 1] = A[3 + bs * 1];
    C[0 + bs * 2] = A[3 + bs * 2];
    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[1 + bs * 1] = A[0 + bs * 1];
      C[2 + bs * 1] = A[1 + bs * 1];
      C[3 + bs * 1] = A[2 + bs * 1];
      C[1 + bs * 2] = A[0 + bs * 2];
      C[2 + bs * 2] = A[1 + bs * 2];
      C[3 + bs * 2] = A[2 + bs * 2];
      C += bs * sdc;
      C[0 + bs * 0] = A[3 + bs * 0];
      C[0 + bs * 1] = A[3 + bs * 1];
      C[0 + bs * 2] = A[3 + bs * 2];
      A += bs * sda;
    }
    if (k >= kmax) {
      return;
    }
    C[1 + bs * 0] = A[0 + bs * 0];
    C[1 + bs * 1] = A[0 + bs * 1];
    C[1 + bs * 2] = A[0 + bs * 2];
    k++;
    if (k == kmax) {
      return;
    }
    C[2 + bs * 0] = A[1 + bs * 0];
    C[2 + bs * 1] = A[1 + bs * 1];
    C[2 + bs * 2] = A[1 + bs * 2];
    k++;
    if (k == kmax) {
      return;
    }
    C[3 + bs * 0] = A[2 + bs * 0];
    C[3 + bs * 1] = A[2 + bs * 1];
    C[3 + bs * 2] = A[2 + bs * 2];
    return;
  }
}
```