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

```asm
<preip_set_apply_save>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x40(%rsp)
  movq   $0x0,0x48(%rsp)
  movq   $0x0,0x50(%rsp)
  movq   $0x0,0x58(%rsp)
  movq   $0x0,0x60(%rsp)
  movq   $0x0,0x68(%rsp)
  movq   $0x0,0x70(%rsp)
  movq   $0x0,0x78(%rsp)
  movq   $0x0,0x80(%rsp)
  movq   $0x0,0x88(%rsp)
  movq   $0x0,0x90(%rsp)
  movq   $0x0,0x98(%rsp)
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  lea    D90(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <write_to_nvram@plt>
  mov    $0x0,%eax
  call   <nvram_commit@plt>
  mov    $0x0,%edi
  call   <set_config_sta@plt>
  test   %rax,%rax
  jne    L14
L6:
  lea    D75(%rip),%rdi
  call   <nvram_safe_get@plt>
  mov    %rax,%rdx
  lea    0x20(%rsp),%rbx
  lea    D81(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <system@plt>
  mov    %rsp,%rbp
  mov    $0x0,%r9d
  mov    $0x20,%r8d
  mov    %rbp,%rcx
  lea    D1(%rip),%rdx
  mov    $0x0,%esi
  lea    D70(%rip),%r12
  mov    %r12,%rdi
  call   <ezplib_get_attr_val@plt>
  mov    $0x80,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    %rbp,%rdi
  call   <atoi@plt>
  lea    0x5f(%rax),%edx
  lea    D49(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <system@plt>
  mov    $0x20,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    $0x0,%r9d
  mov    $0x20,%r8d
  mov    %rbp,%rcx
  lea    D5(%rip),%rdx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <ezplib_get_attr_val@plt>
  mov    $0x80,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    %rbp,%rdi
  call   <atoi@plt>
  lea    0x5f(%rax),%edx
  lea    D44(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <system@plt>
  lea    D48(%rip),%rdi
  call   <system@plt>
  mov    0xa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0xb0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L14:
  lea    D55(%rip),%rdi
  call   <printf@plt>
  jmp    L6
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D90
type_infered: string
name: retrieve_data
arguments: data_label: D75
type_infered: string
name: retrieve_data
arguments: data_label: D81
type_infered: string
name: retrieve_data
arguments: data_label: D1
type_infered: string
name: retrieve_data
arguments: data_label: D70
type_infered: string
name: retrieve_data
arguments: data_label: D49
type_infered: string
name: retrieve_data
arguments: data_label: D5
type_infered: string
name: retrieve_data
arguments: data_label: D44
type_infered: string
name: retrieve_data
arguments: data_label: D48
type_infered: string
name: retrieve_data
arguments: data_label: D55
type_infered: string

tool: D90: preip_set_apply_save


tool: D75: hostname

tool: D81: echo %s > /proc/sys/kernel/hostname

tool: D1: connrssi

tool: D70: wl0_apcli_rule

tool: D49: iwpriv sta0 connrssi %d

tool: D5: disconnrssi

tool: D44: iwpriv sta0 disconnrssi %d

tool: D48: /etc/init.d/network-lan restart 2>/dev/null 1>/dev/null &

tool: D55: set_config_sta error!


assistant: ```c
void preip_set_apply_save(void) {
  char cmd[128] = {0};
  char *sys_name = NULL;
  char *connrssi = NULL;
  char *disconnrssi = NULL;
  char buf[32] = {0};
  char br_name[32] = {0}, *br_get = NULL;
  char buf_proto[32] = {0};
  printf("preip_set_apply_save\n");
  write_to_nvram();
  nvram_commit();
  if (set_config_sta(0)) {
    printf("set_config_sta error!\n");
  }
  sys_name = nvram_safe_get("hostname");
  sprintf(cmd, "echo %s > /proc/sys/kernel/hostname", sys_name);
  system(cmd);
  ezplib_get_attr_val("wl0_apcli_rule", 0, "connrssi", buf, 32, 0);
  memset(cmd, 0, sizeof(cmd));
  sprintf(cmd, "iwpriv sta0 connrssi %d", (atoi(buf) + 95));
  system(cmd);
  memset(buf, 0, sizeof(buf));
  ezplib_get_attr_val("wl0_apcli_rule", 0, "disconnrssi", buf, 32, 0);
  memset(cmd, 0, sizeof(cmd));
  sprintf(cmd, "iwpriv sta0 disconnrssi %d", (atoi(buf) + 95));
  system(cmd);
  system("/etc/init.d/network-lan restart 2>/dev/null 1>/dev/null &");
  return 0;
}
```