user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  cmpl   $0x1,-0x34(%rbp)
  jg     L29
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
L29:
  mov    -0x40(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x10(%rbp)
  cmpl   $0x1,-0x10(%rbp)
  jg     L95
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
L95:
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x2,-0x24(%rbp)
  jmp    L31
L71:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
  addl   $0x1,-0x24(%rbp)
L31:
  mov    -0x24(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jle    L71
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x10(%rbp),%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  mov    %eax,-0xc(%rbp)
  movl   $0x2,-0x20(%rbp)
  jmp    L11
L34:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L84
  mov    -0x20(%rbp),%eax
  add    %eax,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L74
L81:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  mov    -0x20(%rbp),%eax
  add    %eax,-0x1c(%rbp)
L74:
  mov    -0x1c(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jle    L81
L84:
  addl   $0x1,-0x20(%rbp)
L11:
  mov    -0x20(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L34
  movl   $0x0,-0x18(%rbp)
  movl   $0x2,-0x14(%rbp)
  jmp    L118
L19:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L62
  addl   $0x1,-0x18(%rbp)
L62:
  addl   $0x1,-0x14(%rbp)
L118:
  mov    -0x14(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jle    L19
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D4
data_type: string
name: unpack_data
arguments: tag: D8
data_type: string
name: unpack_data
arguments: tag: D19
data_type: string
name: unpack_data
arguments: tag: D14
data_type: string

tool: D4: Usage: ./prime <N>

tool: D8: N must be greater than 1

tool: D19: Finding primes in range 1..%d


tool: D14: Total %d primes found


assistant: ```c
int main(int argc, char **argv) {
  int N;
  if (argc < 2) {
    printf("Usage: ./prime <N>\n");
    exit(0);
  }
  if ((N = atoi(argv[1])) < 2) {
    printf("N must be greater than 1\n");
    exit(0);
  }
  printf("Finding primes in range 1..%d\n", N);
  int *array = (int *)malloc(sizeof(int) * (N + 1));
  for (int i = 2; i <= N; i++)
    array[i] = 1;
  int limit = (int)sqrt((double)N);
  for (int i = 2; i <= limit; i++) {
    if (array[i] == 1) {
      for (int j = i + i; j <= N; j += i)
        array[j] = 0;
    }
  }
  int cnt = 0;
  for (int i = 2; i <= N; i++) {
    if (array[i] == 1)
      cnt++;
  }
  printf("Total %d primes found\n", cnt);
}
```