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

```asm
<move_blocks_inwards_while_likelihood_improves>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rsi,0x48(%rsp)
  mov    %edx,0x1c(%rsp)
  test   %edi,%edi
  jle    L41
  movslq %edi,%rdx
  xor    %r13d,%r13d
  mov    %r9,0x20(%rsp)
  mov    (%rsi),%rax
  mov    %rdx,0x10(%rsp)
  mov    %rcx,%r14
  mov    0x8(%rsi),%rdx
  mov    %r8d,%ebp
  mov    %rsi,%rbx
  mov    %r13,%r15
  jmp    L75
  nopl   0x0(%rax,%rax,1)
L236:
  mov    0x8(%rbx),%rdx
  lea    (%rax,%r13,1),%rdi
  mov    (%rdi),%ecx
  lea    (%rdx,%r13,1),%r9
  mov    (%r9),%esi
  cmp    0x8(%rsp),%ecx
  je     L136
  mov    %esi,0x30(%rsp)
  mov    %ecx,0x8(%rsp)
L240:
  add    $0x1,%r15
  cmp    %r15,0x10(%rsp)
  je     L188
L75:
  mov    (%rax,%r15,4),%edi
  mov    (%rdx,%r15,4),%r12d
  mov    %ebp,%ecx
  xor    %edx,%edx
  mov    %r14,%rsi
  lea    0x0(,%r15,4),%r13
  call   <find_starting_index@plt>
  mov    %ebp,%ecx
  mov    %r14,%rsi
  mov    %r12d,%edi
  mov    %eax,%edx
  call   <find_starting_index@plt>
  mov    (%rbx),%rax
  test   %r15,%r15
  jne    L236
  mov    (%rax,%r15,4),%edx
  mov    %edx,0x8(%rsp)
  mov    0x8(%rbx),%rdx
  mov    (%rdx,%r15,4),%ecx
  add    $0x1,%r15
  mov    %ecx,0x30(%rsp)
  cmp    %r15,0x10(%rsp)
  jne    L75
L188:
  mov    0x10(%rsp),%rcx
  mov    0x20(%rsp),%r15
  movq   $0x0,0x28(%rsp)
  shl    $0x2,%rcx
  mov    %rcx,0x40(%rsp)
  jmp    L150
  xchg   %ax,%ax
L165:
  addq   $0x4,0x28(%rsp)
  mov    0x28(%rsp),%rbx
  cmp    %rbx,0x40(%rsp)
  je     L41
L150:
  mov    0x28(%rsp),%rsi
  mov    (%rax,%rsi,1),%r10d
  cmp    $0xffffffff,%r10d
  je     L165
  mov    (%rdx,%rsi,1),%ebx
  cmp    $0xffffffff,%ebx
  je     L165
  mov    0x48(%rsp),%rax
  mov    %r10d,%edi
  xor    %edx,%edx
  mov    %ebp,%ecx
  mov    %r10d,0x8(%rsp)
  mov    0x18(%rax),%rax
  mov    (%rax,%rsi,1),%eax
  mov    %r14,%rsi
  mov    %eax,0x10(%rsp)
  call   <find_starting_index@plt>
  mov    %ebp,%ecx
  mov    %r14,%rsi
  mov    %ebx,%edi
  mov    %eax,%edx
  mov    %eax,0x30(%rsp)
  mov    %eax,%r13d
  call   <find_starting_index@plt>
  sub    $0x8,%rsp
  mov    %r15,%rcx
  mov    %ebx,%esi
  mov    %eax,0x44(%rsp)
  mov    %r13d,%r9d
  mov    %ebp,%r8d
  mov    %r14,%rdx
  push   %rax
  mov    0x18(%rsp),%edi
  call   <find_number_of_snps_in_block_with_start_end_index@plt>
  pop    %rcx
  pop    %rsi
  cmpl   $0xffffffff,0x10(%rsp)
  mov    0x8(%rsp),%r10d
  mov    %eax,%r12d
  je     L39
L160:
  mov    0x10(%rsp),%edx
  mov    0x98(%rsp),%edi
  mov    %r12d,%ecx
  mov    %ebp,%esi
  mov    %r10d,0x20(%rsp)
  call   <get_block_likelihood@plt>
  mov    0x20(%rsp),%r10d
  movsd  %xmm0,0x8(%rsp)
  cmp    %ebx,%r10d
  jge    L198
  cmp    0x1c(%rsp),%r12d
  jl     L198
  mov    %r12d,0x38(%rsp)
  mov    %r10d,%r13d
  jmp    L179
  nopl   0x0(%rax)
L29:
  cmp    %r12d,%eax
  jle    L153
  sub    $0x8,%rsp
  mov    %ebp,%r8d
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    0x44(%rsp),%eax
  mov    %ebx,%esi
  mov    %r13d,%edi
  push   %rax
  mov    0x40(%rsp),%r9d
  call   <find_number_of_snps_in_block_with_start_end_index@plt>
  mov    0xb8(%rsp),%r8d
  mov    %ebx,%ecx
  mov    %r13d,%edx
  mov    0xa0(%rsp),%rsi
  mov    0xb0(%rsp),%rdi
  mov    %eax,%r12d
  call   <calculate_block_size_without_gaps@plt>
  mov    0xa8(%rsp),%edi
  mov    %r12d,%ecx
  mov    %ebp,%esi
  mov    %eax,%edx
  mov    %eax,0x30(%rsp)
  call   <get_block_likelihood@plt>
  pop    %rax
  pop    %rdx
  movsd  0x8(%rsp),%xmm1
  comisd %xmm0,%xmm1
  jb     L153
  addl   $0x1,0x30(%rsp)
  cmp    %r12d,0x1c(%rsp)
  mov    0x20(%rsp),%eax
  jg     L220
  mov    %r12d,0x38(%rsp)
  mov    %eax,0x10(%rsp)
  movsd  %xmm0,0x8(%rsp)
L179:
  lea    0x1(%r13),%edi
  mov    %ebp,%ecx
  mov    %r15,%rdx
  mov    %r14,%rsi
  mov    %r13d,0x34(%rsp)
  mov    %r13d,%r12d
  call   <advance_window_start_to_next_snp@plt>
  mov    %eax,%r13d
  cmp    %eax,%ebx
  jg     L29
L153:
  mov    0x38(%rsp),%r12d
  mov    0x34(%rsp),%r13d
  mov    %r14,0x20(%rsp)
  jmp    L127
  nopl   0x0(%rax)
L286:
  cmp    %eax,%ebx
  jle    L1
  mov    %r12,%rdx
  mov    %ebp,%r8d
  mov    %r15,%rcx
  mov    %eax,%esi
  mov    %r13d,%edi
  call   <find_number_of_snps_in_block@plt>
  mov    0xa8(%rsp),%r8d
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    0x90(%rsp),%rsi
  mov    0xa0(%rsp),%rdi
  mov    %eax,%r12d
  call   <calculate_block_size_without_gaps@plt>
  mov    0x98(%rsp),%edi
  mov    %r12d,%ecx
  mov    %ebp,%esi
  mov    %eax,%edx
  mov    %eax,0x30(%rsp)
  call   <get_block_likelihood@plt>
  movsd  0x8(%rsp),%xmm2
  comisd %xmm0,%xmm2
  jb     L1
  mov    0x30(%rsp),%eax
  movsd  %xmm0,0x8(%rsp)
  mov    %r14d,%ebx
  mov    %eax,0x10(%rsp)
L127:
  cmp    %r13d,%ebx
  jle    L1
  cmp    0x1c(%rsp),%r12d
  jl     L1
  mov    0x20(%rsp),%r12
  lea    -0x1(%rbx),%edi
  mov    %ebp,%ecx
  mov    %r15,%rdx
  mov    %r12,%rsi
  call   <rewind_window_end_to_last_snp@plt>
  mov    %eax,%r14d
  cmp    %r13d,%eax
  jg     L286
L1:
  mov    0x20(%rsp),%r14
L242:
  mov    0x48(%rsp),%r11
  cvttsd2si 0x8(%rsp),%esi
  mov    0x28(%rsp),%rdi
  movsd  0x8(%rsp),%xmm3
  mov    (%r11),%rax
  mov    0x8(%r11),%rdx
  mov    0x10(%r11),%rcx
  mov    %r13d,(%rax,%rdi,1)
  mov    %ebx,(%rdx,%rdi,1)
  mov    %esi,(%rcx,%rdi,1)
  mov    0x18(%r11),%rcx
  mov    0x10(%rsp),%esi
  mov    %esi,(%rcx,%rdi,1)
  mov    0xb0(%rsp),%rcx
  movsd  %xmm3,(%rcx,%rdi,2)
  jmp    L165
  nopw   0x0(%rax,%rax,1)
L136:
  cmp    %esi,0x30(%rsp)
  je     L243
  mov    %esi,0x30(%rsp)
  jmp    L240
  nop
L41:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L220:
  mov    %eax,0x10(%rsp)
  mov    %r14,0x20(%rsp)
  movsd  %xmm0,0x8(%rsp)
  jmp    L127
  nopl   0x0(%rax)
L243:
  movl   $0xffffffff,(%rdi)
  movl   $0xffffffff,(%r9)
  jmp    L240
  nopw   0x0(%rax,%rax,1)
L39:
  mov    0x90(%rsp),%rsi
  mov    0xa8(%rsp),%r8d
  mov    %r10d,%edx
  mov    %ebx,%ecx
  mov    0xa0(%rsp),%rdi
  call   <calculate_block_size_without_gaps@plt>
  mov    0x48(%rsp),%rdx
  mov    0x28(%rsp),%rcx
  mov    %eax,%esi
  mov    %eax,0x10(%rsp)
  mov    0x8(%rsp),%r10d
  mov    0x10(%rdx),%rax
  movl   $0x0,(%rax,%rcx,1)
  mov    0x18(%rdx),%rax
  mov    %esi,(%rax,%rcx,1)
  jmp    L160
L198:
  mov    %r10d,%r13d
  jmp    L242
```

