user: What is the c source code of the assembly code below?

```asm
<ems1Rform>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jle    L69
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jle    L69
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jns    L103
  mov    -0x28(%rbp),%rax
  movl   $0x0,(%rax)
L103:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L72
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0xc(%rbp),%eax
  sub    -0x8(%rbp),%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x28(%rbp),%rax
  movl   $0x0,(%rax)
  jmp    L4
L72:
  mov    -0x28(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L45
L18:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L102
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  lea    -0x1(%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
L45:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jle    L18
  jmp    L85
L102:
  nop
L85:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jl     L126
  mov    -0x28(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
L126:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  sub    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rax,%rcx
  mov    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  sub    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  sub    -0x8(%rbp),%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L4
L69:
  cmpl   $0x0,-0xc(%rbp)
  jle    L52
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jg     L52
  mov    -0x30(%rbp),%rax
  lea    D2(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x28(%rbp),%rax
  movl   $0x0,(%rax)
L4:
  nop
L52:
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D2
type_guessed: string

tool: 

assistant: ```c
void ems1Rform(const char *text, const int maxlen, int *iposn, char *string, int *strlength) {
  int ilast;
  int iplen;
  int istart;
  ;
  iplen = strlen(text);
  if ((iplen > 0) && (*iposn < iplen)) {
    if (*iposn < 0)
      *iposn = 0;
    istart = *iposn;
    ilast = istart + maxlen - 1;
    if (ilast > iplen) {
      (void)strcpy(string, &text[istart]);
      *strlength = iplen - istart;
      *iposn = 0;
    } else {
      for (*iposn = ilast; *iposn >= istart; (*iposn)--) {
        if (text[*iposn] == ' ')
          break;
      }
      if (*iposn <= istart)
        *iposn = ilast;
      *iposn = *iposn + 1;
      (void)strncpy(string, &text[istart], (size_t)(*iposn - istart));
      string[*iposn - istart] = '\0';
      *strlength = *iposn - istart;
    }
  } else if ((iplen > 0) && (*iposn >= iplen)) {
    strcpy(string, "");
    *iposn = 0;
  }
  return;
}
```