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

```asm
<savePid>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x210,%rsp
  mov    %rdi,%rbp
  mov    %esi,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  lea    D32(%rip),%rdi
  call   <debugMsg@plt>
  test   %ebx,%ebx
  je     L48
L57:
  lea    D99(%rip),%rdi
  call   <debugMsg@plt>
  lea    D95(%rip),%rdi
  call   <debugMsg@plt>
  mov    %rsp,%rdi
  mov    %ebx,%edx
  lea    D88(%rip),%rsi
  call   <sprintf@plt>
  lea    D133(%rip),%rdi
  call   <debugMsg@plt>
  lea    D7(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D21(%rip),%r12
  test   %rax,%rax
  jne    L7
L14:
  lea    D105(%rip),%rdi
  call   <debugMsg@plt>
  mov    %rsp,%rsi
  mov    %r12,%rdi
  call   <writeFile@plt>
  test   %rax,%rax
  mov    $0x0,%eax
  cmovne %ebx,%eax
  mov    0x208(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L52
  add    $0x210,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L48:
  lea    D50(%rip),%rdi
  call   <debugMsg@plt>
  mov    $0x0,%eax
  call   <getpid@plt>
  mov    %eax,%ebx
  jmp    L57
L7:
  lea    D111(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D29(%rip),%r12
  test   %rax,%rax
  je     L14
  lea    D115(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  lea    D37(%rip),%r12
  lea    D21(%rip),%rax
  cmovne %rax,%r12
  jmp    L14
L52:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D32
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D99
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D95
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D88
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D133
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D7
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D21
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D105
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D50
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D111
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D29
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D115
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D37
type_guessed: string

tool: D32: savePid() ...

tool: D99: savePid() ... pid is > 0 ...

tool: D95: savePid() ... sprintf ...

tool: D88: %d

tool: D133: savePid() ... sel arg ...

tool: D7: par

tool: D21: /tmp/.pidlbr-dmn

tool: D105: savePid() ... ok ...

tool: D50: savePid() ... pid is 0 ...

tool: D111: chi_1

tool: D29: /tmp/.pidlbr-1

tool: D115: chi_2

tool: D37: /tmp/.pidlbr-2

assistant: ```c
int savePid(char *pid_name, int pid_int) {
  debugMsg("savePid() ...");
  if (pid_int == 0) {
    debugMsg("savePid() ... pid is 0 ...");
    pid_int = getpid();
  }
  debugMsg("savePid() ... pid is > 0 ...");
  char pid_char[512];
  char *pid_file;
  debugMsg("savePid() ... sprintf ...");
  sprintf(pid_char, "%d", pid_int);
  debugMsg("savePid() ... sel arg ...");
  if (strcmp(pid_name, (char *)"par") == 0) {
    pid_file = "/tmp/.pidlbr-dmn";
  } else if (strcmp(pid_name, (char *)"chi_1") == 0) {
    pid_file = "/tmp/.pidlbr-1";
  } else if (strcmp(pid_name, (char *)"chi_2") == 0) {
    pid_file = "/tmp/.pidlbr-2";
  } else {
    pid_file = "/tmp/.pidlbr-dmn";
  }
  debugMsg("savePid() ... ok ...");
  if (writeFile(pid_file, pid_char) == 0) {
    return 0;
  } else {
    return pid_int;
  }
}
```