user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<problem10>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movl   $0x1e8480,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  add    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L34
L31:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x20(%rbp)
L34:
  mov    -0x20(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L31
  movl   $0x2,-0x20(%rbp)
  jmp    L125
L8:
  mov    -0x20(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L13
L136:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltd
  idivl  -0x20(%rbp)
  mov    %edx,%eax
  test   %eax,%eax
  jne    L116
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L116:
  addl   $0x1,-0x1c(%rbp)
L13:
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L136
  mov    -0x20(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L29
L30:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L3
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  jmp    L125
L3:
  addl   $0x1,-0x1c(%rbp)
L29:
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L30
L125:
  mov    -0x20(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L8
  movq   $0x0,-0x10(%rbp)
  movl   $0x2,-0x20(%rbp)
  jmp    L49
L7:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L71
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  add    %rax,-0x10(%rbp)
L71:
  addl   $0x1,-0x20(%rbp)
L49:
  mov    -0x20(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L7
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D9
data_type: string

tool: D9: The sum of the all primes under %d is %ld


assistant: ```c
int problem10(void) {
  int num_primes = 2000000;
  int *primes = malloc(sizeof *primes * num_primes);
  int i, j, sr = sqrt(num_primes) + 1;
  long sum;
  for (i = 0; i < num_primes; i++)
    primes[i] = i;
  for (i = 2; i < sr;) {
    for (j = i + 1; j < num_primes; j++) {
      if (primes[j] % i == 0) {
        primes[j] = 0;
      }
    }
    for (j = i + 1; j < num_primes; j++) {
      if (primes[j] != 0) {
        i = j;
        break;
      }
    }
  }
  for (sum = 0, i = 2; i < num_primes; i++) {
    if (primes[i] != 0) {
      sum += primes[i];
    }
  }
  printf("The sum of the all primes under %d is %ld\n", num_primes, sum);
  free(primes);
  return 0;
}
```