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

```asm
<kernel_sgemm_nt_4x4_lib4>:
  endbr64
  test   %edi,%edi
  jle    L66
  push   %rbx
  mov    %rsi,%rax
  mov    %rdx,%r11
  mov    %rcx,%r10
  cmp    $0x3,%edi
  jle    L8
  lea    -0x4(%rdi),%esi
  pxor   %xmm2,%xmm2
  shr    $0x2,%esi
  movaps %xmm2,-0x10(%rsp)
  movaps %xmm2,%xmm1
  movaps %xmm2,%xmm10
  lea    0x1(%rsi),%ebx
  movaps %xmm2,-0x20(%rsp)
  movaps %xmm2,%xmm11
  movaps %xmm2,%xmm9
  mov    %rbx,%rsi
  shl    $0x6,%rbx
  movaps %xmm2,-0x30(%rsp)
  lea    (%rax,%rbx,1),%rcx
  movaps %xmm2,-0x40(%rsp)
  nopw   0x0(%rax,%rax,1)
L83:
  movups (%rdx),%xmm7
  movups (%rax),%xmm0
  add    $0x40,%rax
  add    $0x40,%rdx
  movups -0x30(%rdx),%xmm6
  movups -0x30(%rax),%xmm4
  movaps %xmm7,%xmm15
  movups -0x20(%rdx),%xmm5
  movups -0x20(%rax),%xmm3
  movaps %xmm7,%xmm14
  shufps $0x0,%xmm7,%xmm15
  mulps  %xmm0,%xmm15
  movups -0x10(%rdx),%xmm8
  movups -0x10(%rax),%xmm2
  shufps $0x1b,%xmm7,%xmm14
  movaps %xmm6,%xmm13
  movaps %xmm5,%xmm12
  shufps $0x1b,%xmm6,%xmm13
  shufps $0x1b,%xmm5,%xmm12
  addps  %xmm9,%xmm15
  movaps %xmm6,%xmm9
  shufps $0x0,%xmm6,%xmm9
  mulps  %xmm4,%xmm9
  addps  %xmm9,%xmm15
  movaps %xmm5,%xmm9
  shufps $0x0,%xmm5,%xmm9
  mulps  %xmm3,%xmm9
  addps  %xmm9,%xmm15
  movaps %xmm8,%xmm9
  shufps $0x0,%xmm8,%xmm9
  mulps  %xmm2,%xmm9
  addps  %xmm15,%xmm9
  movaps %xmm7,%xmm15
  shufps $0x55,%xmm7,%xmm15
  mulps  %xmm0,%xmm15
  addps  %xmm15,%xmm11
  movaps %xmm6,%xmm15
  shufps $0x55,%xmm6,%xmm15
  mulps  %xmm4,%xmm15
  addps  %xmm15,%xmm11
  movaps %xmm5,%xmm15
  shufps $0x55,%xmm5,%xmm15
  mulps  %xmm3,%xmm15
  addps  %xmm15,%xmm11
  movaps %xmm8,%xmm15
  shufps $0x55,%xmm8,%xmm15
  mulps  %xmm2,%xmm15
  addps  %xmm15,%xmm11
  movaps %xmm7,%xmm15
  shufps $0xaa,%xmm7,%xmm15
  mulps  %xmm0,%xmm15
  shufps $0xff,%xmm7,%xmm7
  mulps  %xmm0,%xmm7
  addps  %xmm15,%xmm10
  movaps %xmm6,%xmm15
  shufps $0xaa,%xmm6,%xmm15
  mulps  %xmm4,%xmm15
  shufps $0xff,%xmm6,%xmm6
  addps  %xmm1,%xmm7
  mulps  %xmm4,%xmm6
  movaps %xmm7,%xmm1
  addps  %xmm15,%xmm10
  movaps %xmm5,%xmm15
  addps  %xmm6,%xmm1
  shufps $0xaa,%xmm5,%xmm15
  shufps $0xff,%xmm5,%xmm5
  movaps %xmm5,%xmm6
  mulps  %xmm3,%xmm6
  movaps %xmm0,%xmm5
  shufps $0x0,%xmm0,%xmm5
  mulps  %xmm14,%xmm5
  addps  -0x10(%rsp),%xmm5
  mulps  %xmm3,%xmm15
  addps  %xmm1,%xmm6
  movaps %xmm8,%xmm1
  shufps $0xff,%xmm8,%xmm1
  mulps  %xmm2,%xmm1
  addps  %xmm15,%xmm10
  movaps %xmm8,%xmm15
  shufps $0xaa,%xmm8,%xmm15
  shufps $0x1b,%xmm8,%xmm8
  mulps  %xmm2,%xmm15
  addps  %xmm6,%xmm1
  movaps %xmm4,%xmm6
  shufps $0x0,%xmm4,%xmm6
  mulps  %xmm13,%xmm6
  addps  %xmm15,%xmm10
  addps  %xmm6,%xmm5
  movaps %xmm3,%xmm6
  shufps $0x0,%xmm3,%xmm6
  mulps  %xmm12,%xmm6
  addps  %xmm6,%xmm5
  movaps %xmm2,%xmm6
  shufps $0x0,%xmm2,%xmm6
  mulps  %xmm8,%xmm6
  addps  %xmm6,%xmm5
  movaps %xmm4,%xmm6
  shufps $0x55,%xmm4,%xmm6
  mulps  %xmm13,%xmm6
  movaps %xmm5,-0x10(%rsp)
  movaps %xmm0,%xmm5
  shufps $0x55,%xmm0,%xmm5
  mulps  %xmm14,%xmm5
  addps  -0x20(%rsp),%xmm5
  addps  %xmm6,%xmm5
  movaps %xmm3,%xmm6
  shufps $0x55,%xmm3,%xmm6
  mulps  %xmm12,%xmm6
  addps  %xmm6,%xmm5
  movaps %xmm2,%xmm6
  shufps $0x55,%xmm2,%xmm6
  mulps  %xmm8,%xmm6
  addps  %xmm6,%xmm5
  movaps %xmm4,%xmm6
  shufps $0xaa,%xmm4,%xmm6
  mulps  %xmm13,%xmm6
  shufps $0xff,%xmm4,%xmm4
  mulps  %xmm13,%xmm4
  movaps %xmm5,-0x20(%rsp)
  movaps %xmm0,%xmm5
  shufps $0xaa,%xmm0,%xmm5
  mulps  %xmm14,%xmm5
  shufps $0xff,%xmm0,%xmm0
  addps  -0x30(%rsp),%xmm5
  mulps  %xmm14,%xmm0
  addps  -0x40(%rsp),%xmm0
  addps  %xmm6,%xmm5
  movaps %xmm3,%xmm6
  shufps $0xaa,%xmm3,%xmm6
  mulps  %xmm12,%xmm6
  shufps $0xff,%xmm3,%xmm3
  addps  %xmm0,%xmm4
  mulps  %xmm12,%xmm3
  addps  %xmm6,%xmm5
  movaps %xmm2,%xmm6
  shufps $0xaa,%xmm2,%xmm6
  shufps $0xff,%xmm2,%xmm2
  mulps  %xmm8,%xmm6
  addps  %xmm4,%xmm3
  mulps  %xmm8,%xmm2
  addps  %xmm6,%xmm5
  addps  %xmm2,%xmm3
  movaps %xmm5,-0x30(%rsp)
  movaps %xmm3,-0x40(%rsp)
  cmp    %rax,%rcx
  jne    L83
  lea    0x0(,%rsi,4),%eax
  add    %rbx,%r11
  cmp    %eax,%edi
  jle    L97
L96:
  movups (%rcx),%xmm1
  mov    %edi,%edx
  movups (%r11),%xmm4
  sub    %eax,%edx
  cmp    %edi,%eax
  mov    $0x1,%eax
  movaps %xmm1,%xmm3
  movaps %xmm1,%xmm0
  movaps %xmm1,%xmm2
  cmovge %eax,%edx
  shufps $0xff,%xmm1,%xmm3
  shufps $0xaa,%xmm1,%xmm0
  shufps $0x55,%xmm1,%xmm2
  shufps $0x0,%xmm1,%xmm1
  movaps %xmm1,%xmm9
  shufps $0x1b,%xmm4,%xmm4
  mulps  %xmm4,%xmm3
  mulps  %xmm4,%xmm0
  addps  -0x40(%rsp),%xmm3
  mulps  %xmm4,%xmm2
  addps  -0x30(%rsp),%xmm0
  mulps  %xmm4,%xmm9
  addps  -0x20(%rsp),%xmm2
  addps  -0x10(%rsp),%xmm9
  cmp    $0x1,%edx
  je     L70
  movups 0x10(%rcx),%xmm1
  movups 0x10(%r11),%xmm4
  movaps %xmm1,%xmm5
  shufps $0x1b,%xmm4,%xmm4
  shufps $0xff,%xmm1,%xmm5
  mulps  %xmm4,%xmm5
  addps  %xmm5,%xmm3
  movaps %xmm1,%xmm5
  shufps $0xaa,%xmm1,%xmm5
  mulps  %xmm4,%xmm5
  addps  %xmm5,%xmm0
  movaps %xmm1,%xmm5
  shufps $0x55,%xmm1,%xmm5
  shufps $0x0,%xmm1,%xmm1
  mulps  %xmm4,%xmm5
  mulps  %xmm4,%xmm1
  addps  %xmm5,%xmm2
  addps  %xmm1,%xmm9
  cmp    $0x2,%edx
  je     L70
  movups 0x20(%rcx),%xmm1
  movups 0x20(%r11),%xmm4
  movaps %xmm1,%xmm5
  shufps $0x1b,%xmm4,%xmm4
  shufps $0xff,%xmm1,%xmm5
  mulps  %xmm4,%xmm5
  addps  %xmm5,%xmm3
  movaps %xmm1,%xmm5
  shufps $0xaa,%xmm1,%xmm5
  mulps  %xmm4,%xmm5
  addps  %xmm5,%xmm0
  movaps %xmm1,%xmm5
  shufps $0x55,%xmm1,%xmm5
  shufps $0x0,%xmm1,%xmm1
  mulps  %xmm4,%xmm5
  mulps  %xmm4,%xmm1
  addps  %xmm5,%xmm2
  addps  %xmm1,%xmm9
  cmp    $0x3,%edx
  je     L70
  movups 0x30(%rcx),%xmm1
  movups 0x30(%r11),%xmm4
  movaps %xmm1,%xmm5
  shufps $0x1b,%xmm4,%xmm4
  shufps $0xff,%xmm1,%xmm5
  mulps  %xmm4,%xmm5
  addps  %xmm5,%xmm3
  movaps %xmm1,%xmm5
  shufps $0xaa,%xmm1,%xmm5
  mulps  %xmm4,%xmm5
  addps  %xmm5,%xmm0
  movaps %xmm1,%xmm5
  shufps $0x55,%xmm1,%xmm5
  shufps $0x0,%xmm1,%xmm1
  mulps  %xmm4,%xmm5
  mulps  %xmm4,%xmm1
  addps  %xmm5,%xmm2
  addps  %xmm1,%xmm9
L70:
  movaps %xmm9,%xmm1
  movaps %xmm0,%xmm4
  movaps %xmm9,%xmm10
  unpcklps %xmm3,%xmm4
  unpcklps %xmm2,%xmm1
  movaps %xmm3,%xmm6
  shufps $0x55,%xmm9,%xmm10
  movlhps %xmm4,%xmm1
  movaps %xmm2,%xmm4
  shufps $0x55,%xmm3,%xmm6
  movaps %xmm9,%xmm11
  shufps $0x55,%xmm2,%xmm4
  movaps %xmm4,%xmm5
  movaps %xmm0,%xmm4
  unpckhps %xmm9,%xmm11
  unpcklps %xmm5,%xmm10
  shufps $0x55,%xmm0,%xmm4
  unpcklps %xmm6,%xmm4
  movaps %xmm3,%xmm6
  movlhps %xmm4,%xmm10
  movaps %xmm2,%xmm4
  unpckhps %xmm3,%xmm6
  shufps $0xff,%xmm9,%xmm9
  unpckhps %xmm2,%xmm4
  shufps $0xff,%xmm3,%xmm3
  shufps $0xff,%xmm2,%xmm2
  unpcklps %xmm2,%xmm9
  movaps %xmm4,%xmm5
  movaps %xmm0,%xmm4
  unpckhps %xmm0,%xmm4
  unpcklps %xmm5,%xmm11
  shufps $0xff,%xmm0,%xmm0
  unpcklps %xmm3,%xmm0
  unpcklps %xmm6,%xmm4
  movlhps %xmm0,%xmm9
  movlhps %xmm4,%xmm11
L97:
  test   %r9d,%r9d
  je     L90
  movups (%r10),%xmm4
  movups 0x10(%r10),%xmm3
  movups 0x20(%r10),%xmm2
  movups 0x30(%r10),%xmm0
  cmp    $0x1,%r9d
  je     L102
  subps  %xmm9,%xmm4
  subps  %xmm11,%xmm3
  subps  %xmm10,%xmm2
  subps  %xmm1,%xmm0
L68:
  movups %xmm4,(%r8)
  pop    %rbx
  movups %xmm3,0x10(%r8)
  movups %xmm2,0x20(%r8)
  movups %xmm0,0x30(%r8)
  ret
  nop
L90:
  movups %xmm9,(%r8)
  pop    %rbx
  movups %xmm11,0x10(%r8)
  movups %xmm10,0x20(%r8)
  movups %xmm1,0x30(%r8)
  ret
  nopl   (%rax)
L66:
  ret
  nopl   0x0(%rax)
L102:
  addps  %xmm9,%xmm4
  addps  %xmm11,%xmm3
  addps  %xmm10,%xmm2
  addps  %xmm1,%xmm0
  jmp    L68
  nopl   0x0(%rax)
L8:
  pxor   %xmm1,%xmm1
  mov    %rsi,%rcx
  xor    %eax,%eax
  movaps %xmm1,-0x10(%rsp)
  movaps %xmm1,-0x20(%rsp)
  movaps %xmm1,-0x30(%rsp)
  movaps %xmm1,-0x40(%rsp)
  jmp    L96
```

