user: Demonstrate the C code that generates the assembly output below:

```asm
<kernel_dgema_1_lib4>:
  endbr64
  mov    %esi,%eax
  push   %rbp
  mov    %rdx,%r10
  lea    -0x3(%rdi),%esi
  push   %rbx
  mov    %ecx,%ebx
  test   %eax,%eax
  je     L202
  cmp    $0x1,%eax
  je     L241
  cmp    $0x2,%eax
  je     L33
  xor    %eax,%eax
  test   %esi,%esi
  jle    L64
  lea    0x0(,%rcx,4),%r11d
  shl    $0x2,%r9d
  mov    %r8,%rdx
  mov    %r10,%rax
  movslq %r9d,%r9
  movslq %r11d,%r11
  xor    %ecx,%ecx
  shl    $0x3,%r9
  shl    $0x3,%r11
  cmp    $0x1,%ebx
  jne    L399
  nop
L444:
  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  0x18(%rax),%xmm0
  add    %r9,%rdx
  add    %r11,%rax
  movsd  %xmm0,(%rdx)
  cmp    %ecx,%esi
  jg     L444
L457:
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  lea    0x1(%rax),%edx
  imul   %rdx,%r9
  mov    %rdx,%rax
  imul   %r11,%rdx
  shl    $0x2,%eax
  add    %r9,%r8
  add    %rdx,%r10
L64:
  cmp    %eax,%edi
  jle    L237
  movsd  (%r10),%xmm0
  lea    0x1(%rax),%edx
  movsd  %xmm0,0x8(%r8)
  cmp    %edx,%edi
  je     L237
  movsd  0x8(%r10),%xmm0
  add    $0x2,%eax
  movsd  %xmm0,0x10(%r8)
  cmp    %eax,%edi
  je     L237
  movsd  0x10(%r10),%xmm0
  movsd  %xmm0,0x18(%r8)
L237:
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L399:
  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  0x18(%rax),%xmm0
  add    %r9,%rdx
  add    %r11,%rax
  movsd  %xmm0,(%rdx)
  cmp    %ecx,%esi
  jg     L399
  jmp    L457
  nopl   0x0(%rax,%rax,1)
L241:
  test   %esi,%esi
  jle    L369
  lea    0x0(,%rcx,4),%ebp
  lea    0x0(,%r9,4),%r11d
  mov    %r8,%rdx
  xor    %ecx,%ecx
  movslq %r11d,%r11
  movslq %ebp,%rbp
  mov    %r10,%rax
  shl    $0x3,%r11
  shl    $0x3,%rbp
  cmp    $0x1,%ebx
  jne    L317
  cs nopw 0x0(%rax,%rax,1)
L152:
  movsd  (%rax),%xmm0
  add    $0x4,%ecx
  movsd  %xmm0,0x18(%rdx)
  movsd  0x8(%rax),%xmm0
  add    %r11,%rdx
  movsd  %xmm0,(%rdx)
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x18(%rax),%xmm0
  add    %rbp,%rax
  movsd  %xmm0,0x10(%rdx)
  cmp    %ecx,%esi
  jg     L152
L357:
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  lea    0x1(%rax),%edx
  imul   %rdx,%r11
  mov    %rdx,%rax
  imul   %rbp,%rdx
  shl    $0x2,%eax
  add    %r11,%r8
  add    %rdx,%r10
L432:
  cmp    %eax,%edi
  jle    L237
  movsd  (%r10),%xmm0
  lea    0x1(%rax),%edx
  movsd  %xmm0,0x18(%r8)
  cmp    %edx,%edi
  je     L237
  shl    $0x2,%r9d
  movsd  0x8(%r10),%xmm0
  add    $0x2,%eax
  movslq %r9d,%r9
  lea    (%r8,%r9,8),%rdx
  movsd  %xmm0,(%rdx)
  cmp    %eax,%edi
  je     L237
  movsd  0x10(%r10),%xmm0
  movsd  %xmm0,0x8(%rdx)
  jmp    L237
  xchg   %ax,%ax
L202:
  test   %esi,%esi
  jle    L263
  lea    0x0(,%rcx,4),%r11d
  lea    0x0(,%r9,4),%ebp
  movslq %r11d,%r11
  movslq %ebp,%rbp
  shl    $0x3,%r11
  shl    $0x3,%rbp
  cmp    $0x1,%r9d
  jne    L242
  mov    %r8,%rcx
  cmp    $0x1,%ebx
  jne    L242
  nopl   0x0(%rax)
L2:
  movsd  (%rdx),%xmm0
  add    $0x4,%eax
  movsd  %xmm0,(%rcx)
  movsd  0x8(%rdx),%xmm0
  movsd  %xmm0,0x8(%rcx)
  movsd  0x10(%rdx),%xmm0
  movsd  %xmm0,0x10(%rcx)
  movsd  0x18(%rdx),%xmm0
  add    %r11,%rdx
  movsd  %xmm0,0x18(%rcx)
  add    %rbp,%rcx
  cmp    %eax,%esi
  jg     L2
L182:
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  lea    0x1(%rax),%edx
  imul   %rdx,%r11
  mov    %rdx,%rax
  imul   %rbp,%rdx
  shl    $0x2,%eax
  add    %r11,%r10
  add    %rdx,%r8
L263:
  cmp    %eax,%edi
  jle    L237
  mov    %edi,%edx
  sub    %eax,%edx
  lea    -0x1(%rdx),%ecx
  cmp    $0x2,%ecx
  jbe    L349
  lea    0x8(%r10),%rcx
  cmp    %rcx,%r8
  je     L349
  movupd (%r10),%xmm1
  mov    %edx,%eax
  shr    %eax
  movups %xmm1,(%r8)
  cmp    $0x1,%eax
  je     L39
  movupd 0x10(%r10),%xmm2
  movups %xmm2,0x10(%r8)
L39:
  mov    %edx,%ecx
  and    $0xfffffffe,%ecx
  mov    %ecx,%eax
  shl    $0x3,%rax
  add    %rax,%r10
  add    %r8,%rax
  cmp    %ecx,%edx
  je     L237
  movsd  (%r10),%xmm0
  movsd  %xmm0,(%rax)
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L317:
  movsd  (%rax),%xmm0
  add    $0x4,%ecx
  movsd  %xmm0,0x18(%rdx)
  movsd  0x8(%rax),%xmm0
  add    %r11,%rdx
  movsd  %xmm0,(%rdx)
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x18(%rax),%xmm0
  add    %rbp,%rax
  movsd  %xmm0,0x10(%rdx)
  cmp    %ecx,%esi
  jg     L317
  jmp    L357
  nopl   0x0(%rax,%rax,1)
L33:
  test   %esi,%esi
  jle    L20
  lea    0x0(,%rcx,4),%ebp
  lea    0x0(,%r9,4),%r11d
  mov    %r8,%rdx
  xor    %ecx,%ecx
  movslq %r11d,%r11
  movslq %ebp,%rbp
  mov    %r10,%rax
  shl    $0x3,%r11
  shl    $0x3,%rbp
  cmp    $0x1,%ebx
  jne    L346
  cs nopw 0x0(%rax,%rax,1)
L291:
  movsd  (%rax),%xmm0
  add    $0x4,%ecx
  movsd  %xmm0,0x10(%rdx)
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x18(%rdx)
  movsd  0x10(%rax),%xmm0
  add    %r11,%rdx
  movsd  %xmm0,(%rdx)
  movsd  0x18(%rax),%xmm0
  add    %rbp,%rax
  movsd  %xmm0,0x8(%rdx)
  cmp    %ecx,%esi
  jg     L291
L123:
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  lea    0x1(%rax),%edx
  imul   %rdx,%r11
  mov    %rdx,%rax
  imul   %rbp,%rdx
  shl    $0x2,%eax
  add    %r11,%r8
  add    %rdx,%r10
L136:
  cmp    %eax,%edi
  jle    L237
  movsd  (%r10),%xmm0
  lea    0x1(%rax),%edx
  movsd  %xmm0,0x10(%r8)
  cmp    %edx,%edi
  je     L237
  movsd  0x8(%r10),%xmm0
  add    $0x2,%eax
  movsd  %xmm0,0x18(%r8)
  cmp    %eax,%edi
  je     L237
  movsd  0x18(%r10),%xmm0
  shl    $0x2,%r9d
  movslq %r9d,%r9
  movsd  %xmm0,(%r8,%r9,8)
  jmp    L237
  nopl   (%rax)
L346:
  movsd  (%rax),%xmm0
  add    $0x4,%ecx
  movsd  %xmm0,0x10(%rdx)
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x18(%rdx)
  movsd  0x10(%rax),%xmm0
  add    %r11,%rdx
  movsd  %xmm0,(%rdx)
  movsd  0x18(%rax),%xmm0
  add    %rbp,%rax
  movsd  %xmm0,0x8(%rdx)
  cmp    %ecx,%esi
  jg     L346
  jmp    L123
  nopl   0x0(%rax,%rax,1)
L242:
  mov    %r8,%rcx
  mov    %r10,%rdx
  cs nopw 0x0(%rax,%rax,1)
L169:
  movsd  (%rdx),%xmm0
  add    $0x4,%eax
  movsd  %xmm0,(%rcx)
  movsd  0x8(%rdx),%xmm0
  movsd  %xmm0,0x8(%rcx)
  movsd  0x10(%rdx),%xmm0
  movsd  %xmm0,0x10(%rcx)
  movsd  0x18(%rdx),%xmm0
  add    %r11,%rdx
  movsd  %xmm0,0x18(%rcx)
  add    %rbp,%rcx
  cmp    %eax,%esi
  jg     L169
  jmp    L182
  nopl   0x0(%rax,%rax,1)
L349:
  movsd  (%r10),%xmm0
  lea    0x1(%rax),%edx
  movsd  %xmm0,(%r8)
  cmp    %edx,%edi
  jle    L237
  movsd  0x8(%r10),%xmm0
  lea    0x2(%rax),%edx
  movsd  %xmm0,0x8(%r8)
  cmp    %edx,%edi
  jle    L237
  movsd  0x10(%r10),%xmm0
  add    $0x3,%eax
  movsd  %xmm0,0x10(%r8)
  cmp    %eax,%edi
  jle    L237
  movsd  0x18(%r10),%xmm0
  movsd  %xmm0,0x18(%r8)
  jmp    L237
L369:
  xor    %eax,%eax
  jmp    L432
L20:
  xor    %eax,%eax
  jmp    L136
```

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;
  }
}
```