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

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x100,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xf8(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbx
  mov    %rbx,%rsi
  lea    D22(%rip),%rdi
  call   <scanf@plt>
  lea    0xf(%rsp),%rsi
  lea    D28(%rip),%rdi
  call   <scanf@plt>
  lea    0x50(%rsp),%rsi
  lea    D46(%rip),%rdi
  call   <scanf@plt>
  movsbl 0xf(%rsp),%esi
  mov    %rbx,%rdi
  call   <index@plt>
  mov    $0x0,%ebx
  lea    0x10(%rsp),%r13
  test   %eax,%eax
  je     L56
  movsbl 0xf(%rsp),%esi
  lea    0x10(%rsp),%rdi
  call   <index@plt>
  mov    $0x0,%ebx
  lea    0x10(%rsp),%rbp
  test   %eax,%eax
  jg     L23
  lea    0x10(%rsp),%rsi
  lea    D46(%rip),%rdi
  call   <printf@plt>
  jmp    L122
L80:
  movzbl 0x50(%rsp,%rbx,1),%eax
L83:
  mov    %al,0x90(%rsp,%rbx,1)
  add    $0x1,%rbx
L56:
  mov    %ebx,%r12d
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%ebp
  lea    0x50(%rsp),%rdi
  call   <strlen@plt>
  add    %eax,%ebp
  cmp    %ebx,%ebp
  jle    L26
  lea    0x50(%rsp),%rdi
  call   <strlen@plt>
  cmp    %ebx,%eax
  jg     L80
  lea    0x50(%rsp),%rdi
  call   <strlen@plt>
  sub    %eax,%r12d
  movslq %r12d,%r12
  movzbl 0x10(%rsp,%r12,1),%eax
  jmp    L83
L26:
  lea    0x90(%rsp),%rsi
  lea    D46(%rip),%rdi
  call   <printf@plt>
L122:
  mov    0xf8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L45
  mov    $0x0,%eax
  add    $0x100,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L88:
  movzbl (%rbx,%rbp,1),%eax
  mov    %al,0x90(%rsp,%rbx,1)
  add    $0x1,%rbx
L23:
  movsbl 0xf(%rsp),%esi
  mov    %rbp,%rdi
  call   <index@plt>
  cmp    %ebx,%eax
  jg     L88
  movsbl 0xf(%rsp),%esi
  lea    0x10(%rsp),%rdi
  call   <index@plt>
  cltq
  mov    %rax,%rbp
  lea    0x10(%rsp),%r13
  lea    0x50(%rsp),%r12
  mov    %r12,%r14
  sub    %rax,%r14
  jmp    L84
L36:
  movzbl (%r14,%rbp,1),%eax
  mov    %al,0x90(%rsp,%rbp,1)
  add    $0x1,%rbp
L84:
  movsbl 0xf(%rsp),%esi
  mov    %r13,%rdi
  call   <index@plt>
  mov    %eax,%ebx
  mov    %r12,%rdi
  call   <strlen@plt>
  add    %eax,%ebx
  cmp    %ebp,%ebx
  jg     L36
  movsbl 0xf(%rsp),%esi
  lea    0x10(%rsp),%rbx
  mov    %rbx,%rdi
  call   <index@plt>
  mov    %eax,%r12d
  movsbl 0xf(%rsp),%esi
  mov    %rbx,%rdi
  call   <index@plt>
  mov    %eax,%ebx
  lea    0x50(%rsp),%rdi
  call   <strlen@plt>
  add    %ebx,%eax
  cltq
  mov    %rax,%rbp
  lea    0x10(%rsp),%r13
  movslq %r12d,%r12
  sub    %rax,%r12
  add    %r13,%r12
  jmp    L31
L38:
  movzbl (%r12,%rbp,1),%eax
  mov    %al,0x90(%rsp,%rbp,1)
  add    $0x1,%rbp
L31:
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  lea    0x50(%rsp),%rdi
  call   <strlen@plt>
  add    %eax,%ebx
  cmp    %ebp,%ebx
  jg     L38
  lea    0x90(%rsp),%rsi
  lea    D46(%rip),%rdi
  call   <printf@plt>
  jmp    L122
L45:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D22
data_type: string
name: disassemble_data
arguments: tag: D28
data_type: string
name: disassemble_data
arguments: tag: D46
data_type: string

tool: D22: %s


tool: D28: %c


tool: D46: %s

assistant: ```c
int main() {
  char s1[50], s2[50], c1;
  scanf("%s\n", s1);
  scanf("%c\n", &c1);
  scanf("%s", s2);
  char s3[100];
  int i, j;
  if ((index(s1, c1)) == 0) {
    for (i = 0; i < (strlen(s1) + strlen(s2)); i++) {
      if (i < strlen(s2))
        s3[i] = s2[i];
      else
        s3[i] = s1[(i - strlen(s2))];
    }
    printf("%s", s3);
  } else if (index(s1, c1) > 0) {
    for (j = 0; j < index(s1, c1); j++) {
      s3[j] = s1[j];
    }
    int k = 0;
    for (j = index(s1, c1); j < (index(s1, c1) + strlen(s2)); j++) {
      s3[j] = s2[k];
      k++;
    }
    int l = index(s1, c1);
    for (j = (index(s1, c1) + strlen(s2)); j < (strlen(s1) + strlen(s2)); j++) {
      s3[j] = s1[l];
      l++;
    }
    printf("%s", s3);
  } else {
    printf("%s", s1);
  }
  return 0;
}
```