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

```asm
<my_strnconcat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  movq   $0x0,-0x8(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L114
  cmpq   $0x0,-0x30(%rbp)
  je     L114
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <my_strlen@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <my_strlen@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    %eax,-0x34(%rbp)
  jbe    L86
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x34(%rbp)
L86:
  mov    -0x10(%rbp),%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%eax
  add    $0x1,%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <xmalloc@plt>
  cltq
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L62
L135:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x18(%rbp)
L62:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L135
  movl   $0x0,-0x14(%rbp)
  jmp    L0
L40:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x18(%rbp)
  addl   $0x1,-0x14(%rbp)
L0:
  mov    -0x14(%rbp),%eax
  cmp    %eax,-0x34(%rbp)
  ja     L40
  mov    -0x8(%rbp),%rax
  jmp    L78
L114:
  cmpq   $0x0,-0x28(%rbp)
  je     L5
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <my_strdup@plt>
  cltq
  jmp    L78
L5:
  cmpq   $0x0,-0x30(%rbp)
  je     L90
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <my_strlen@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    %eax,-0x34(%rbp)
  jbe    L4
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x34(%rbp)
L4:
  mov    -0x34(%rbp),%eax
  add    $0x1,%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <xmalloc@plt>
  cltq
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L149
L110:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x18(%rbp)
L149:
  mov    -0x18(%rbp),%eax
  cmp    %eax,-0x34(%rbp)
  ja     L110
  mov    -0x8(%rbp),%rax
  jmp    L78
L90:
  mov    $0x0,%eax
L78:
  leave
  ret
```

assistant: ```c
char *my_strnconcat(char *s1, char *s2, unsigned int n) {
  int l1;
  int l2;
  char *s3 = ((void *)0);
  int i;
  int j;
  if (s1 && s2) {
    l1 = my_strlen(s1);
    l2 = my_strlen(s2);
    if (n > l2)
      n = l2;
    s3 = (char *)xmalloc((l1 + n) * sizeof(char) + 1);
    for (i = 0; s1[i]; i++)
      s3[i] = s1[i];
    for (j = 0; j < n; i++, j++)
      s3[i] = s2[j];
    return s3;
  } else if (s1)
    return my_strdup(s1);
  else if (s2) {
    l2 = my_strlen(s2);
    if (n > l2)
      n = l2;
    s3 = xmalloc(n * sizeof(char) + 1);
    for (i = 0; i < n; ++i)
      s3[i] = s2[i];
    return s3;
  } else
    return ((void *)0);
}
```