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

```asm
<problem10>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  movl   $0x0,-0x60(%rbp)
  mov    -0x64(%rbp),%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  mov    %eax,-0x4c(%rbp)
  mov    -0x64(%rbp),%eax
  mov    %eax,%edx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  mov    %eax,%edx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  mov    %eax,%edx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L66:
  cmp    %rdx,%rsp
  je     L11
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L66
L11:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L14
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L14:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x2,-0x5c(%rbp)
  jmp    L130
L116:
  mov    -0x40(%rbp),%rax
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rdx
  movl   $0x1,(%rax,%rdx,4)
  addl   $0x1,-0x5c(%rbp)
L130:
  mov    -0x5c(%rbp),%eax
  cmp    %eax,-0x64(%rbp)
  ja     L116
  movl   $0x2,-0x58(%rbp)
  jmp    L46
L71:
  mov    -0x40(%rbp),%rax
  mov    -0x58(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  test   %eax,%eax
  je     L97
  mov    -0x58(%rbp),%eax
  add    %eax,-0x60(%rbp)
  mov    -0x58(%rbp),%eax
  add    %eax,%eax
  mov    %eax,-0x54(%rbp)
  jmp    L101
L91:
  mov    -0x40(%rbp),%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%rdx
  movl   $0x0,(%rax,%rdx,4)
  mov    -0x58(%rbp),%eax
  add    %eax,-0x54(%rbp)
L101:
  mov    -0x54(%rbp),%eax
  cmp    %eax,-0x64(%rbp)
  ja     L91
L97:
  addl   $0x1,-0x58(%rbp)
L46:
  mov    -0x58(%rbp),%eax
  cmp    %eax,-0x4c(%rbp)
  jae    L71
  mov    -0x4c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x50(%rbp)
  jmp    L121
L29:
  mov    -0x40(%rbp),%rax
  mov    -0x50(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  test   %eax,%eax
  je     L102
  mov    -0x50(%rbp),%eax
  add    %eax,-0x60(%rbp)
L102:
  addl   $0x1,-0x50(%rbp)
L121:
  mov    -0x50(%rbp),%eax
  cmp    %eax,-0x64(%rbp)
  ja     L29
  mov    -0x60(%rbp),%edx
  mov    -0x64(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    %rbx,%rsp
  nop
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L57
  call   <__stack_chk_fail@plt>
L57:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: label: D2
type_infered: string

tool: D2: Problem 10: The sum of all primes below %u is %llu


assistant: ```c
void problem10(unsigned limit) {
  uint_fast64_t sum = 0;
  unsigned sqrt_limit = (int)sqrt(limit);
  bool sieve[limit];
  for (int i = 2; i < limit; ++i) {
    sieve[i] = true;
  }
  for (int i = 2; i <= sqrt_limit; ++i) {
    if (sieve[i]) {
      sum += i;
      for (int j = i * 2; j < limit; j += i) {
        sieve[j] = false;
      }
    }
  }
  for (int i = sqrt_limit + 1; i < limit; ++i) {
    if (sieve[i]) {
      sum += i;
    }
  }
  printf("Problem 10: The sum of all primes below %u is %llu\n", limit, sum);
}
```