user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    $0x1,%ebx
  mov    $0x0,%r13d
  lea    D92(%rip),%r14
  lea    D22(%rip),%rbp
  lea    D16(%rip),%r15
  jmp    L192
  lea    D164(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rsp,%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  lea    D42(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x4(%rsp),%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  mov    (%rsp),%ecx
  mov    %ecx,%esi
  mov    0x4(%rsp),%edx
  cmp    $0x1,%edx
  jbe    L182
  mov    $0x1,%eax
L135:
  add    $0x1,%eax
  cmp    %eax,%edx
  jne    L135
  sub    $0x2,%edx
  imul   %ecx,%edx
  lea    (%rdx,%rcx,2),%esi
L182:
  lea    D7(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L192:
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  sub    $0x31,%eax
  cmp    $0x4,%al
  ja     L155
  movzbl %al,%eax
  movslq 0x0(%rbp,%rax,4),%rax
  add    %rbp,%rax
  notrack jmp *%rax
  lea    D164(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rsp,%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  lea    D42(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x4(%rsp),%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%ecx
  mov    (%rsp),%edx
  cmp    %edx,%ecx
  jbe    L77
  lea    D146(%rip),%rdi
  call   <puts@plt>
  jmp    L192
L77:
  mov    %edx,%esi
  sub    %ecx,%esi
  js     L211
  mov    %edx,%r12d
L50:
  sub    %ecx,%r12d
  add    $0x1,%r13d
  lea    (%rsi,%r12,1),%eax
  cmp    %edx,%eax
  jns    L50
L117:
  mov    %r13d,%esi
  lea    D107(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12d,%esi
  lea    D124(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L192
L211:
  mov    %edx,%r12d
  jmp    L117
  lea    D164(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rsp,%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  mov    (%rsp),%eax
  test   %eax,%eax
  jne    L159
  lea    D165(%rip),%rdi
  call   <puts@plt>
  jmp    L192
L159:
  mov    %eax,%esi
  cmp    $0x1,%eax
  jbe    L115
  sub    $0x1,%eax
L149:
  imul   %eax,%esi
  sub    $0x1,%eax
  jne    L149
L115:
  lea    D7(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L192
  lea    D164(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rsp,%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  mov    (%rsp),%esi
  cmp    $0x2,%esi
  jbe    L129
  mov    $0x2,%ecx
L188:
  mov    %esi,%eax
  mov    $0x0,%edx
  div    %ecx
  test   %edx,%edx
  cmove  %edx,%ebx
  add    $0x1,%ecx
  cmp    %esi,%ecx
  jne    L188
L129:
  test   %ebx,%ebx
  je     L41
  lea    D172(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L192
L41:
  lea    D78(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L192
L155:
  lea    D110(%rip),%rdi
  call   <puts@plt>
  jmp    L192
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L177
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L177:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D92
type_infered: string
name: disassemble_data
arguments: data_label: D16
type_infered: string
name: disassemble_data
arguments: data_label: D164
type_infered: string
name: disassemble_data
arguments: data_label: D42
type_infered: string
name: disassemble_data
arguments: data_label: D7
type_infered: string
name: disassemble_data
arguments: data_label: D146
type_infered: string
name: disassemble_data
arguments: data_label: D107
type_infered: string
name: disassemble_data
arguments: data_label: D124
type_infered: string
name: disassemble_data
arguments: data_label: D165
type_infered: string
name: disassemble_data
arguments: data_label: D172
type_infered: string
name: disassemble_data
arguments: data_label: D78
type_infered: string
name: disassemble_data
arguments: data_label: D110
type_infered: string

tool: D92: 
Select one of the following options: 
(1) Multiply by adding
(2) Divide by subtracting
(3) Factorial
(4) isPrimeOrNot
(5) Exit
	Enter Option:

tool: D16: %d

tool: D164: Please enter a positive integer: 

tool: D42: Please enter another positive integer: 

tool: D7: Your answer is %d


tool: D146: The second integer must be larger than the first!

tool: D107: The quotient is %d


tool: D124: The remainder is %d


tool: D165: The number must be a positive integer.

tool: D172: %d is a prime number.


tool: D78: %d is not a prime number.


tool: D110: Please enter a valid number between 1 and 5.

assistant: ```c
int main() {
  unsigned int firstInt;
  unsigned int secondInt;
  unsigned int quotient = 0;
  unsigned int rmainder;
  unsigned int isPrime = 1;
  int testQuotient;
  int output;
  int loopRunning = 1;
  char option;
  while (loopRunning) {
    printf("\nSelect one of the following options: \n(1) Multiply by adding\n(2) Divide by subtracting\n(3) Factorial\n(4) isPrimeOrNot\n(5) Exit\n\tEnter Option:");
    option = getchar();
    switch (option) {
    case '1':
      printf("Please enter a positive integer: ");
      scanf("%d", &firstInt);
      printf("Please enter another positive integer: ");
      scanf("%d", &secondInt);
      output = firstInt;
      for (int i = 1; i < secondInt; i += 1) {
        output += firstInt;
      }
      printf("Your answer is %d\n", output);
      break;
    case '2':
      printf("Please enter a positive integer: ");
      scanf("%d", &firstInt);
      printf("Please enter another positive integer: ");
      scanf("%d", &secondInt);
      if (secondInt > firstInt) {
        printf("The second integer must be larger than the first!\n");
      } else {
        rmainder = firstInt;
        testQuotient = rmainder - secondInt;
        while (testQuotient > -1) {
          rmainder = rmainder - secondInt;
          testQuotient -= secondInt;
          quotient += 1;
        }
        printf("The quotient is %d\n", quotient);
        printf("The remainder is %d\n", rmainder);
      }
      break;
    case '3':
      printf("Please enter a positive integer: ");
      scanf("%d", &firstInt);
      if (firstInt < 1) {
        printf("The number must be a positive integer.\n");
      } else {
        output = firstInt;
        for (int i = 1; i < firstInt; i += 1) {
          output *= firstInt - i;
        }
        printf("Your answer is %d\n", output);
      }
      break;
    case '4':
      printf("Please enter a positive integer: ");
      scanf("%d", &firstInt);
      for (int i = 2; i < firstInt; i += 1) {
        if (firstInt % i == 0) {
          isPrime = 0;
        }
      }
      if (isPrime) {
        printf("%d is a prime number.\n", firstInt);
      } else {
        printf("%d is not a prime number.\n");
      }
      break;
    case '5':
      loopRunning = 0;
      break;
    default:
      printf("Please enter a valid number between 1 and 5.\n");
    }
  }
}
```