user: 请从给定的汇编指令推导出C源代码：

```asm
<shorten>:
  endbr64
  cmp    $0x3,%esi
  jle    L94
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %eax,%esi
  sub    %ebp,%esi
  test   %esi,%esi
  jle    L154
  mov    %ebp,%r8d
  movslq %ebp,%r9
  sar    %r8d
  movslq %r8d,%rcx
  lea    0x1(%r8),%edx
  movb   $0x2e,-0x1(%rbx,%rcx,1)
  lea    -0x1(%rcx),%r11
  movb   $0x2e,(%rbx,%rcx,1)
  cmp    %edx,%ebp
  jle    L68
  movslq %ebp,%r9
  mov    %rcx,%rdi
  cltq
  mov    %ebp,%r10d
  sub    %r9,%rdi
  sub    %r8d,%r10d
  add    %rax,%rdi
  lea    -0x2(%r10),%r12d
  sub    %rdi,%r11
  cmp    $0xe,%r11
  jbe    L112
  cmp    $0x6,%r12d
  jbe    L112
  lea    -0x1(%r10),%r11d
  cmp    $0xe,%r12d
  jbe    L107
  mov    %r11d,%r8d
  lea    0x1(%rbx,%rdi,1),%r13
  lea    0x1(%rbx,%rcx,1),%r12
  xor    %eax,%eax
  shr    $0x4,%r8d
  shl    $0x4,%r8
  cs nopw 0x0(%rax,%rax,1)
L106:
  movdqu 0x0(%r13,%rax,1),%xmm0
  movups %xmm0,(%r12,%rax,1)
  add    $0x10,%rax
  cmp    %r8,%rax
  jne    L106
  mov    %r11d,%eax
  and    $0xfffffff0,%eax
  add    %eax,%edx
  cmp    %eax,%r11d
  je     L68
  sub    %eax,%r10d
  lea    -0x1(%r10),%r11d
  sub    $0x2,%r10d
  cmp    $0x6,%r10d
  jbe    L10
L3:
  add    %rbx,%rdi
  add    %rbx,%rcx
  mov    0x1(%rax,%rdi,1),%rdi
  mov    %rdi,0x1(%rax,%rcx,1)
  mov    %r11d,%eax
  and    $0xfffffff8,%eax
  add    %eax,%edx
  cmp    %eax,%r11d
  je     L68
L10:
  lea    (%rsi,%rdx,1),%eax
  cltq
  movzbl (%rbx,%rax,1),%ecx
  movslq %edx,%rax
  mov    %cl,(%rbx,%rax,1)
  lea    0x1(%rdx),%eax
  cmp    %eax,%ebp
  jle    L68
  lea    (%rsi,%rax,1),%ecx
  cltq
  movslq %ecx,%rcx
  movzbl (%rbx,%rcx,1),%ecx
  mov    %cl,(%rbx,%rax,1)
  lea    0x2(%rdx),%eax
  cmp    %eax,%ebp
  jle    L68
  lea    (%rsi,%rax,1),%ecx
  cltq
  movslq %ecx,%rcx
  movzbl (%rbx,%rcx,1),%ecx
  mov    %cl,(%rbx,%rax,1)
  lea    0x3(%rdx),%eax
  cmp    %eax,%ebp
  jle    L68
  lea    (%rsi,%rax,1),%ecx
  cltq
  movslq %ecx,%rcx
  movzbl (%rbx,%rcx,1),%ecx
  mov    %cl,(%rbx,%rax,1)
  lea    0x4(%rdx),%eax
  cmp    %eax,%ebp
  jle    L68
  lea    (%rsi,%rax,1),%ecx
  cltq
  movslq %ecx,%rcx
  movzbl (%rbx,%rcx,1),%ecx
  mov    %cl,(%rbx,%rax,1)
  lea    0x5(%rdx),%eax
  cmp    %eax,%ebp
  jle    L68
  lea    (%rsi,%rax,1),%ecx
  add    $0x6,%edx
  cltq
  movslq %ecx,%rcx
  movzbl (%rbx,%rcx,1),%ecx
  mov    %cl,(%rbx,%rax,1)
  cmp    %edx,%ebp
  jle    L68
  add    %edx,%esi
  movslq %edx,%rdx
  movslq %esi,%rsi
  movzbl (%rbx,%rsi,1),%eax
  mov    %al,(%rbx,%rdx,1)
L68:
  movb   $0x0,(%rbx,%r9,1)
  mov    %ebp,%eax
L154:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L107:
  xor    %eax,%eax
  jmp    L3
  nopl   0x0(%rax)
L112:
  lea    -0x2(%rbp),%eax
  movslq %edx,%rdx
  lea    0x2(%rbx,%rcx,1),%rcx
  movslq %esi,%rsi
  sub    %r8d,%eax
  add    %rbx,%rdx
  add    %rax,%rcx
  nop
L22:
  movzbl (%rdx,%rsi,1),%eax
  add    $0x1,%rdx
  mov    %al,-0x1(%rdx)
  cmp    %rcx,%rdx
  jne    L22
  movb   $0x0,(%rbx,%r9,1)
  mov    %ebp,%eax
  jmp    L154
L94:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int shorten(char *str, int maxlen) {
  int half, i, len, offset;
  if (maxlen < 4)
    return -1;
  len = strlen(str);
  offset = len - maxlen;
  if (offset <= 0)
    return len;
  half = maxlen / 2;
  str[half - 1] = '.';
  str[half] = '.';
  for (i = half + 1; i < maxlen; i++)
    str[i] = str[offset + i];
  str[maxlen] = '\0';
  return maxlen;
}
```