user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r12
  lea    D28(%rip),%rdi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    D11(%rip),%rdi
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%edi
  test   %edi,%edi
  js     L55
  mov    $0x2,%r12d
  cmp    $0x3,%edi
  jg     L154
  jmp    L139
  nopl   0x0(%rax,%rax,1)
L167:
  mov    0x4(%rsp),%edi
  mov    %edi,%eax
  cltd
  idiv   %r12d
  test   %edx,%edx
  je     L111
  add    $0x1,%r12d
L154:
  call   <sqrt@plt>
  cmp    %eax,%r12d
  jle    L167
  mov    0x4(%rsp),%esi
  lea    D38(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L132:
  mov    0x4(%rsp),%edi
  mov    $0x2,%r12d
  jmp    L8
  cs nopw 0x0(%rax,%rax,1)
L146:
  mov    0x4(%rsp),%edi
  mov    %edi,%eax
  cltd
  idiv   %r12d
  test   %edx,%edx
  je     L19
  add    $0x1,%r12d
L8:
  call   <sqrt@plt>
  cmp    %eax,%r12d
  jle    L146
  mov    0x4(%rsp),%esi
  lea    D38(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L37:
  mov    $0x2,%r12d
  jmp    L104
  nopw   0x0(%rax,%rax,1)
L148:
  add    $0x1,%r12d
  call   <sqrt@plt>
  cmp    %eax,%r12d
  jg     L119
L104:
  mov    0x4(%rsp),%edi
  mov    %edi,%eax
  cltd
  idiv   %r12d
  test   %edx,%edx
  jne    L148
  mov    %edi,%esi
  mov    %r12d,%edx
  lea    D69(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L52:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L63
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %r12
  ret
L119:
  mov    0x4(%rsp),%esi
  lea    D38(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L52
L111:
  mov    %edi,%esi
  mov    %r12d,%edx
  lea    D69(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L132
L19:
  mov    %edi,%esi
  mov    %r12d,%edx
  lea    D69(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L37
L139:
  lea    D85(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L52
L55:
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L52
L63:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D28
datatype: string
name: extract_symbolic_data
arguments: data_tag: D11
datatype: string
name: extract_symbolic_data
arguments: data_tag: D38
datatype: string
name: extract_symbolic_data
arguments: data_tag: D69
datatype: string
name: extract_symbolic_data
arguments: data_tag: D85
datatype: string
name: extract_symbolic_data
arguments: data_tag: D58
datatype: string

tool: D28: Enter the number: 

tool: D11: %d

tool: D38: Number %d is prime



tool: D69: Number %d is not prime, denominator is %d



tool: D85: Number is prime

tool: D58: Number must be positive

assistant: ```c
int main() {
  int number, denominator, is_prime = 1;
  printf("Enter the number: ");
  scanf("%d", &number);
  if (number < 0) {
    printf("Number must be positive");
    return 0;
  }
  if (number <= 3) {
    printf("Number is prime");
    return 0;
  }
  for (denominator = 2; denominator <= (int)sqrt(number); denominator++) {
    if ((number % denominator) == 0) {
      printf("Number %d is not prime, denominator is %d\n\n", number, denominator);
      is_prime = 0;
      break;
    }
  }
  if (is_prime) {
    printf("Number %d is prime\n\n", number);
  }
  is_prime = 1;
  denominator = 2;
  while (denominator <= (int)sqrt(number)) {
    if ((number % denominator) == 0) {
      printf("Number %d is not prime, denominator is %d\n\n", number, denominator);
      is_prime = 0;
      break;
    }
    denominator++;
  }
  if (is_prime) {
    printf("Number %d is prime\n\n", number);
  }
  is_prime = 1;
  denominator = 2;
  do {
    if ((number % denominator) == 0) {
      printf("Number %d is not prime, denominator is %d\n\n", number, denominator);
      is_prime = 0;
      break;
    }
    denominator++;
  } while (denominator <= (int)sqrt(number));
  if (is_prime) {
    printf("Number %d is prime\n\n", number);
  }
  return 0;
}
```