user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x158,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x154(%rbp)
  nop
L21:
  mov    -0x154(%rbp),%ebx
  lea    0x1(%rbx),%eax
  mov    %eax,-0x154(%rbp)
  mov    $0x0,%eax
  call   <getchar@plt>
  movslq %ebx,%rdx
  mov    %al,-0xe0(%rbp,%rdx,1)
  movslq %ebx,%rax
  movzbl -0xe0(%rbp,%rax,1),%eax
  cmp    $0xa,%al
  jne    L21
  mov    -0x154(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movb   $0x0,-0xe0(%rbp,%rax,1)
  lea    D68(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x154(%rbp)
  nop
L29:
  mov    -0x154(%rbp),%ebx
  lea    0x1(%rbx),%eax
  mov    %eax,-0x154(%rbp)
  mov    $0x0,%eax
  call   <getchar@plt>
  movslq %ebx,%rdx
  mov    %al,-0x150(%rbp,%rdx,1)
  movslq %ebx,%rax
  movzbl -0x150(%rbp,%rax,1),%eax
  cmp    $0xa,%al
  jne    L29
  mov    -0x154(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movb   $0x0,-0x150(%rbp,%rax,1)
  lea    D64(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x15c(%rbp),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x15c(%rbp),%edx
  lea    -0x150(%rbp),%rcx
  lea    -0xe0(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <ins_string@plt>
  lea    -0xe0(%rbp),%rax
  mov    %rax,%rsi
  lea    D80(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x158(%rbp),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    -0x15c(%rbp),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x15c(%rbp),%edx
  mov    -0x158(%rbp),%ecx
  lea    -0xe0(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <delnchars@plt>
  lea    -0xe0(%rbp),%rax
  mov    %rax,%rsi
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L23
  call   <__stack_chk_fail@plt>
L23:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D12
type_guessed: string
name: read_data
arguments: data_label: D68
type_guessed: string
name: read_data
arguments: data_label: D64
type_guessed: string
name: read_data
arguments: data_label: D16
type_guessed: string
name: read_data
arguments: data_label: D80
type_guessed: string
name: read_data
arguments: data_label: D39
type_guessed: string
name: read_data
arguments: data_label: D55
type_guessed: string

tool: D12: Enter the main string: 

tool: D68: Enter the sub-string: 

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

tool: D16: %d

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


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

tool: D55: 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;
}
```