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

```asm
<main>:
  endbr64
  push   %r14
  lea    D30(%rip),%rdi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x150,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x148(%rsp)
  xor    %eax,%eax
  lea    0x80(%rsp),%rbp
  call   <printf@plt>
  nopl   0x0(%rax)
L20:
  xor    %eax,%eax
  movslq %ebx,%r12
  call   <getchar@plt>
  mov    %al,0x0(%rbp,%rbx,1)
  add    $0x1,%rbx
  cmp    $0xa,%al
  jne    L20
  lea    D18(%rip),%rdi
  xor    %eax,%eax
  lea    0x10(%rsp),%r13
  xor    %ebx,%ebx
  movb   $0x0,0x80(%rsp,%r12,1)
  call   <printf@plt>
  nopl   0x0(%rax)
L29:
  xor    %eax,%eax
  movslq %ebx,%r12
  call   <getchar@plt>
  mov    %al,0x0(%r13,%rbx,1)
  add    $0x1,%rbx
  cmp    $0xa,%al
  jne    L29
  movb   $0x0,0x10(%rsp,%r12,1)
  lea    D22(%rip),%rdi
  xor    %eax,%eax
  lea    D0(%rip),%r12
  call   <printf@plt>
  lea    0x8(%rsp),%r14
  mov    %r12,%rdi
  mov    %r14,%rsi
  call   <scanf@plt>
  mov    0x8(%rsp),%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <ins_string@plt>
  mov    %rbp,%rsi
  lea    D32(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D68(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0xc(%rsp),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%esi
  mov    0x8(%rsp),%edx
  mov    %rbp,%rdi
  call   <delnchars@plt>
  xor    %eax,%eax
  mov    %rbp,%rsi
  lea    D43(%rip),%rdi
  call   <printf@plt>
  mov    0x148(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L13
  add    $0x150,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L13:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D30
type_infered: string
name: parse_data
arguments: label: D18
type_infered: string
name: parse_data
arguments: label: D22
type_infered: string
name: parse_data
arguments: label: D0
type_infered: string
name: parse_data
arguments: label: D32
type_infered: string
name: parse_data
arguments: label: D68
type_infered: string
name: parse_data
arguments: label: D43
type_infered: string

tool: D30: Enter the main string: 

tool: D18: Enter the sub-string: 

tool: D22: Enter the position to insert sub-string to main string: 

tool: D0: %d

tool: D32: The main string is now:
%s


tool: D68: Enter the number of characters and the position to delete from in the above string: 

tool: D43: The string is now:
%s


assistant: ```c
int main() {
  char str1[2 * 100], str2[100];
  int i, x, n;
  printf("Enter the main string: ");
  i = 0;
  while ((str1[i++] = getchar()) != '\n')
    ;
  str1[i - 1] = '\0';
  printf("Enter the sub-string: ");
  i = 0;
  while ((str2[i++] = getchar()) != '\n')
    ;
  str2[i - 1] = '\0';
  printf("Enter the position to insert sub-string to main string: ");
  scanf("%d", &x);
  ins_string(str1, str2, x);
  printf("The main string is now:\n%s\n", str1);
  printf("Enter the number of characters and the position to delete from in the above string: ");
  scanf("%d", &n);
  scanf("%d", &x);
  delnchars(str1, n, x);
  printf("The string is now:\n%s\n", str1);
  return 0;
}
```