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

```asm
<shine_dalgarno_mm>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,%r15
  mov    %esi,%ebx
  mov    %esi,0x4(%rsp)
  mov    %edx,0x8(%rsp)
  mov    %rcx,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    -0x4(%rdx),%esi
  sub    %ebx,%esi
  mov    $0x6,%edi
  call   <imin@plt>
  mov    %eax,%ebx
  cmp    $0x5,%eax
  jg     L485
  cltq
  movsd  D187(%rip),%xmm0
L9:
  movsd  %xmm0,0x10(%rsp,%rax,8)
  add    $0x1,%rax
  cmp    $0x5,%eax
  jle    L9
L485:
  test   %ebx,%ebx
  jle    L348
  mov    0x4(%rsp),%r13d
  lea    0x10(%rsp),%r14
  mov    $0x0,%r12d
  jmp    L560
L588:
  movsd  D136(%rip),%xmm6
  movsd  %xmm6,(%r14)
  jmp    L135
L166:
  mov    %r15,%rdi
  call   <is_g@plt>
  cmp    $0x1,%eax
  je     L519
  movsd  D216(%rip),%xmm7
  movsd  %xmm7,(%r14)
L135:
  add    $0x1,%r12d
  add    $0x1,%r13d
  add    $0x8,%r14
  cmp    %r12d,%ebx
  je     L348
L560:
  mov    %r13d,%esi
  test   %r13d,%r13d
  js     L135
  movslq %r12d,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  mov    %r12d,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,2),%eax
  cmp    %eax,%r12d
  jne    L166
  mov    %r15,%rdi
  call   <is_a@plt>
  cmp    $0x1,%eax
  je     L588
  movsd  D59(%rip),%xmm7
  movsd  %xmm7,(%r14)
  jmp    L135
L519:
  movsd  D88(%rip),%xmm6
  movsd  %xmm6,(%r14)
  jmp    L135
L348:
  mov    $0x1,%edi
  mov    $0x0,%r10d
  mov    $0x0,%r15d
  cmp    $0x4,%ebx
  jle    L360
  pxor   %xmm2,%xmm2
  movsd  D5(%rip),%xmm4
  movapd %xmm2,%xmm3
  movsd  D98(%rip),%xmm6
  mov    0x8(%rsp),%r14d
  jmp    L15
L360:
  mov    $0x0,%r15d
L592:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L19
  mov    %r15d,%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L21:
  add    $0x1,%r11d
L352:
  cmp    %ecx,%r8d
  jle    L177
  cmp    %r12d,%r8d
  jl     L202
L177:
  subsd  %xmm4,%xmm1
L202:
  add    $0x1,%r8
  cmp    %r8d,%r9d
  jle    L620
L483:
  movsd  0x10(%rsp,%r8,8),%xmm0
  addsd  %xmm0,%xmm1
  comisd %xmm0,%xmm2
  ja     L21
  comisd %xmm0,%xmm3
  jbe    L202
  jmp    L352
L620:
  cmp    $0x1,%r11d
  jne    L94
  mov    %esi,%r8d
  cmp    $0x4,%esi
  jle    L291
  lea    -0xb(%rsi),%r9d
  cmp    $0x1,%r9d
  jbe    L201
  movsd  D88(%rip),%xmm0
  cmp    $0xc,%esi
  jg     L204
  movsd  D127(%rip),%xmm0
  comisd %xmm1,%xmm0
  ja     L94
  ucomisd D127(%rip),%xmm1
  setnp  %r8b
  mov    $0x0,%r11d
  cmovne %r11d,%r8d
  ucomisd D108(%rip),%xmm1
  setnp  %r9b
  cmovne %r11d,%r9d
  pxor   %xmm0,%xmm0
  mov    $0x0,%r12d
L392:
  ucomisd D98(%rip),%xmm1
  setnp  %r11b
  ucomisd %xmm6,%xmm1
  mov    $0x0,%r13d
  cmovne %r13d,%r11d
  test   %r12b,%r12b
  je     L280
  test   %r11b,%r11b
  je     L280
  mov    $0x3,%r10d
  jmp    L468
L291:
  movsd  D1(%rip),%xmm0
L204:
  cmp    $0xf,%r8d
  jg     L94
  comisd %xmm1,%xmm5
  ja     L94
  ucomisd D127(%rip),%xmm1
  setnp  %r8b
  mov    $0x0,%r11d
  cmovne %r11d,%r8d
  ucomisd D88(%rip),%xmm0
  setnp  %r12b
  cmovne %r11d,%r12d
  ucomisd D108(%rip),%xmm1
  setnp  %r9b
  cmovne %r11d,%r9d
  mov    %r8d,%r11d
  or     %r9b,%r11b
  je     L392
  test   %r12b,%r12b
  je     L392
  mov    $0x2,%r10d
L468:
  movslq %r10d,%r8
  movsd  0x0(%rbp,%r8,8),%xmm1
  movslq %r15d,%r8
  movsd  0x0(%rbp,%r8,8),%xmm0
  comisd %xmm1,%xmm0
  ja     L94
  ucomisd %xmm0,%xmm1
  jp     L134
  jne    L134
  cmp    %r10d,%r15d
  cmovl  %r10d,%r15d
L94:
  add    $0x1,%rax
  add    $0x1,%ecx
  add    $0x1,%edx
  sub    $0x1,%esi
  cmp    %rdi,%rax
  je     L41
L516:
  mov    %edx,%r9d
  cmp    %eax,%edx
  jle    L94
  mov    %rax,%r8
  movsd  D216(%rip),%xmm1
  mov    $0x0,%r11d
  lea    -0x2(%rdx),%r12d
  jmp    L483
L201:
  movsd  D136(%rip),%xmm0
  jmp    L204
L280:
  ucomisd D136(%rip),%xmm0
  setnp  %r13b
  mov    $0x0,%r12d
  cmove  %r13d,%r12d
  mov    %r12b,0x8(%rsp)
  test   %r8b,%r8b
  je     L567
  test   %r12b,%r12b
  je     L567
  mov    $0x4,%r10d
  jmp    L468
L567:
  ucomisd D1(%rip),%xmm0
  setnp  %r13b
  mov    $0x0,%r12d
  cmove  %r13d,%r12d
  mov    %r12b,0xe(%rsp)
  test   %r8b,%r8b
  je     L421
  test   %r12b,%r12b
  je     L421
  mov    $0x5,%r10d
  jmp    L468
L421:
  ucomisd D56(%rip),%xmm0
  setnp  0xf(%rsp)
  movzbl 0xf(%rsp),%r12d
  mov    $0x0,%r13d
  cmovne %r13d,%r12d
  mov    %r12d,%r13d
  test   %r8b,%r8b
  je     L642
  test   %r12b,%r12b
  je     L642
  mov    $0x9,%r10d
  jmp    L468
L642:
  cmpb   $0x0,0x8(%rsp)
  je     L244
  test   %r9b,%r9b
  je     L244
  mov    $0x7,%r10d
  jmp    L468
L244:
  cmpb   $0x0,0xe(%rsp)
  je     L247
  test   %r9b,%r9b
  je     L247
  mov    $0x8,%r10d
  jmp    L468
L247:
  test   %r13b,%r13b
  je     L51
  test   %r9b,%r9b
  je     L51
  mov    $0xe,%r10d
  jmp    L468
L51:
  test   %r11b,%r11b
  je     L532
  cmpb   $0x0,0x8(%rsp)
  je     L532
  mov    $0x11,%r10d
  jmp    L468
L532:
  test   %r11b,%r11b
  je     L569
  cmpb   $0x0,0xe(%rsp)
  je     L569
  mov    $0x12,%r10d
  jmp    L468
L569:
  test   %r11b,%r11b
  je     L468
  test   %r13b,%r13b
  mov    $0x13,%r8d
  cmovne %r8d,%r10d
  jmp    L468
L134:
  mov    %r10d,%r15d
  jmp    L94
L41:
  sub    $0x1,%ebx
  add    $0x1,%rdi
  cmp    $0x4,%ebx
  je     L592
L15:
  mov    %edi,%eax
  sub    $0x1,%eax
  js     L41
  mov    %ebx,%edx
  mov    %r14d,%esi
  sub    0x4(%rsp),%esi
  sub    %ebx,%esi
  mov    $0x1,%ecx
  mov    $0x0,%eax
  movsd  D127(%rip),%xmm5
  jmp    L516
L19:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D187
type: f32[2]
name: read_data
arguments: label: D136
type: f64
name: read_data
arguments: label: D216
type: f32[2]
name: read_data
arguments: label: D59
type: f32[2]
name: read_data
arguments: label: D88
type: f64
name: read_data
arguments: label: D5
type: f64
name: read_data
arguments: label: D98
type: f64
name: read_data
arguments: label: D127
type: f64
name: read_data
arguments: label: D108
type: f64
name: read_data
arguments: label: D1
type: f32[2]
name: read_data
arguments: label: D56
type: f32[2]

tool: {"D187": [0.0,-2.5625]}

tool: D136: 2

tool: {"D216": [0.0,-2.0]}

tool: {"D59": [0.0,-2.125]}

tool: D88: 3

tool: D5: 10

tool: D98: 9

tool: D127: 6

tool: D108: 7

tool: {"D1": [0.0,1.875]}

tool: {"D56": [0.0,0.0]}

assistant: ```c
int shine_dalgarno_mm(unsigned char *seq, int pos, int start, double *rwt) {
  int i, j, k, mism, rdis, limit, max_val, cur_val = 0;
  double match[6], cur_ctr, dis_flag;
  limit = imin(6, start - 4 - pos);
  for (i = limit; i < 6; i++)
    match[i] = -10.0;
  for (i = 0; i < limit; i++) {
    if (pos + i < 0)
      continue;
    if (i % 3 == 0) {
      if (is_a(seq, pos + i) == 1)
        match[i] = 2.0;
      else
        match[i] = -3.0;
    } else {
      if (is_g(seq, pos + i) == 1)
        match[i] = 3.0;
      else
        match[i] = -2.0;
    }
  }
  max_val = 0;
  for (i = limit; i >= 5; i--) {
    for (j = 0; j <= limit - i; j++) {
      cur_ctr = -2.0;
      mism = 0;
      for (k = j; k < j + i; k++) {
        cur_ctr += match[k];
        if (match[k] < 0.0)
          mism++;
        if (match[k] < 0.0 && (k <= j + 1 || k >= j + i - 2))
          cur_ctr -= 10.0;
      }
      if (mism != 1)
        continue;
      rdis = start - (pos + j + i);
      if (rdis < 5) {
        dis_flag = 1;
      } else if (rdis > 10 && rdis <= 12) {
        dis_flag = 2;
      } else if (rdis >= 13) {
        dis_flag = 3;
      } else
        dis_flag = 0;
      if (rdis > 15 || cur_ctr < 6.0)
        continue;
      if (cur_ctr < 6.0)
        cur_val = 0;
      else if (cur_ctr == 6.0 && dis_flag == 3)
        cur_val = 2;
      else if (cur_ctr == 7.0 && dis_flag == 3)
        cur_val = 2;
      else if (cur_ctr == 9.0 && dis_flag == 3)
        cur_val = 3;
      else if (cur_ctr == 6.0 && dis_flag == 2)
        cur_val = 4;
      else if (cur_ctr == 6.0 && dis_flag == 1)
        cur_val = 5;
      else if (cur_ctr == 6.0 && dis_flag == 0)
        cur_val = 9;
      else if (cur_ctr == 7.0 && dis_flag == 2)
        cur_val = 7;
      else if (cur_ctr == 7.0 && dis_flag == 1)
        cur_val = 8;
      else if (cur_ctr == 7.0 && dis_flag == 0)
        cur_val = 14;
      else if (cur_ctr == 9.0 && dis_flag == 2)
        cur_val = 17;
      else if (cur_ctr == 9.0 && dis_flag == 1)
        cur_val = 18;
      else if (cur_ctr == 9.0 && dis_flag == 0)
        cur_val = 19;
      if (rwt[cur_val] < rwt[max_val])
        continue;
      if (rwt[cur_val] == rwt[max_val] && cur_val < max_val)
        continue;
      max_val = cur_val;
    }
  }
  return max_val;
}
```