assistant: ```c
void kernel_sgemm_nt_4x4_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, a_2, a_3, b_0, b_1, b_2, b_3, c_00 = 0, c_01 = 0, c_02 = 0, c_03 = 0, c_10 = 0, c_11 = 0, c_12 = 0, c_13 = 0, c_20 = 0, c_21 = 0, c_22 = 0, c_23 = 0, c_30 = 0, c_31 = 0, c_32 = 0, c_33 = 0;
  for (k = 0; k < kmax - 3; k += 4) {
    a_0 = A[0 + lda * 0];
    a_1 = A[1 + lda * 0];
    a_2 = A[2 + lda * 0];
    a_3 = A[3 + lda * 0];
    b_0 = B[0 + lda * 0];
    b_1 = B[1 + lda * 0];
    b_2 = B[2 + lda * 0];
    b_3 = B[3 + lda * 0];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_20 += a_2 * b_0;
    c_30 += a_3 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    c_02 += a_0 * b_2;
    c_12 += a_1 * b_2;
    c_22 += a_2 * b_2;
    c_32 += a_3 * b_2;
    c_03 += a_0 * b_3;
    c_13 += a_1 * b_3;
    c_23 += a_2 * b_3;
    c_33 += a_3 * b_3;
    a_0 = A[0 + lda * 1];
    a_1 = A[1 + lda * 1];
    a_2 = A[2 + lda * 1];
    a_3 = A[3 + lda * 1];
    b_0 = B[0 + lda * 1];
    b_1 = B[1 + lda * 1];
    b_2 = B[2 + lda * 1];
    b_3 = B[3 + lda * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_20 += a_2 * b_0;
    c_30 += a_3 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    c_02 += a_0 * b_2;
    c_12 += a_1 * b_2;
    c_22 += a_2 * b_2;
    c_32 += a_3 * b_2;
    c_03 += a_0 * b_3;
    c_13 += a_1 * b_3;
    c_23 += a_2 * b_3;
    c_33 += a_3 * b_3;
    a_0 = A[0 + lda * 2];
    a_1 = A[1 + lda * 2];
    a_2 = A[2 + lda * 2];
    a_3 = A[3 + lda * 2];
    b_0 = B[0 + lda * 2];
    b_1 = B[1 + lda * 2];
    b_2 = B[2 + lda * 2];
    b_3 = B[3 + lda * 2];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_20 += a_2 * b_0;
    c_30 += a_3 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    c_02 += a_0 * b_2;
    c_12 += a_1 * b_2;
    c_22 += a_2 * b_2;
    c_32 += a_3 * b_2;
    c_03 += a_0 * b_3;
    c_13 += a_1 * b_3;
    c_23 += a_2 * b_3;
    c_33 += a_3 * b_3;
    a_0 = A[0 + lda * 3];
    a_1 = A[1 + lda * 3];
    a_2 = A[2 + lda * 3];
    a_3 = A[3 + lda * 3];
    b_0 = B[0 + lda * 3];
    b_1 = B[1 + lda * 3];
    b_2 = B[2 + lda * 3];
    b_3 = B[3 + lda * 3];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_20 += a_2 * b_0;
    c_30 += a_3 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    c_02 += a_0 * b_2;
    c_12 += a_1 * b_2;
    c_22 += a_2 * b_2;
    c_32 += a_3 * b_2;
    c_03 += a_0 * b_3;
    c_13 += a_1 * b_3;
    c_23 += a_2 * b_3;
    c_33 += a_3 * b_3;
    A += 16;
    B += 16;
  }
  for (; k < kmax; k++) {
    a_0 = A[0 + lda * 0];
    a_1 = A[1 + lda * 0];
    a_2 = A[2 + lda * 0];
    a_3 = A[3 + lda * 0];
    b_0 = B[0 + lda * 0];
    b_1 = B[1 + lda * 0];
    b_2 = B[2 + lda * 0];
    b_3 = B[3 + lda * 0];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_20 += a_2 * b_0;
    c_30 += a_3 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    c_02 += a_0 * b_2;
    c_12 += a_1 * b_2;
    c_22 += a_2 * b_2;
    c_32 += a_3 * b_2;
    c_03 += a_0 * b_3;
    c_13 += a_1 * b_3;
    c_23 += a_2 * b_3;
    c_33 += a_3 * b_3;
    A += 4;
    B += 4;
  }
  float d_00, d_01, d_02, d_03, d_10, d_11, d_12, d_13, d_20, d_21, d_22, d_23, d_30, d_31, d_32, d_33;
  if (alg == 0) {
    C[0 + ldc * 0] = c_00;
    C[1 + ldc * 0] = c_10;
    C[2 + ldc * 0] = c_20;
    C[3 + ldc * 0] = c_30;
    C[0 + ldc * 1] = c_01;
    C[1 + ldc * 1] = c_11;
    C[2 + ldc * 1] = c_21;
    C[3 + ldc * 1] = c_31;
    C[0 + ldc * 2] = c_02;
    C[1 + ldc * 2] = c_12;
    C[2 + ldc * 2] = c_22;
    C[3 + ldc * 2] = c_32;
    C[0 + ldc * 3] = c_03;
    C[1 + ldc * 3] = c_13;
    C[2 + ldc * 3] = c_23;
    C[3 + ldc * 3] = c_33;
  } else {
    d_00 = D[0 + ldc * 0];
    d_10 = D[1 + ldc * 0];
    d_20 = D[2 + ldc * 0];
    d_30 = D[3 + ldc * 0];
    d_01 = D[0 + ldc * 1];
    d_11 = D[1 + ldc * 1];
    d_21 = D[2 + ldc * 1];
    d_31 = D[3 + ldc * 1];
    d_02 = D[0 + ldc * 2];
    d_12 = D[1 + ldc * 2];
    d_22 = D[2 + ldc * 2];
    d_32 = D[3 + ldc * 2];
    d_03 = D[0 + ldc * 3];
    d_13 = D[1 + ldc * 3];
    d_23 = D[2 + ldc * 3];
    d_33 = D[3 + ldc * 3];
    if (alg == 1) {
      d_00 += c_00;
      d_10 += c_10;
      d_20 += c_20;
      d_30 += c_30;
      d_01 += c_01;
      d_11 += c_11;
      d_21 += c_21;
      d_31 += c_31;
      d_02 += c_02;
      d_12 += c_12;
      d_22 += c_22;
      d_32 += c_32;
      d_03 += c_03;
      d_13 += c_13;
      d_23 += c_23;
      d_33 += c_33;
    } else {
      d_00 -= c_00;
      d_10 -= c_10;
      d_20 -= c_20;
      d_30 -= c_30;
      d_01 -= c_01;
      d_11 -= c_11;
      d_21 -= c_21;
      d_31 -= c_31;
      d_02 -= c_02;
      d_12 -= c_12;
      d_22 -= c_22;
      d_32 -= c_32;
      d_03 -= c_03;
      d_13 -= c_13;
      d_23 -= c_23;
      d_33 -= c_33;
    }
    C[0 + ldc * 0] = d_00;
    C[1 + ldc * 0] = d_10;
    C[2 + ldc * 0] = d_20;
    C[3 + ldc * 0] = d_30;
    C[0 + ldc * 1] = d_01;
    C[1 + ldc * 1] = d_11;
    C[2 + ldc * 1] = d_21;
    C[3 + ldc * 1] = d_31;
    C[0 + ldc * 2] = d_02;
    C[1 + ldc * 2] = d_12;
    C[2 + ldc * 2] = d_22;
    C[3 + ldc * 2] = d_32;
    C[0 + ldc * 3] = d_03;
    C[1 + ldc * 3] = d_13;
    C[2 + ldc * 3] = d_23;
    C[3 + ldc * 3] = d_33;
  }
}
```