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

```asm
<strinsert>:
  endbr64
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <strlen@plt>
  mov    %eax,%esi
  mov    %eax,%edx
  sub    %r12d,%esi
  js     L181
  jne    L180
L142:
  test   %edx,%edx
  jle    L20
  lea    0x1(%rbp),%rdi
  mov    %rbx,%rcx
  lea    -0x1(%rdx),%eax
  mov    %edx,%esi
  sub    %rdi,%rcx
  cmp    $0xe,%rcx
  jbe    L316
  cmp    $0x6,%eax
  jbe    L316
  cmp    $0xe,%eax
  jbe    L241
  mov    %edx,%ecx
  xor    %eax,%eax
  shr    $0x4,%ecx
  shl    $0x4,%rcx
  nopl   0x0(%rax,%rax,1)
L220:
  movdqu 0x0(%rbp,%rax,1),%xmm0
  movups %xmm0,(%rbx,%rax,1)
  add    $0x10,%rax
  cmp    %rcx,%rax
  jne    L220
  mov    %edx,%ecx
  and    $0xfffffff0,%ecx
  mov    %ecx,%eax
  cmp    %ecx,%edx
  je     L20
  mov    %edx,%esi
  sub    %ecx,%esi
  lea    -0x1(%rsi),%edi
  cmp    $0x6,%edi
  jbe    L266
L136:
  mov    0x0(%rbp,%rcx,1),%rdi
  mov    %rdi,(%rbx,%rcx,1)
  mov    %esi,%ecx
  and    $0xfffffff8,%ecx
  add    %ecx,%eax
  cmp    %esi,%ecx
  je     L20
L266:
  movslq %eax,%rcx
  movzbl 0x0(%rbp,%rcx,1),%esi
  mov    %sil,(%rbx,%rcx,1)
  lea    0x1(%rax),%ecx
  cmp    %edx,%ecx
  jge    L20
  movslq %ecx,%rcx
  movzbl 0x0(%rbp,%rcx,1),%esi
  mov    %sil,(%rbx,%rcx,1)
  lea    0x2(%rax),%ecx
  cmp    %edx,%ecx
  jge    L20
  movslq %ecx,%rcx
  movzbl 0x0(%rbp,%rcx,1),%esi
  mov    %sil,(%rbx,%rcx,1)
  lea    0x3(%rax),%ecx
  cmp    %ecx,%edx
  jle    L20
  movslq %ecx,%rcx
  movzbl 0x0(%rbp,%rcx,1),%esi
  mov    %sil,(%rbx,%rcx,1)
  lea    0x4(%rax),%ecx
  cmp    %ecx,%edx
  jle    L20
  movslq %ecx,%rcx
  movzbl 0x0(%rbp,%rcx,1),%esi
  mov    %sil,(%rbx,%rcx,1)
  lea    0x5(%rax),%ecx
  cmp    %ecx,%edx
  jle    L20
  movslq %ecx,%rcx
  add    $0x6,%eax
  movzbl 0x0(%rbp,%rcx,1),%esi
  mov    %sil,(%rbx,%rcx,1)
  cmp    %eax,%edx
  jle    L20
  cltq
  movzbl 0x0(%rbp,%rax,1),%edx
  mov    %dl,(%rbx,%rax,1)
L20:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L180:
  cmp    %r12d,%r13d
  jl     L142
  movslq %r13d,%rcx
  sub    %r12d,%r13d
  movslq %esi,%rsi
  lea    -0x1(%rbx,%rcx,1),%rdi
  lea    (%rbx,%rcx,1),%rax
  sub    %r13,%rdi
  xchg   %ax,%ax
L68:
  movzbl (%rax),%ecx
  sub    $0x1,%rax
  mov    %cl,0x1(%rax,%rsi,1)
  cmp    %rdi,%rax
  jne    L68
  jmp    L142
  nopl   (%rax)
L181:
  cmp    %r12d,%r13d
  jl     L142
  movslq %eax,%rdi
  movslq %r12d,%rcx
  mov    %r13d,%r9d
  mov    %rdi,%rax
  sub    %r12d,%r9d
  sub    %rcx,%rax
  sub    $0x1,%rax
  cmp    $0xe,%rax
  jbe    L363
  cmp    $0x6,%r9d
  jbe    L363
  lea    0x1(%r9),%r10d
  cmp    $0xe,%r9d
  jbe    L7
  mov    %r10d,%r8d
  add    %rbx,%rcx
  add    %rbx,%rdi
  xor    %eax,%eax
  shr    $0x4,%r8d
  shl    $0x4,%r8
  nopl   0x0(%rax)
L368:
  movdqu (%rcx,%rax,1),%xmm1
  movups %xmm1,(%rdi,%rax,1)
  add    $0x10,%rax
  cmp    %r8,%rax
  jne    L368
  mov    %r10d,%eax
  and    $0xfffffff0,%eax
  add    %eax,%r12d
  cmp    %eax,%r10d
  je     L142
  sub    %eax,%r9d
  lea    0x1(%r9),%r8d
  cmp    $0x6,%r9d
  jbe    L51
L271:
  mov    (%rcx,%rax,1),%rcx
  mov    %rcx,(%rdi,%rax,1)
  mov    %r8d,%eax
  and    $0xfffffff8,%eax
  add    %eax,%r12d
  cmp    %eax,%r8d
  je     L142
L51:
  movslq %r12d,%rax
  movzbl (%rbx,%rax,1),%ecx
  lea    (%rsi,%r12,1),%eax
  cltq
  mov    %cl,(%rbx,%rax,1)
  lea    0x1(%r12),%eax
  cmp    %eax,%r13d
  jl     L142
  movslq %eax,%rcx
  add    %esi,%eax
  movzbl (%rbx,%rcx,1),%ecx
  cltq
  mov    %cl,(%rbx,%rax,1)
  lea    0x2(%r12),%eax
  cmp    %eax,%r13d
  jl     L142
  movslq %eax,%rcx
  add    %esi,%eax
  movzbl (%rbx,%rcx,1),%ecx
  cltq
  mov    %cl,(%rbx,%rax,1)
  lea    0x3(%r12),%eax
  cmp    %eax,%r13d
  jl     L142
  movslq %eax,%rcx
  add    %esi,%eax
  movzbl (%rbx,%rcx,1),%ecx
  cltq
  mov    %cl,(%rbx,%rax,1)
  lea    0x4(%r12),%eax
  cmp    %eax,%r13d
  jl     L142
  movslq %eax,%rcx
  add    %esi,%eax
  movzbl (%rbx,%rcx,1),%ecx
  cltq
  mov    %cl,(%rbx,%rax,1)
  lea    0x5(%r12),%eax
  cmp    %eax,%r13d
  jl     L142
  movslq %eax,%rcx
  add    %esi,%eax
  add    $0x6,%r12d
  movzbl (%rbx,%rcx,1),%ecx
  cltq
  mov    %cl,(%rbx,%rax,1)
  cmp    %r12d,%r13d
  jl     L142
  movslq %r12d,%rax
  add    %esi,%r12d
  movzbl (%rbx,%rax,1),%ecx
  movslq %r12d,%rax
  mov    %cl,(%rbx,%rax,1)
  jmp    L142
  nopl   0x0(%rax)
L316:
  mov    %edx,%edx
  xor    %eax,%eax
  nopl   0x0(%rax)
L91:
  movzbl 0x0(%rbp,%rax,1),%ecx
  mov    %cl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L91
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L363:
  lea    0x1(%rbx,%rcx,1),%rdi
  lea    (%rbx,%rcx,1),%rax
  movslq %esi,%rsi
  add    %r9,%rdi
  nopl   (%rax)
L283:
  movzbl (%rax),%ecx
  add    $0x1,%rax
  mov    %cl,-0x1(%rax,%rsi,1)
  cmp    %rax,%rdi
  jne    L283
  jmp    L142
L241:
  xor    %ecx,%ecx
  xor    %eax,%eax
  jmp    L136
L7:
  mov    %r10d,%r8d
  xor    %eax,%eax
  add    %rbx,%rcx
  add    %rbx,%rdi
  jmp    L271
```

assistant: ```c
strinsert(char *a, char *b, int n) {
  int i, idiff, alen, blen;
  alen = strlen(a);
  blen = strlen(b);
  idiff = blen - n;
  if (idiff < 0)
    for (i = n; i <= alen; i++)
      a[i + idiff] = a[i];
  else if (idiff > 0)
    for (i = alen; i >= n; i--)
      a[i + idiff] = a[i];
  for (i = 0; i < blen; i++)
    a[i] = b[i];
}
```