user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<scan_motif4>:
  endbr64
  push   %r15
  movaps %xmm0,%xmm2
  push   %r14
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rsi,0x8(%rsp)
  mov    0xa8(%rsp),%esi
  mov    %ecx,0x30(%rsp)
  sub    %edx,%ecx
  mov    0x98(%rsp),%r14d
  mov    %r8,0x10(%rsp)
  mov    %ecx,%r13d
  mov    %r9,0x18(%rsp)
  test   %esi,%esi
  jle    L9
  mov    %edx,%esi
  mov    $0x1,%edi
  movss  %xmm0,0x34(%rsp)
  call   <cvector@plt>
  lea    -0x1(%r12),%esi
  xor    %edi,%edi
  mov    %rax,0x28(%rsp)
  call   <cvector@plt>
  movss  0x34(%rsp),%xmm2
  mov    %rax,0x20(%rsp)
L9:
  mov    %r12d,%eax
  neg    %eax
  mov    %eax,0x34(%rsp)
  test   %r13d,%r13d
  jle    L319
  movsd  D21(%rip),%xmm1
  mov    %eax,%r8d
  mov    $0x1,%ebx
  xor    %r10d,%r10d
  jmp    L175
  nopl   0x0(%rax,%rax,1)
L72:
  add    $0x1,%rbx
  cmp    %ebx,%r13d
  jl     L125
L175:
  mov    %ebx,%eax
  mov    %ebx,%r9d
  mov    %ebx,%r15d
  sub    %r8d,%eax
  cmp    %r14d,%eax
  jle    L72
  test   %r12d,%r12d
  jle    L329
  mov    0x8(%rsp),%rsi
  lea    0x1(%r12),%edi
  mov    $0x1,%eax
  pxor   %xmm0,%xmm0
  add    %rbx,%rsi
  jmp    L24
  xchg   %ax,%ax
L299:
  mov    0x0(%rbp,%rdx,8),%rdx
  addss  (%rdx,%rax,4),%xmm0
  add    $0x1,%rax
  cmp    %rdi,%rax
  je     L94
L24:
  movsbq -0x1(%rsi,%rax,1),%rdx
  lea    -0x1(%rdx),%ecx
  cmp    $0x3,%cl
  jbe    L299
  cvtss2sd %xmm0,%xmm0
  subsd  %xmm1,%xmm0
  add    $0x1,%rax
  cvtsd2ss %xmm0,%xmm0
  cmp    %rdi,%rax
  jne    L24
L94:
  comiss %xmm2,%xmm0
  jb     L72
  mov    0x10(%rsp),%rsi
  add    $0x1,%r10d
  mov    0x30(%rsp),%edx
  mov    %r15d,%r8d
  movslq %r10d,%rax
  mov    0xa8(%rsp),%ecx
  lea    (%rsi,%rax,4),%r11
  mov    0x18(%rsp),%rsi
  sub    %r9d,%edx
  mov    %edx,(%r11)
  movb   $0x1,(%rsi,%rax,1)
  test   %ecx,%ecx
  jle    L72
  test   %r12d,%r12d
  jle    L27
  mov    0x8(%rsp),%rsi
  mov    0x28(%rsp),%rdi
  movslq %r12d,%rcx
  xor    %eax,%eax
  add    %rbx,%rsi
  nopw   0x0(%rax,%rax,1)
L196:
  movzbl (%rsi,%rax,1),%edx
  mov    %dl,0x1(%rdi,%rax,1)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L196
L27:
  mov    0x20(%rsp),%rdi
  mov    %r10d,0x4c(%rsp)
  add    $0x1,%rbx
  lea    D19(%rip),%rsi
  movss  %xmm2,0x48(%rsp)
  mov    %r11,0x38(%rsp)
  movss  %xmm0,0x40(%rsp)
  call   <sprintf@plt>
  mov    0x20(%rsp),%rdx
  mov    0x28(%rsp),%rdi
  mov    %r12d,%esi
  mov    $0x1,%ecx
  call   <num2seq@plt>
  mov    0x38(%rsp),%r11
  mov    0x20(%rsp),%r8
  mov    $0x1,%r9d
  movss  0x40(%rsp),%xmm0
  mov    0xa8(%rsp),%edx
  lea    D23(%rip),%rsi
  mov    (%r11),%ecx
  mov    0xa0(%rsp),%rdi
  call   <fprintf@plt>
  mov    D21(%rip),%rax
  mov    0x4c(%rsp),%r10d
  mov    %r15d,%r8d
  movss  0x48(%rsp),%xmm2
  movq   %rax,%xmm1
  cmp    %ebx,%r13d
  jge    L175
  nopw   0x0(%rax,%rax,1)