assistant: ```c
void move_blocks_inwards_while_likelihood_improves(int number_of_blocks, int **block_coordinates, int min_snps, int *snp_site_coords, int number_of_branch_snps, char *branch_snp_sequence, int *snp_locations, int branch_genome_size, char *child_sequence, int length_of_sequence, double *block_likelihoods, int cutoff_value) {
  int i;
  int previous_start;
  int previous_end;
  for (i = 0; i < number_of_blocks; i++) {
    int current_start = block_coordinates[0][i];
    int current_end = block_coordinates[1][i];
    int start_index = find_starting_index(current_start, snp_site_coords, 0, number_of_branch_snps);
    int end_index = find_starting_index(current_end, snp_site_coords, start_index, number_of_branch_snps);
    if (i == 0) {
      previous_start = block_coordinates[0][i];
      previous_end = block_coordinates[1][i];
    } else if (previous_start == block_coordinates[0][i] && previous_end == block_coordinates[1][i] && i > 0) {
      block_coordinates[0][i] = -1;
      block_coordinates[1][i] = -1;
    } else {
      previous_start = block_coordinates[0][i];
      previous_end = block_coordinates[1][i];
    }
  }
  for (i = 0; i < number_of_blocks; i++) {
    if (block_coordinates[0][i] == -1 || block_coordinates[1][i] == -1) {
      continue;
    }
    int current_start = block_coordinates[0][i];
    int current_end = block_coordinates[1][i];
    double current_block_likelihood = 0;
    int block_genome_size_without_gaps = block_coordinates[3][i];
    int block_snp_count;
    int next_start_position = current_start;
    int start_index = find_starting_index(current_start, snp_site_coords, 0, number_of_branch_snps);
    int end_index = find_starting_index(current_end, snp_site_coords, start_index, number_of_branch_snps);
    block_snp_count = find_number_of_snps_in_block_with_start_end_index(current_start, current_end, snp_site_coords, branch_snp_sequence, number_of_branch_snps, start_index, end_index);
    if (block_genome_size_without_gaps == -1) {
      block_genome_size_without_gaps = calculate_block_size_without_gaps(child_sequence, snp_locations, current_start, current_end, length_of_sequence);
      block_coordinates[2][i] = current_block_likelihood;
      block_coordinates[3][i] = block_genome_size_without_gaps;
    }
    current_block_likelihood = get_block_likelihood(branch_genome_size, number_of_branch_snps, block_genome_size_without_gaps, block_snp_count);
    while (current_start < current_end && block_snp_count >= min_snps) {
      next_start_position++;
      next_start_position = advance_window_start_to_next_snp(next_start_position, snp_site_coords, branch_snp_sequence, number_of_branch_snps);
      if (next_start_position >= current_end) {
        break;
      }
      if (next_start_position <= current_start) {
        break;
      }
      int previous_block_snp_count = block_snp_count;
      int previous_block_genome_size_without_gaps = block_genome_size_without_gaps;
      block_snp_count = find_number_of_snps_in_block_with_start_end_index(next_start_position, current_end, snp_site_coords, branch_snp_sequence, number_of_branch_snps, start_index, end_index);
      block_genome_size_without_gaps = calculate_block_size_without_gaps(child_sequence, snp_locations, next_start_position, current_end, length_of_sequence);
      double next_block_likelihood = get_block_likelihood(branch_genome_size, number_of_branch_snps, block_genome_size_without_gaps, block_snp_count);
      if (next_block_likelihood <= current_block_likelihood) {
        current_block_likelihood = next_block_likelihood;
        current_start = next_start_position;
        start_index++;
      } else {
        block_snp_count = previous_block_snp_count;
        block_genome_size_without_gaps = previous_block_genome_size_without_gaps;
        break;
      }
    }
    int next_end_position = current_end;
    while (current_start < current_end && block_snp_count >= min_snps) {
      next_end_position--;
      next_end_position = rewind_window_end_to_last_snp(next_end_position, snp_site_coords, branch_snp_sequence, number_of_branch_snps);
      if (next_end_position <= current_start) {
        break;
      }
      if (next_end_position >= current_end) {
        break;
      }
      int previous_block_snp_count = block_snp_count;
      int previous_block_genome_size_without_gaps = block_genome_size_without_gaps;
      block_snp_count = find_number_of_snps_in_block(current_start, next_end_position, snp_site_coords, branch_snp_sequence, number_of_branch_snps);
      block_genome_size_without_gaps = calculate_block_size_without_gaps(child_sequence, snp_locations, current_start, next_end_position, length_of_sequence);
      double next_block_likelihood = get_block_likelihood(branch_genome_size, number_of_branch_snps, block_genome_size_without_gaps, block_snp_count);
      if (next_block_likelihood <= current_block_likelihood) {
        current_block_likelihood = next_block_likelihood;
        current_end = next_end_position;
        end_index--;
      } else {
        block_snp_count = previous_block_snp_count;
        block_genome_size_without_gaps = previous_block_genome_size_without_gaps;
        break;
      }
    }
    block_coordinates[0][i] = current_start;
    block_coordinates[1][i] = current_end;
    block_coordinates[2][i] = (int)current_block_likelihood;
    block_coordinates[3][i] = block_genome_size_without_gaps;
    block_likelihoods[i] = current_block_likelihood;
  }
}
```