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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %edi,%ebx
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  call   <getppid@plt>
  mov    %eax,%r12d
  mov    $0x0,%eax
  call   <getpid@plt>
  mov    %eax,%esi
  mov    %r12d,%edx
  lea    D148(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0x1,%ebx
  jle    L149
  mov    0x8(%rbp),%rdi
  call   <twice@plt>
  mov    %rax,%r14
  lea    D155(%rip),%rdi
  call   <puts@plt>
L104:
  mov    0x10(%rbp),%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  mov    0x18(%rbp),%rdi
  call   <atoi@plt>
  mov    %eax,%r12d
  mov    0x20(%rbp),%rsi
  lea    0xa0(%rsp),%rdi
  call   <strcpy@plt>
  cmp    %r12d,%ebx
  jg     L48
  movslq %ebx,%rbx
  mov    $0x0,%ebp
  lea    D2(%rip),%r15
  jmp    L51
L149:
  lea    D90(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  mov    $0x0,%r14d
  jmp    L104
L57:
  movslq %ebp,%rax
  movb   $0x0,0x30(%rsp,%rax,1)
  lea    0x30(%rsp),%rdi
  mov    %r15,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L18
  lea    0x30(%rsp),%rdi
  lea    D92(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L89
  lea    0x30(%rsp),%rdi
  lea    D160(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L32
  cmpb   $0x0,0x30(%rsp)
  je     L58
  lea    0x30(%rsp),%rsi
  lea    D62(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L58
L18:
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,(%rsp)
  lea    D57(%rip),%rsi
  call   <strcpy@plt>
  mov    $0x64,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x8(%rsp)
  mov    %r14d,%edx
  lea    D16(%rip),%rsi
  call   <sprintf@plt>
  mov    $0xa,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x10(%rsp)
  mov    %ebx,%edx
  lea    D183(%rip),%r13
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    $0xa,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x18(%rsp)
  mov    %r12d,%edx
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x20(%rsp)
  lea    0xa0(%rsp),%rsi
  call   <strcpy@plt>
  movq   $0x0,0x28(%rsp)
  mov    %rsp,%rsi
  lea    D57(%rip),%rdi
  call   <execvp@plt>
  lea    D185(%rip),%rdi
  call   <puts@plt>
L58:
  add    $0x1,%rbx
  cmp    %ebx,%r12d
  jl     L48
L51:
  movzbl 0xa0(%rsp,%rbx,1),%eax
  cmp    $0x20,%al
  je     L57
  movslq %ebp,%rdx
  mov    %al,0x30(%rsp,%rdx,1)
  add    $0x1,%ebp
  jmp    L58
L89:
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,(%rsp)
  lea    D9(%rip),%rsi
  call   <strcpy@plt>
  mov    $0x64,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x8(%rsp)
  mov    %r14d,%edx
  lea    D16(%rip),%rsi
  call   <sprintf@plt>
  mov    $0xa,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x10(%rsp)
  mov    %ebx,%edx
  lea    D183(%rip),%r13
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    $0xa,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x18(%rsp)
  mov    %r12d,%edx
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x20(%rsp)
  lea    0xa0(%rsp),%rsi
  call   <strcpy@plt>
  movq   $0x0,0x28(%rsp)
  mov    %rsp,%rsi
  lea    D9(%rip),%rdi
  call   <execvp@plt>
  lea    D185(%rip),%rdi
  call   <puts@plt>
  jmp    L58
L32:
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,(%rsp)
  lea    D97(%rip),%rsi
  call   <strcpy@plt>
  mov    $0x64,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x8(%rsp)
  mov    %r14d,%edx
  lea    D16(%rip),%rsi
  call   <sprintf@plt>
  mov    $0xa,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x10(%rsp)
  mov    %ebx,%edx
  lea    D183(%rip),%r13
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    $0xa,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x18(%rsp)
  mov    %r12d,%edx
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x20(%rsp)
  lea    0xa0(%rsp),%rsi
  call   <strcpy@plt>
  movq   $0x0,0x28(%rsp)
  mov    %rsp,%rsi
  lea    D97(%rip),%rdi
  call   <execvp@plt>
  lea    D185(%rip),%rdi
  call   <puts@plt>
  jmp    L58
L48:
  mov    %r14,%rsi
  lea    D114(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L98
  mov    $0x0,%eax
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L98:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D148
type: string
name: extract_symbolic_data
arguments: data_label: D155
type: string
name: extract_symbolic_data
arguments: data_label: D2
type: string
name: extract_symbolic_data
arguments: data_label: D90
type: string
name: extract_symbolic_data
arguments: data_label: D92
type: string
name: extract_symbolic_data
arguments: data_label: D160
type: string
name: extract_symbolic_data
arguments: data_label: D62
type: string
name: extract_symbolic_data
arguments: data_label: D57
type: string
name: extract_symbolic_data
arguments: data_label: D16
type: string
name: extract_symbolic_data
arguments: data_label: D183
type: string
name: extract_symbolic_data
arguments: data_label: D185
type: string
name: extract_symbolic_data
arguments: data_label: D9
type: string
name: extract_symbolic_data
arguments: data_label: D97
type: string
name: extract_symbolic_data
arguments: data_label: D114
type: string

tool: D148: Child id = %d ,Parent id= %d

tool: D155: ,Process Name= twice

tool: D2: twice

tool: D90: Insufficient Arguments

tool: D92: square

tool: D160: half

tool: D62: Error! No such %s Process Exist

tool: D57: ./twice

tool: D16: %llu

tool: D183: %d

tool: D185: 
This statement is not executed if execvp succeeds.

tool: D9: ./square

tool: D97: ./half

tool: D114: 
Final Result is %llu

assistant: ```c
int main(int argc, char *argv[]) {
  char *arglist[6], process_name[100], string[100];
  int p = 0, i;
  printf("Child id = %d ,Parent id= %d", getpid(), getppid());
  unsigned long long int res = 0;
  if (argc >= 2) {
    res = twice(argv[1]);
    printf(",Process Name= twice\n");
  } else {
    printf("Insufficient Arguments");
    exit(0);
  }
  int start = atoi(argv[2]);
  int end = atoi(argv[3]);
  strcpy(string, argv[4]);
  for (i = start; i <= end; i++) {
    if (string[i] == ' ') {
      process_name[p] = '\0';
      if (!strcmp(process_name, "twice")) {
        arglist[0] = (char *)malloc(8 * sizeof(char));
        strcpy(arglist[0], "./twice");
        arglist[1] = (char *)malloc(100 * sizeof(char));
        sprintf(arglist[1], "%llu", res);
        arglist[2] = (char *)malloc(10 * sizeof(char));
        sprintf(arglist[2], "%d", i);
        arglist[3] = (char *)malloc(10 * sizeof(char));
        sprintf(arglist[3], "%d", end);
        arglist[4] = (char *)malloc(end * sizeof(char));
        strcpy(arglist[4], string);
        arglist[5] = NULL;
        execvp("./twice", arglist);
        printf("\nThis statement is not executed if execvp succeeds.\n");
      } else if (!strcmp(process_name, "square")) {
        arglist[0] = (char *)malloc(8 * sizeof(char));
        strcpy(arglist[0], "./square");
        arglist[1] = (char *)malloc(100 * sizeof(char));
        sprintf(arglist[1], "%llu", res);
        arglist[2] = (char *)malloc(10 * sizeof(char));
        sprintf(arglist[2], "%d", i);
        arglist[3] = (char *)malloc(10 * sizeof(char));
        sprintf(arglist[3], "%d", end);
        arglist[4] = (char *)malloc(end * sizeof(char));
        strcpy(arglist[4], string);
        arglist[5] = NULL;
        execvp("./square", arglist);
        printf("\nThis statement is not executed if execvp succeeds.\n");
      } else if (!strcmp(process_name, "half")) {
        arglist[0] = (char *)malloc(8 * sizeof(char));
        strcpy(arglist[0], "./half");
        arglist[1] = (char *)malloc(100 * sizeof(char));
        sprintf(arglist[1], "%llu", res);
        arglist[2] = (char *)malloc(10 * sizeof(char));
        sprintf(arglist[2], "%d", i);
        arglist[3] = (char *)malloc(10 * sizeof(char));
        sprintf(arglist[3], "%d", end);
        arglist[4] = (char *)malloc(end * sizeof(char));
        strcpy(arglist[4], string);
        arglist[5] = NULL;
        execvp("./half", arglist);
        printf("\nThis statement is not executed if execvp succeeds.\n");
      } else if (strlen(process_name)) {
        printf("Error! No such %s Process Exist", process_name);
        exit(0);
      }
    } else {
      process_name[p] = string[i];
      p++;
    }
  }
  printf("\nFinal Result is %llu", res);
  return 0;
}
```