L125:
  cmpl   $0x1,0x90(%rsp)
  je     L187
L275:
  mov    0xa8(%rsp),%eax
  test   %eax,%eax
  jle    L111
  mov    0x28(%rsp),%rdi
  mov    %r12d,%edx
  mov    $0x1,%esi
  mov    %r10d,0x8(%rsp)
  call   <free_cvector@plt>
  mov    0x20(%rsp),%rdi
  lea    -0x1(%r12),%edx
  xor    %esi,%esi
  call   <free_cvector@plt>
  mov    0x8(%rsp),%r10d
L111:
  add    $0x58,%rsp
  mov    %r10d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L329:
  pxor   %xmm0,%xmm0
  jmp    L94
L187:
  mov    0x30(%rsp),%ebx
  mov    $0x1,%edi
  mov    %r10d,0x40(%rsp)
  movss  %xmm2,0x48(%rsp)
  mov    %ebx,%esi
  call   <cvector@plt>
  mov    0x8(%rsp),%rdi
  mov    %ebx,%edx
  mov    $0x1,%ebx
  mov    %rax,%rsi
  mov    %rax,0x38(%rsp)
  call   <revcomp@plt>
  mov    0x38(%rsp),%r11
  mov    0x34(%rsp),%esi
  movsd  D21(%rip),%xmm1
  mov    0x40(%rsp),%r10d
  movss  0x48(%rsp),%xmm2
  jmp    L341
  nopl   0x0(%rax,%rax,1)
L220:
  add    $0x1,%rbx
  cmp    %ebx,%r13d
  jl     L255
L341:
  mov    %ebx,%eax
  mov    %ebx,%r15d
  sub    %esi,%eax
  cmp    %r14d,%eax
  jle    L220
  test   %r12d,%r12d
  jle    L238
  lea    0x1(%r12),%ecx
  mov    $0x1,%eax
  pxor   %xmm0,%xmm0
  lea    (%r11,%rbx,1),%rdx
  jmp    L180
  xchg   %ax,%ax
L266:
  mov    0x0(%rbp,%rdi,8),%rdi
  addss  (%rdi,%rax,4),%xmm0
  add    $0x1,%rax
  cmp    %rax,%rcx
  je     L43
L180:
  movsbq -0x1(%rdx,%rax,1),%rdi
  lea    -0x1(%rdi),%r8d
  cmp    $0x3,%r8b
  jbe    L266
  cvtss2sd %xmm0,%xmm0
  subsd  %xmm1,%xmm0
  add    $0x1,%rax
  cvtsd2ss %xmm0,%xmm0
  cmp    %rax,%rcx
  jne    L180
L43:
  comiss %xmm2,%xmm0
  jb     L220
  mov    0x10(%rsp),%rsi
  add    $0x1,%r10d
  mov    0xa8(%rsp),%edx
  movslq %r10d,%rax
  lea    (%rsi,%rax,4),%rsi
  mov    %r15d,(%rsi)
  mov    %rsi,0x8(%rsp)
  mov    0x18(%rsp),%rsi
  movb   $0x0,(%rsi,%rax,1)
  mov    %r15d,%esi
  test   %edx,%edx
  jle    L220
  test   %r12d,%r12d
  jle    L200
  mov    0x28(%rsp),%rdi
  movslq %r12d,%rsi
  xor    %eax,%eax
  lea    (%r11,%rbx,1),%rdx
  nopl   0x0(%rax,%rax,1)
