user: 下面的汇编指令对应的C源代码是什么:

```asm
<str_trim>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %esi,0xc(%rsp)
  mov    %rdx,(%rsp)
  test   %esi,%esi
  jle    L43
L139:
  mov    (%rsp),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %rax,%r14
  mov    %eax,%ebp
  sub    $0x1,%edx
  js     L116
  movslq %edx,%rdx
  lea    (%rbx,%rdx,1),%r12
  xor    %ebx,%ebx
  jmp    L55
  nopl   0x0(%rax)
L16:
  add    $0x1,%ebx
  sub    $0x1,%r12
  cmp    %ebx,%ebp
  je     L7
L55:
  movsbl (%r12),%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L16
L120:
  xor    %edi,%edi
  cmp    %ebx,%r14d
  setge  %dil
  xor    %eax,%eax
  call   <assert@plt>
  cmp    %ebx,%r14d
  je     L131
  mov    (%rsp),%r12
  xor    %r15d,%r15d
  test   %r14d,%r14d
  jg     L68
  jmp    L42
  nopl   0x0(%rax)
L13:
  add    $0x1,%r15d
  add    $0x1,%r12
  cmp    %r15d,%ebp
  je     L3
L68:
  movsbl (%r12),%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L13
  mov    %r14d,%ebp
  sub    %r15d,%ebp
L42:
  sub    %ebx,%ebp
  xor    %edi,%edi
  test   %ebp,%ebp
  setg   %dil
  xor    %eax,%eax
  call   <assert@plt>
  mov    0xc(%rsp),%esi
  mov    %ebp,%edi
  xor    %eax,%eax
  sub    $0x1,%esi
  call   <MIN@plt>
  mov    %eax,%edi
  mov    %eax,%ebx
  xor    %eax,%eax
  not    %edi
  shr    $0x1f,%edi
  call   <assert@plt>
  mov    (%rsp),%r12
  movslq %ebx,%rcx
  movslq %r15d,%rdx
  movb   $0x0,0x0(%r13,%rcx,1)
  xor    %eax,%eax
  add    %rdx,%r12
  test   %ebx,%ebx
  jle    L83
  nopw   0x0(%rax,%rax,1)
L71:
  movzbl (%r12,%rax,1),%edx
  mov    %dl,0x0(%r13,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L71
L83:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L3:
  xor    %ebp,%ebp
  jmp    L42
  nopl   0x0(%rax)
L43:
  lea    D6(%rip),%rsi
  lea    D1(%rip),%rdi
  xor    %eax,%eax
  call   <m2s_opencl_panic@plt>
  jmp    L139
  nopw   0x0(%rax,%rax,1)
L7:
  mov    $0x1,%edi
  xor    %eax,%eax
  call   <assert@plt>
L131:
  movb   $0x0,0x0(%r13)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L116:
  xor    %ebx,%ebx
  jmp    L120
```

tool_calls: name: read_data
arguments: tag: D6
type: string
name: read_data
arguments: tag: D1
type: string

tool: D6: str_trim

tool: D1: %s: invalid value for 'size'

assistant: ```c
void str_trim(char *dest, int size, char *src) {
  int len;
  int new_len;
  int right_trim;
  int left_trim;
  int i;
  if (size < 1)
    m2s_opencl_panic("%s: invalid value for 'size'", __FUNCTION__);
  len = strlen(src);
  right_trim = 0;
  for (i = len - 1; i >= 0 && isspace(src[i]); i--)
    right_trim++;
  assert(right_trim <= len);
  if (right_trim == len) {
    *dest = '\0';
    return;
  }
  left_trim = 0;
  for (i = 0; i < len && isspace(src[i]); i++)
    left_trim++;
  new_len = len - left_trim - right_trim;
  assert(new_len > 0);
  new_len = MIN(new_len, size - 1);
  assert(new_len >= 0);
  dest[new_len] = '\0';
  for (i = 0; i < new_len; i++)
    dest[i] = src[i + left_trim];
}
```