user: 请将以下的汇编代码转换成C语言代码：

```asm
<search>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  mov    0x10(%rbp),%rax
  sub    -0x40(%rbp),%rax
  cmp    $0x1,%rax
  ja     L0
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  sub    %rdx,%rax
  mov    %rax,%rsi
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rdi
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rcx
  mov    %rax,%rdx
  call   <matchlen@plt>
  mov    %rax,-0x10(%rbp)
  mov    0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  sub    %rdx,%rax
  mov    %rax,%rsi
  mov    0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rdi
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rcx
  mov    %rax,%rdx
  call   <matchlen@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jbe    L2
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    0x18(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x10(%rbp),%rax
  jmp    L54
L2:
  mov    0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    0x18(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x8(%rbp),%rax
  jmp    L54
L0:
  mov    0x10(%rbp),%rax
  sub    -0x40(%rbp),%rax
  shr    %rax
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x28(%rbp),%rax
  sub    %rcx,%rax
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  cmp    %rax,%rdx
  cmova  %rax,%rdx
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x20(%rbp),%rax
  add    %rax,%rcx
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jns    L15
  mov    -0x10(%rbp),%r8
  mov    -0x38(%rbp),%rdi
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  push   0x18(%rbp)
  push   0x10(%rbp)
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <search>
  add    $0x10,%rsp
  jmp    L54
L15:
  mov    -0x40(%rbp),%r8
  mov    -0x38(%rbp),%rdi
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  push   0x18(%rbp)
  push   -0x10(%rbp)
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <search>
  add    $0x10,%rsp
L54:
  leave
  ret
```

assistant: ```c
off_t search(off_t *I, u_char *old, off_t oldsize, u_char *new, off_t newsize, off_t st, off_t en, off_t *pos) {
  off_t x, y;
  if (en - st < 2) {
    x = matchlen(old + I[st], oldsize - I[st], new, newsize);
    y = matchlen(old + I[en], oldsize - I[en], new, newsize);
    if (x > y) {
      *pos = I[st];
      return x;
    } else {
      *pos = I[en];
      return y;
    }
  }
  x = st + (en - st) / 2;
  if (memcmp(old + I[x], new, (size_t)((((oldsize - I[x]) < (newsize)) ? (oldsize - I[x]) : (newsize)))) < 0) {
    return search(I, old, oldsize, new, newsize, x, en, pos);
  } else {
    return search(I, old, oldsize, new, newsize, st, x, pos);
  };
}
```