user: Converte this assembly snippet into its equivalent C code:

```asm
<calculate_number_of_bases_in_recombations_excluding_gaps>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdx,0x8(%rsp)
  test   %esi,%esi
  jle    L178
  mov    %rdi,%rbx
  mov    %rcx,%r14
  mov    %r8d,%r15d
  mov    %esi,%ebp
  mov    $0x0,%ecx
  jmp    L174
L62:
  mov    %esi,(%rdx)
  mov    0x8(%rbx),%rsi
  lea    (%rsi,%r11,1),%rdx
  mov    (%rdx),%edi
  mov    (%rbx),%r8
  cmp    (%r8,%r9,1),%edi
  jge    L55
L111:
  mov    (%rbx),%rdx
  movl   $0xffffffff,(%rdx,%r9,1)
  mov    0x8(%rbx),%rdx
  movl   $0xffffffff,(%rdx,%r9,1)
L181:
  add    $0x1,%rax
  cmp    %rbp,%rax
  je     L40
L17:
  cmp    %ecx,%eax
  je     L181
  mov    (%rbx),%rdx
  lea    0x0(,%rax,4),%r9
  mov    (%rdx,%rax,4),%esi
  cmp    $0xffffffff,%esi
  je     L181
  mov    0x8(%rbx),%rdi
  mov    (%rdi,%rax,4),%r8d
  cmp    $0xffffffff,%r8d
  je     L181
  add    %r11,%rdx
  mov    (%rdx),%r10d
  cmp    %r10d,%r8d
  jl     L216
  cmp    %r10d,%esi
  jle    L62
L216:
  lea    (%rdi,%r11,1),%rdx
  mov    (%rdx),%r8d
  cmp    %r8d,%esi
  jg     L181
  mov    (%rdi,%r9,1),%esi
  cmp    %esi,%r8d
  jg     L181
L99:
  mov    %esi,(%rdx)
  jmp    L111
L40:
  add    $0x1,%rcx
  cmp    %rbp,%rcx
  je     L38
L174:
  lea    0x0(,%rcx,4),%r11
  mov    (%rbx),%rax
  cmpl   $0xffffffff,(%rax,%rcx,4)
  je     L40
  mov    0x8(%rbx),%rax
  cmpl   $0xffffffff,(%rax,%rcx,4)
  je     L40
  mov    $0x0,%eax
  jmp    L17
L38:
  shl    $0x2,%rbp
  mov    $0x0,%r12d
  mov    $0x0,%r13d
  jmp    L70
L100:
  add    $0x4,%r12
  cmp    %r12,%rbp
  je     L207
L70:
  mov    (%rbx),%rax
  mov    (%rax,%r12,1),%edx
  cmp    $0xffffffff,%edx
  je     L100
  mov    0x8(%rbx),%rax
  mov    (%rax,%r12,1),%ecx
  cmp    $0xffffffff,%ecx
  je     L100
  mov    %r15d,%r8d
  mov    %r14,%rsi
  mov    0x8(%rsp),%rdi
  call   <calculate_block_size_without_gaps@plt>
  add    %eax,%r13d
  jmp    L100
L178:
  mov    $0x0,%r13d
L207:
  mov    %r13d,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L55:
  mov    (%rsi,%r9,1),%esi
  cmp    %edi,%esi
  jl     L111
  jmp    L99
```

assistant: ```c
int calculate_number_of_bases_in_recombations_excluding_gaps(int **block_coordinates, int num_blocks, char *child_sequence, int *snp_locations, int length_of_original_genome) {
  int total_bases = 0;
  int current_block = 1;
  int start_block = 0;
  for (start_block = 0; start_block < num_blocks; start_block++) {
    if (block_coordinates[0][start_block] == -1 || block_coordinates[1][start_block] == -1) {
      continue;
    }
    for (current_block = 0; current_block < num_blocks; current_block++) {
      if (current_block == start_block) {
        continue;
      }
      if (block_coordinates[0][current_block] == -1 || block_coordinates[1][current_block] == -1) {
        continue;
      }
      int found_overlap = 0;
      if (block_coordinates[0][start_block] >= block_coordinates[0][current_block] && block_coordinates[0][start_block] <= block_coordinates[1][current_block]) {
        block_coordinates[0][start_block] = block_coordinates[0][current_block];
        found_overlap = 1;
      }
      if (block_coordinates[1][start_block] >= block_coordinates[0][current_block] && block_coordinates[1][start_block] <= block_coordinates[1][current_block]) {
        block_coordinates[1][start_block] = block_coordinates[1][current_block];
        found_overlap = 1;
      }
      if (found_overlap == 1) {
        block_coordinates[0][current_block] = -1;
        block_coordinates[1][current_block] = -1;
      }
    }
  }
  for (start_block = 0; start_block < num_blocks; start_block++) {
    if (block_coordinates[0][start_block] == -1 || block_coordinates[1][start_block] == -1) {
      continue;
    }
    total_bases += calculate_block_size_without_gaps(child_sequence, snp_locations, block_coordinates[0][start_block], block_coordinates[1][start_block], length_of_original_genome);
  }
  return total_bases;
}
```