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

```asm
<replace_asterisk_with_all_fields>:
  endbr64
  push   %r15
  push   %r14
  lea    D73(%rip),%r14
  push   %r13
  mov    %rdx,%r13
  mov    $0x1,%edx
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  mov    %rdi,%rsi
  mov    %r14,%rdi
  push   %rbx
  sub    $0x498,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x488(%rsp)
  xor    %eax,%eax
  call   <instr@plt>
  test   %eax,%eax
  js     L76
L51:
  mov    0x488(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L72
  add    $0x498,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L76:
  mov    $0x1,%edx
  mov    %r12,%rsi
  lea    D47(%rip),%rdi
  call   <instr@plt>
  test   %eax,%eax
  jns    L51
  mov    $0x1,%edx
  mov    %r12,%rsi
  lea    D52(%rip),%rdi
  call   <instr@plt>
  test   %eax,%eax
  jns    L51
  mov    $0x1,%edx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <instr@plt>
  test   %eax,%eax
  jns    L51
  mov    $0x1,%edx
  mov    %r12,%rsi
  lea    D78(%rip),%rdi
  call   <instr@plt>
  cmp    $0xffffffff,%eax
  je     L51
  mov    %rbp,%rdi
  mov    %rsp,%rbx
  mov    $0x1,%ebp
  call   <low_string@plt>
  mov    %r13,%rdx
  mov    %rbx,%rdi
  lea    D56(%rip),%rsi
  mov    %rax,%rcx
  xor    %eax,%eax
  lea    0x80(%rsp),%r13
  call   <sprintf@plt>
  lea    D63(%rip),%rsi
  mov    %rbx,%rdi
  lea    D13(%rip),%r15
  call   <popen@plt>
  mov    %rax,%r14
  nopl   0x0(%rax)
L27:
  mov    %r14,%rdx
  mov    $0x7f,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L46
  mov    %rbx,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  movb   $0x0,(%rsp,%rax,1)
  test   %ebp,%ebp
  je     L35
  mov    %rbx,%rsi
  mov    %r13,%rdi
  xor    %ebp,%ebp
  call   <strcpy@plt>
  jmp    L27
  nopl   0x0(%rax)
L35:
  mov    %r13,%rdi
  xor    %ebp,%ebp
  call   <strlen@plt>
  mov    %rbx,%rdx
  mov    %r15,%rsi
  movslq %eax,%rdi
  xor    %eax,%eax
  add    %r13,%rdi
  call   <sprintf@plt>
  jmp    L27
  nopw   0x0(%rax,%rax,1)
L46:
  mov    %r14,%rdi
  call   <pclose@plt>
  mov    %r12,%rdx
  mov    %r13,%rsi
  lea    D78(%rip),%rdi
  call   <search_replace@plt>
  jmp    L51
L72:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D73
data_type: string
name: extract_symbolic_data
arguments: data_tag: D47
data_type: string
name: extract_symbolic_data
arguments: data_tag: D52
data_type: string
name: extract_symbolic_data
arguments: data_tag: D78
data_type: string
name: extract_symbolic_data
arguments: data_tag: D56
data_type: string
name: extract_symbolic_data
arguments: data_tag: D63
data_type: string
name: extract_symbolic_data
arguments: data_tag: D13
data_type: string

tool: D73: (*)

tool: D47: ( * )

tool: D52: (* )

tool: D78: *

tool: D56: column4table.sh %s %s | piece.e '|' 0

tool: D63: r

tool: D13: ||'|'||%s

assistant: ```c
void replace_asterisk_with_all_fields(char *sql_stmt, char *from_table, char *schema) {
  FILE *p;
  char buffer[128];
  char all_fields[1024];
  int first_time = 1;
  if (instr("(*)", sql_stmt, 1) >= 0)
    return;
  if (instr("( * )", sql_stmt, 1) >= 0)
    return;
  if (instr("(* )", sql_stmt, 1) >= 0)
    return;
  if (instr("(*)", sql_stmt, 1) >= 0)
    return;
  if (instr("*", sql_stmt, 1) == -1)
    return;
  sprintf(buffer, "column4table.sh %s %s | piece.e '|' 0", schema, low_string(from_table));
  p = popen(buffer, "r");
  while (fgets(buffer, 127, p)) {
    buffer[strlen(buffer) - 1] = '\0';
    if (first_time) {
      strcpy(all_fields, buffer);
      first_time = 0;
    } else {
      sprintf(all_fields + strlen(all_fields), "||'|'||%s", buffer);
    }
  }
  pclose(p);
  search_replace("*", all_fields, sql_stmt);
}
```