user: Please show me the C implementation that matches the assembly code listed below:

```asm
<kernel_sgemm_nt_2x2_lib4>:
  endbr64
  test   %edi,%edi
  jle    L45
  push   %rbx
  mov    %rsi,%rax
  mov    %rdx,%r10
  mov    %rcx,%r11
  cmp    $0x3,%edi
  jle    L87
  lea    -0x4(%rdi),%esi
  pxor   %xmm1,%xmm1
  movaps %xmm1,%xmm3
  shr    $0x2,%esi
  movaps %xmm1,%xmm2
  movaps %xmm1,%xmm6
  lea    0x1(%rsi),%ebx
  mov    %rbx,%rsi
  shl    $0x6,%rbx
  lea    (%rax,%rbx,1),%rcx
L2:
  movss  (%rax),%xmm4
  movss  (%rdx),%xmm5
  add    $0x40,%rax
  add    $0x40,%rdx
  movss  -0x3c(%rdx),%xmm8
  movss  -0x3c(%rax),%xmm0
  movaps %xmm4,%xmm7
  mulss  %xmm8,%xmm4
  mulss  %xmm5,%xmm7
  mulss  %xmm0,%xmm5
  mulss  %xmm8,%xmm0
  movss  -0x2c(%rdx),%xmm8
  addss  %xmm2,%xmm4
  movss  -0x30(%rax),%xmm2
  addss  %xmm6,%xmm7
  addss  %xmm3,%xmm5
  movss  -0x30(%rdx),%xmm3
  movaps %xmm2,%xmm6
  addss  %xmm0,%xmm1
  movss  -0x2c(%rax),%xmm0
  mulss  %xmm8,%xmm2
  mulss  %xmm3,%xmm6
  mulss  %xmm0,%xmm3
  mulss  %xmm8,%xmm0
  movss  -0x1c(%rdx),%xmm8
  addss  %xmm2,%xmm4
  movss  -0x20(%rax),%xmm2
  addss  %xmm7,%xmm6
  addss  %xmm3,%xmm5
  movss  -0x20(%rdx),%xmm3
  movaps %xmm2,%xmm7
  addss  %xmm0,%xmm1
  movss  -0x1c(%rax),%xmm0
  mulss  %xmm8,%xmm2
  mulss  %xmm3,%xmm7
  mulss  %xmm0,%xmm3
  mulss  %xmm8,%xmm0
  movss  -0xc(%rdx),%xmm8
  addss  %xmm2,%xmm4
  movss  -0x10(%rax),%xmm2
  addss  %xmm6,%xmm7
  addss  %xmm3,%xmm5
  movss  -0x10(%rdx),%xmm3
  movaps %xmm2,%xmm6
  addss  %xmm1,%xmm0
  movss  -0xc(%rax),%xmm1
  mulss  %xmm8,%xmm2
  mulss  %xmm3,%xmm6
  mulss  %xmm1,%xmm3
  mulss  %xmm8,%xmm1
  addss  %xmm4,%xmm2
  addss  %xmm7,%xmm6
  addss  %xmm5,%xmm3
  addss  %xmm0,%xmm1
  cmp    %rcx,%rax
  jne    L2
  lea    0x0(,%rsi,4),%eax
  add    %rbx,%r10
  cmp    %eax,%edi
  jle    L6
L104:
  movq   (%rcx),%xmm4
  movq   (%r10),%xmm0
  mov    %edi,%edx
  unpcklps %xmm6,%xmm2
  sub    %eax,%edx
  cmp    %edi,%eax
  unpcklps %xmm3,%xmm1
  mov    $0x1,%eax
  shufps $0x11,%xmm0,%xmm0
  shufps $0x5,%xmm4,%xmm4
  mulps  %xmm4,%xmm0
  cmovge %eax,%edx
  movlhps %xmm2,%xmm1
  addps  %xmm1,%xmm0
  cmp    $0x1,%edx
  je     L59
  movq   0x10(%rcx),%xmm1
  movq   0x10(%r10),%xmm2
  shufps $0x5,%xmm1,%xmm1
  shufps $0x11,%xmm2,%xmm2
  mulps  %xmm2,%xmm1
  addps  %xmm1,%xmm0
  cmp    $0x2,%edx
  je     L59
  movq   0x20(%rcx),%xmm2
  movq   0x20(%r10),%xmm1
  shufps $0x5,%xmm2,%xmm2
  shufps $0x11,%xmm1,%xmm1
  mulps  %xmm2,%xmm1
  addps  %xmm1,%xmm0
  cmp    $0x3,%edx
  je     L59
  movq   0x30(%rcx),%xmm2
  movq   0x30(%r10),%xmm1
  shufps $0x5,%xmm2,%xmm2
  shufps $0x11,%xmm1,%xmm1
  mulps  %xmm2,%xmm1
  addps  %xmm1,%xmm0
L59:
  movaps %xmm0,%xmm3
  movaps %xmm0,%xmm2
  movaps %xmm0,%xmm1
  unpckhps %xmm0,%xmm2
  shufps $0x55,%xmm0,%xmm3
  shufps $0xff,%xmm0,%xmm0
  movaps %xmm0,%xmm6
L6:
  test   %r9d,%r9d
  je     L17
  movss  (%r11),%xmm7
  movss  0x4(%r11),%xmm5
  movss  0x10(%r11),%xmm4
  movss  0x14(%r11),%xmm0
  cmp    $0x1,%r9d
  je     L20
  subss  %xmm6,%xmm7
  subss  %xmm3,%xmm5
  subss  %xmm2,%xmm4
  subss  %xmm1,%xmm0
L31:
  movss  %xmm7,(%r8)
  pop    %rbx
  movss  %xmm5,0x4(%r8)
  movss  %xmm4,0x10(%r8)
  movss  %xmm0,0x14(%r8)
  ret
  nopl   0x0(%rax,%rax,1)
L17:
  movss  %xmm6,(%r8)
  pop    %rbx
  movss  %xmm3,0x4(%r8)
  movss  %xmm2,0x10(%r8)
  movss  %xmm1,0x14(%r8)
  ret
  nopl   0x0(%rax)
L45:
  ret
  nopl   0x0(%rax)
L20:
  addss  %xmm6,%xmm7
  addss  %xmm3,%xmm5
  addss  %xmm2,%xmm4
  addss  %xmm1,%xmm0
  jmp    L31
  nopw   0x0(%rax,%rax,1)
L87:
  pxor   %xmm1,%xmm1
  mov    %rsi,%rcx
  xor    %eax,%eax
  movaps %xmm1,%xmm3
  movaps %xmm1,%xmm2
  movaps %xmm1,%xmm6
  jmp    L104
```

