user: 请从给定的汇编指令推导出C源代码：

```asm
<sieve>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  lea    -0x9000(%rsp),%r11
L3:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L3
  sub    $0xc88,%rsp
  mov    %rdi,-0x9c78(%rbp)
  mov    %rsi,-0x9c80(%rbp)
  mov    %rdx,-0x9c88(%rbp)
  mov    %rcx,-0x9c90(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x9c68(%rbp)
  jmp    L59
L40:
  mov    -0x9c68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x9c80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <is_prime@plt>
  test   %rax,%rax
  je     L41
  mov    -0x9c68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x9c80(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x9c90(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x9c90(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x9c90(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x9c88(%rbp),%rax
  add    %rax,%rdx
  mov    (%rcx),%eax
  mov    %eax,(%rdx)
  jmp    L2
L41:
  addl   $0x1,-0x9c68(%rbp)
L59:
  mov    -0x9c78(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x9c68(%rbp)
  jl     L40
L2:
  mov    -0x9c90(%rbp),%rax
  mov    (%rax),%eax
  not    %eax
  shr    $0x1f,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0xffffffff,-0x9c64(%rbp)
  movl   $0x0,-0x9c68(%rbp)
  jmp    L106
L54:
  mov    -0x9c68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x9c80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x9c90(%rbp),%rdx
  mov    (%rdx),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x9c88(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%ecx
  cltd
  idiv   %ecx
  mov    %edx,%eax
  test   %eax,%eax
  je     L78
  mov    -0x9c68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x9c80(%rbp),%rax
  add    %rdx,%rax
  addl   $0x1,-0x9c64(%rbp)
  mov    (%rax),%edx
  mov    -0x9c64(%rbp),%eax
  cltq
  mov    %edx,-0x9c60(%rbp,%rax,4)
L78:
  addl   $0x1,-0x9c68(%rbp)
L106:
  mov    -0x9c78(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x9c68(%rbp)
  jl     L54
  mov    -0x9c64(%rbp),%eax
  not    %eax
  shr    $0x1f,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x9c64(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x9c78(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x9c78(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  lea    -0x9c60(%rbp),%rcx
  mov    -0x9c80(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x9c90(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x9c88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ebx
  mov    -0x9c64(%rbp),%eax
  cltq
  mov    -0x9c60(%rbp,%rax,4),%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  cmp    %eax,%ebx
  jg     L100
  mov    -0x9c90(%rbp),%rcx
  mov    -0x9c88(%rbp),%rdx
  mov    -0x9c80(%rbp),%rsi
  mov    -0x9c78(%rbp),%rax
  mov    %rax,%rdi
  call   <sieve>
  jmp    L94
L100:
  nop
L94:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L80
  call   <__stack_chk_fail@plt>
L80:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void sieve(int *list_len, int list[], int primes[], int *primes_index) {
  int i;
  int work_index, work[10000];
  for (i = 0; i < *list_len; i++) {
    if (is_prime(list[i])) {
      primes[++(*primes_index)] = list[i];
      break;
    }
  }
  assert(*primes_index >= 0);
  work_index = -1;
  for (i = 0; i < *list_len; i++)
    if (list[i] % primes[*primes_index] != 0)
      work[++work_index] = list[i];
  assert(work_index >= 0);
  *list_len = work_index + 1;
  memcpy(list, work, sizeof(work[0]) * *list_len);
  if (primes[*primes_index] > sqrt(work[work_index]))
    return;
  sieve(list_len, list, primes, primes_index);
}
```