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    $0xe8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  movl   $0x1,0xc(%rsp)
  lea    D84(%rip),%rdi
  call   <puts@plt>
  lea    0xc(%rsp),%rsi
  lea    D92(%rip),%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  mov    %eax,0x10(%rsp)
  sub    $0x1,%eax
  cmp    $0x3,%eax
  ja     L9
  mov    $0x1,%r12d
  mov    $0x1,%ebx
  lea    D68(%rip),%r14
  lea    D92(%rip),%r13
  lea    D90(%rip),%r15
  jmp    L23
L68:
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0xc(%rsp),%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L30
  cmp    $0x4,%eax
  jg     L30
L85:
  add    $0x1,%ebx
  mov    0xc(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0x3,%eax
  ja     L33
  mov    %ebp,%r12d
L23:
  mov    %r14,%rdi
  call   <puts@plt>
  lea    0xc(%rsp),%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%esi
  movslq %ebx,%rax
  mov    %esi,0x10(%rsp,%rax,4)
  lea    0x1(%r12),%ebp
  test   %esi,%esi
  je     L68
  cmp    $0x4,%esi
  jle    L85
  jmp    L68
L30:
  movslq %ebx,%rdx
  mov    %eax,0x10(%rsp,%rdx,4)
  mov    %ebx,%esi
  lea    D109(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x2(%r12),%ebp
  add    $0x1,%ebx
  jmp    L85
L33:
  lea    D54(%rip),%rdi
  call   <puts@plt>
  lea    D65(%rip),%rdi
  call   <puts@plt>
  cmp    $0x1,%ebp
  jle    L77
  lea    0x10(%rsp),%rbx
  lea    -0x2(%rbp),%eax
  lea    0x14(%rsp,%rax,4),%r12
  lea    D105(%rip),%rbp
L81:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x4,%rbx
  cmp    %r12,%rbx
  jne    L81
L77:
  mov    0xd8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L20
  mov    $0x0,%eax
  add    $0xe8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L9:
  lea    D54(%rip),%rdi
  call   <puts@plt>
  lea    D65(%rip),%rdi
  call   <puts@plt>
  jmp    L77
L20:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D84
type: string
name: disassemble_data
arguments: data_tag: D92
type: string
name: disassemble_data
arguments: data_tag: D68
type: string
name: disassemble_data
arguments: data_tag: D90
type: string
name: disassemble_data
arguments: data_tag: D109
type: string
name: disassemble_data
arguments: data_tag: D54
type: string
name: disassemble_data
arguments: data_tag: D65
type: string
name: disassemble_data
arguments: data_tag: D105
type: string

tool: D84: 
Input a number, 1 - 4. Where 1 represents an infant, 2 a child, 3 a teen, 4 an adult. (Use a negative number to exit.)

tool: D92: %d

tool: D68: 
Input a number, 1 - 4 where 1 represents an infant, 2 a child, 3 a teen, 4 an adult. (Use a negative number to exit.)

tool: D90: 
Invalid input! you entered '%d'
Please input 1-4 or program will exit


tool: D109: i = %d


tool: D54: 

***END PROGRAM!***

tool: D65: You entered the following items:

tool: D105: %d 

assistant: ```c
int main() {
  int i = 0, itemCount = 0, input = 1, infant = 0, child = 0, teen = 0, adult = 0, PeopleTypes[50];
  printf("\nInput a number, 1 - 4. Where 1 represents an infant, 2 a child, 3 a teen, 4 an adult. (Use a negative number to exit.)\n");
  scanf("%d", &input);
  itemCount++;
  PeopleTypes[i] = input;
  i++;
  for (i = 1; (input > 0) && (input <= 4); i++) {
    printf("\nInput a number, 1 - 4 where 1 represents an infant, 2 a child, 3 a teen, 4 an adult. (Use a negative number to exit.)\n");
    scanf("%d", &input);
    PeopleTypes[i] = input;
    itemCount++;
    if ((input == 0) || (input > 4)) {
      printf("\nInvalid input! you entered '%d'\nPlease input 1-4 or program will exit\n", PeopleTypes[i]);
      scanf("%d", &input);
      if ((input == 0) || (input > 4)) {
        PeopleTypes[i] = input;
        printf("i = %d\n", i);
        itemCount++;
        i++;
      } else
        ;
    }
  }
  i--;
  itemCount--;
  printf("\n\n***END PROGRAM!***\n");
  printf("You entered the following items:\n");
  for (i = 0; i < itemCount; i++) {
    printf("%d ", PeopleTypes[i]);
  }
  return 0;
}
```