assistant: ```c
void kernel_sgemm_nt_2x2_lib4(int kmax, float *A, float *B, float *D, float *C, int alg) {
  if (kmax <= 0)
    return;
  const int lda = 4;
  const int ldc = 4;
  int k;
  float a_0, a_1, b_0, b_1, c_00 = 0, c_01 = 0, c_10 = 0, c_11 = 0;
  for (k = 0; k < kmax - 3; k += 4) {
    a_0 = A[0 + lda * 0];
    a_1 = A[1 + lda * 0];
    b_0 = B[0 + lda * 0];
    b_1 = B[1 + lda * 0];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    a_0 = A[0 + lda * 1];
    a_1 = A[1 + lda * 1];
    b_0 = B[0 + lda * 1];
    b_1 = B[1 + lda * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    a_0 = A[0 + lda * 2];
    a_1 = A[1 + lda * 2];
    b_0 = B[0 + lda * 2];
    b_1 = B[1 + lda * 2];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    a_0 = A[0 + lda * 3];
    a_1 = A[1 + lda * 3];
    b_0 = B[0 + lda * 3];
    b_1 = B[1 + lda * 3];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    A += 16;
    B += 16;
  }
  for (; k < kmax; k++) {
    a_0 = A[0 + lda * 0];
    a_1 = A[1 + lda * 0];
    b_0 = B[0 + lda * 0];
    b_1 = B[1 + lda * 0];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    A += 4;
    B += 4;
  }
  float d_00, d_01, d_10, d_11;
  if (alg == 0) {
    C[0 + ldc * 0] = c_00;
    C[1 + ldc * 0] = c_10;
    C[0 + ldc * 1] = c_01;
    C[1 + ldc * 1] = c_11;
  } else {
    d_00 = D[0 + ldc * 0];
    d_10 = D[1 + ldc * 0];
    d_01 = D[0 + ldc * 1];
    d_11 = D[1 + ldc * 1];
    if (alg == 1) {
      d_00 += c_00;
      d_10 += c_10;
      d_01 += c_01;
      d_11 += c_11;
    } else {
      d_00 -= c_00;
      d_10 -= c_10;
      d_01 -= c_01;
      d_11 -= c_11;
    }
    C[0 + ldc * 0] = d_00;
    C[1 + ldc * 0] = d_10;
    C[0 + ldc * 1] = d_01;
    C[1 + ldc * 1] = d_11;
  }
}
```