user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<matchcurves>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  mov    $0x8,%esi
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rdi,%r12
  mov    $0xa,%edi
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    $0x64,%edi
  mov    %rax,%rbp
  call   <calloc@plt>
  movq   %rbp,%xmm0
  mov    $0x8,%esi
  mov    $0x64,%edi
  movq   %rax,%xmm1
  mov    %rax,%rbx
  punpcklqdq %xmm1,%xmm0
  movaps %xmm0,(%rsp)
  call   <calloc@plt>
  mov    $0x28,%esi
  mov    %r12,%rdi
  mov    %rax,%r15
  call   <instr@plt>
  test   %rax,%rax
  je     L105
  movzbl (%r12),%eax
  test   %al,%al
  je     L102
  mov    %r12,%rcx
  xor    %esi,%esi
  mov    $0x1,%r8d
  xor    %r10d,%r10d
  mov    $0x1,%edi
  xor    %r9d,%r9d
  jmp    L47
  nopw   0x0(%rax,%rax,1)
L19:
  test   %edi,%edi
  je     L28
  movslq %r9d,%rcx
  mov    $0x1,%edi
  add    $0x1,%r9d
  mov    %al,0x0(%rbp,%rcx,1)
  mov    %rdx,%rcx
L138:
  movzbl (%rdx),%eax
  test   %al,%al
  je     L102
L47:
  lea    0x1(%rcx),%rdx
  cmp    %al,(%r14)
  jne    L19
L28:
  cmp    %al,0x1(%r14)
  je     L45
  test   %r8d,%r8d
  je     L20
  movslq %r10d,%rcx
  xor    %edi,%edi
  add    $0x1,%r10d
  mov    %al,(%rbx,%rcx,1)
  movzbl (%rdx),%eax
  mov    %rdx,%rcx
  test   %al,%al
  jne    L47
  nopl   0x0(%rax,%rax,1)
L102:
  movdqa (%rsp),%xmm2
  mov    %r15,0x10(%r13)
  mov    %rbp,%rdi
  movups %xmm2,0x0(%r13)
  call   <iskey@plt>
  test   %eax,%eax
  je     L27
L105:
  xor    %eax,%eax
L22:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L45:
  test   %r8d,%r8d
  je     L20
  movslq %r10d,%r8
  add    $0x1,%rdx
  mov    %al,(%rbx,%r8,1)
  movzbl 0x1(%rcx),%eax
L20:
  movslq %esi,%r8
  mov    %rdx,%rcx
  add    $0x1,%esi
  mov    %al,(%r15,%r8,1)
  xor    %r8d,%r8d
  jmp    L138
  nopl   0x0(%rax)
L27:
  mov    0x10(%r13),%rdi
  lea    D3(%rip),%rsi
  call   <strstr@plt>
  test   %eax,%eax
  jne    L105
  mov    0x8(%r13),%rcx
  mov    0x10(%r13),%r8
  mov    %r12,%rsi
  lea    D9(%rip),%rdi
  mov    0x0(%r13),%rdx
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L22
```

tool_calls: name: unpack_data
arguments: label: D3
type: string
name: unpack_data
arguments: label: D9
type: string

tool: D3: ;

tool: D9: %s
1:%s
2:%s
3:%s


assistant: ```c
int matchcurves(const char *teststr, const char *decollator, char *result[3]) {
  const char *str = teststr;
  int i = 0, iok = 1;
  int j = 0, jok = 1;
  int k = 0;
  char *before_curves = calloc(10, sizeof(char *));
  char *in_curves = calloc(100, sizeof(char *));
  char *after_curves = calloc(100, sizeof(char *));
  if (instr(teststr, '(')) {
    while (*str) {
      if (*str != decollator[0] && iok) {
        before_curves[i++] = *str++;
      } else if (*str != decollator[1] && jok) {
        iok = 0;
        in_curves[j++] = *str++;
      } else {
        if (jok) {
          jok = 0;
          in_curves[j] = *str++;
        }
        after_curves[k++] = *str++;
      }
    }
    result[0] = before_curves;
    result[1] = in_curves;
    result[2] = after_curves;
    if (!iskey(result[0]) && !strstr(result[2], ";")) {
      printf("%s\n1:%s\n2:%s\n3:%s\n", teststr, result[0], result[1], result[2]);
      return 1;
    }
  }
  return 0;
}
```