L163:
  movzbl (%rdx,%rax,1),%ecx
  mov    %cl,0x1(%rdi,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L163
L200:
  mov    0x20(%rsp),%rdi
  lea    D19(%rip),%rsi
  mov    %r10d,0x48(%rsp)
  mov    %r11,0x40(%rsp)
  movss  %xmm2,0x38(%rsp)
  movss  %xmm0,0x34(%rsp)
  call   <sprintf@plt>
  mov    0x20(%rsp),%rdx
  mov    0x28(%rsp),%rdi
  mov    %r12d,%esi
  mov    $0x1,%ecx
  call   <num2seq@plt>
  mov    0x8(%rsp),%rax
  xor    %r9d,%r9d
  mov    0x20(%rsp),%r8
  movss  0x34(%rsp),%xmm0
  mov    0xa8(%rsp),%edx
  lea    D23(%rip),%rsi
  mov    (%rax),%ecx
  mov    0xa0(%rsp),%rdi
  call   <fprintf@plt>
  mov    D21(%rip),%rax
  mov    0x48(%rsp),%r10d
  mov    %r15d,%esi
  mov    0x40(%rsp),%r11
  movss  0x38(%rsp),%xmm2
  movq   %rax,%xmm1
  jmp    L220
L108:
  mov    0x30(%rsp),%ebx
  mov    $0x1,%edi
  mov    %ebx,%esi
  call   <cvector@plt>
  mov    0x8(%rsp),%rdi
  mov    %ebx,%edx
  mov    %rax,%rsi
  mov    %rax,0x10(%rsp)
  call   <revcomp@plt>
  mov    0x10(%rsp),%r11
  xor    %r10d,%r10d
  nopw   0x0(%rax,%rax,1)
L255:
  mov    0x30(%rsp),%edx
  mov    $0x1,%esi
  mov    %r11,%rdi
  mov    %r10d,0x8(%rsp)
  call   <free_cvector@plt>
  mov    0x8(%rsp),%r10d
  jmp    L275
L319:
  cmpl   $0x1,0x90(%rsp)
  je     L108
  xor    %r10d,%r10d
  jmp    L275
L238:
  pxor   %xmm0,%xmm0
  jmp    L43
```

tool_calls: name: retrieve_data
arguments: tag: D21
type_guessed: f64
name: retrieve_data
arguments: tag: D19
type_guessed: f32
name: retrieve_data
arguments: tag: D23
type_guessed: string

tool: D21: 7.6

tool: D19: 0

tool: D23: %d	%d	%.4f	%s	%d


assistant: ```c
int scan_motif4(float **weight_matrix, char *sequence, int motif_length, int seq_length, float threshold, int *pos, char *strand, int rc, int min_dist, FILE *log_file, int seq_nr) {
  int i, j, k;
  int i_stop;
  char c;
  float p;
  int n;
  float current_score;
  char *revcomp_seq;
  int curr_strand;
  char *word;
  char *numword;
  int previous_position;
  i_stop = seq_length - motif_length;
  n = 0;
  if (seq_nr > 0) {
    numword = cvector(1, motif_length);
    word = cvector(0, motif_length - 1);
  }
  previous_position = -motif_length;
  curr_strand = 1;
  for (i = 1; i <= i_stop; i++) {
    if ((i - previous_position) > min_dist) {
      current_score = 0.0;
      for (j = 1; j <= motif_length; j++) {
        c = sequence[i + j - 1];
        if ((c > 0) & (c < 5)) {
          p = weight_matrix[c][j];
          current_score += p;
        } else {
          current_score += -7.6;
        }
      }
      if (current_score >= threshold) {
        previous_position = i;
        n++;
        pos[n] = seq_length - i;
        strand[n] = curr_strand;
        if (seq_nr > 0) {
          for (j = 1; j <= motif_length; j++)
            numword[j] = sequence[i + j - 1];
          sprintf(word, "");
          num2seq(numword, motif_length, word, 1);
          fprintf(log_file, "%d\t%d\t%.4f\t%s\t%d\n", seq_nr, pos[n], current_score, word, curr_strand);
        }
      }
    }
  }
  curr_strand = 0;
  previous_position = -motif_length;
  if (rc == 1) {
    revcomp_seq = cvector(1, seq_length);
    revcomp(sequence, revcomp_seq, seq_length);
    for (i = 1; i <= i_stop; i++) {
      if ((i - previous_position) > min_dist) {
        current_score = 0.0;
        for (j = 1; j <= motif_length; j++) {
          c = revcomp_seq[i + j - 1];
          if ((c > 0) & (c < 5)) {
            p = weight_matrix[c][j];
            current_score += p;
          } else {
            current_score += -7.6;
          }
        }
        if (current_score >= threshold) {
          previous_position = i;
          n++;
          pos[n] = i;
          strand[n] = 0;
          if (seq_nr > 0) {
            for (j = 1; j <= motif_length; j++)
              numword[j] = revcomp_seq[i + j - 1];
            sprintf(word, "");
            num2seq(numword, motif_length, word, 1);
            fprintf(log_file, "%d\t%d\t%.4f\t%s\t%d\n", seq_nr, pos[n], current_score, word, curr_strand);
          }
        }
      }
    }
    free_cvector(revcomp_seq, 1, seq_length);
  }
  if (seq_nr > 0) {
    free_cvector(numword, 1, motif_length);
    free_cvector(word, 0, motif_length - 1);
  }
  return n;
}
```