user: What is the c source code of the assembly code below?

```asm
<sieve>:
  endbr64
  pxor   %xmm0,%xmm0
  push   %r13
  pxor   %xmm1,%xmm1
  mov    %rsi,%r13
  cvtsi2sd %edi,%xmm0
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  ucomisd %xmm0,%xmm1
  ja     L47
  sqrtsd %xmm0,%xmm0
L153:
  cvttsd2si %xmm0,%r12d
  movslq %ebx,%rdi
  mov    $0x1,%esi
  call   <calloc@plt>
  mov    0x0(%r13),%rdi
  mov    %rax,%rbp
  mov    $0x101,%eax
  mov    %ax,0x0(%rbp)
  call   <free@plt>
  cmp    $0x1,%r12d
  jle    L285
  lea    0x1(%r12),%esi
  mov    $0x4,%ecx
  mov    $0x2,%edx
  jmp    L136
  nopl   0x0(%rax,%rax,1)
L43:
  add    $0x1,%rdx
  add    $0x2,%ecx
  cmp    %rsi,%rdx
  je     L285
L136:
  cmpb   $0x0,0x0(%rbp,%rdx,1)
  jne    L43
  cmp    %ecx,%ebx
  jle    L43
  movslq %ecx,%rax
  nopw   0x0(%rax,%rax,1)
L297:
  movb   $0x1,0x0(%rbp,%rax,1)
  add    %rdx,%rax
  cmp    %eax,%ebx
  jg     L297
  add    $0x1,%rdx
  add    $0x2,%ecx
  cmp    %rsi,%rdx
  jne    L136
L285:
  test   %ebx,%ebx
  jle    L29
  lea    -0x1(%rbx),%eax
  cmp    $0xe,%eax
  jbe    L174
  mov    %ebx,%edx
  pxor   %xmm1,%xmm1
  pxor   %xmm5,%xmm5
  mov    %rbp,%rax
  shr    $0x4,%edx
  movdqa D2(%rip),%xmm6
  pxor   %xmm4,%xmm4
  shl    $0x4,%rdx
  add    %rbp,%rdx
  nop
L108:
  movdqu (%rax),%xmm0
  movdqa %xmm5,%xmm3
  add    $0x10,%rax
  pcmpeqb %xmm5,%xmm0
  pand   %xmm6,%xmm0
  pcmpgtb %xmm0,%xmm3
  movdqa %xmm0,%xmm2
  punpcklbw %xmm3,%xmm2
  punpckhbw %xmm3,%xmm0
  movdqa %xmm4,%xmm3
  pcmpgtw %xmm2,%xmm3
  movdqa %xmm2,%xmm7
  punpcklwd %xmm3,%xmm7
  punpckhwd %xmm3,%xmm2
  movdqa %xmm0,%xmm3
  paddd  %xmm7,%xmm1
  paddd  %xmm2,%xmm1
  movdqa %xmm4,%xmm2
  pcmpgtw %xmm0,%xmm2
  punpcklwd %xmm2,%xmm3
  punpckhwd %xmm2,%xmm0
  paddd  %xmm3,%xmm1
  paddd  %xmm0,%xmm1
  cmp    %rdx,%rax
  jne    L108
  movdqa %xmm1,%xmm0
  mov    %ebx,%eax
  psrldq $0x8,%xmm0
  and    $0xfffffff0,%eax
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm1
  movd   %xmm1,%r12d
  test   $0xf,%bl
  je     L172
L79:
  movslq %eax,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0x1(%rax),%edx
  adc    $0x0,%r12d
  cmp    %ebx,%edx
  jge    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0x2(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0x3(%rax),%edx
  adc    $0x0,%r12d
  cmp    %ebx,%edx
  jge    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0x4(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0x5(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0x6(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0x7(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0x8(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0x9(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0xa(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0xb(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0xc(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  lea    0xd(%rax),%edx
  adc    $0x0,%r12d
  cmp    %edx,%ebx
  jle    L172
  movslq %edx,%rdx
  cmpb   $0x1,0x0(%rbp,%rdx,1)
  adc    $0x0,%r12d
  add    $0xe,%eax
  cmp    %eax,%ebx
  jle    L172
  cltq
  cmpb   $0x1,0x0(%rbp,%rax,1)
  adc    $0x0,%r12d
  nop
L172:
  movslq %r12d,%rdi
  mov    %ebx,%ebx
  shl    $0x2,%rdi
  call   <malloc@plt>
  xor    %edx,%edx
  xor    %ecx,%ecx
  mov    %rax,0x0(%r13)
  cs nopw 0x0(%rax,%rax,1)
L298:
  cmpb   $0x0,0x0(%rbp,%rdx,1)
  jne    L261
  movslq %ecx,%rsi
  add    $0x1,%ecx
  mov    %edx,(%rax,%rsi,4)
L261:
  add    $0x1,%rdx
  cmp    %rbx,%rdx
  jne    L298
L161:
  mov    %rbp,%rdi
  call   <free@plt>
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L29:
  xor    %edi,%edi
  xor    %r12d,%r12d
  call   <malloc@plt>
  mov    %rax,0x0(%r13)
  jmp    L161
L174:
  xor    %r12d,%r12d
  xor    %eax,%eax
  jmp    L79
L47:
  call   <sqrt@plt>
  jmp    L153
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D2
datatype: byte[16]

tool: {"D2": [0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01]}

assistant: ```c
int sieve(int lim, int **primes) {
  const int limSqrt = (int)sqrt((double)lim);
  int i, j, count = 0;
  char *nums = (char *)calloc(lim, sizeof(char));
  nums[0] = 1;
  nums[1] = 1;
  free(*primes);
  for (i = 2; i <= limSqrt; i++)
    if (!nums[i])
      for (j = i * 2; j < lim; j += i)
        nums[j] = 1;
  for (i = 0; i < lim; i++)
    if (!nums[i])
      count++;
  *primes = (int *)malloc(count * sizeof(int));
  j = 0;
  for (i = 0; i < lim; i++)
    if (!nums[i])
      (*primes)[j++] = i;
  free(nums);
  return count;
}
```