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

```asm
<save_makefile_scala>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0xc18,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0xc08(%rsp)
  xor    %eax,%eax
  lea    0x400(%rsp),%rsi
  lea    D117(%rip),%rdi
  call   <get_setting@plt>
  lea    0x200(%rsp),%rbp
  mov    %rbp,%rsi
  lea    D5(%rip),%rdi
  mov    $0x0,%eax
  call   <get_setting@plt>
  lea    0x600(%rsp),%rsi
  lea    D102(%rip),%rdi
  mov    $0x0,%eax
  call   <get_setting@plt>
  lea    0x800(%rsp),%rsi
  lea    D58(%rip),%rdi
  mov    $0x0,%eax
  call   <get_setting@plt>
  lea    0xa00(%rsp),%rsi
  lea    D95(%rip),%rdi
  mov    $0x0,%eax
  call   <get_setting@plt>
  lea    D62(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L57
L48:
  mov    0xc08(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L66
  add    $0xc18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L57:
  lea    0x400(%rsp),%rdi
  call   <is_library@plt>
  test   %eax,%eax
  jne    L48
  lea    D15(%rip),%rsi
  mov    %rbx,%rdi
  call   <empty_makefile_section@plt>
  cmp    $0x1,%eax
  je     L61
L25:
  lea    D93(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <empty_makefile_section@plt>
  cmp    $0x1,%eax
  jne    L48
  lea    0x800(%rsp),%rdx
  mov    %rsp,%rbp
  sub    $0x8,%rsp
  lea    0xa08(%rsp),%rax
  push   %rax
  mov    %rdx,%r9
  lea    0x610(%rsp),%r8
  mov    $0x2f,%ecx
  lea    D96(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbp,%rdx
  lea    D93(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <add_makefile_entry_to_file@plt>
  mov    %rbp,%rsp
  jmp    L48
L61:
  lea    0x800(%rsp),%rdx
  mov    %rsp,%rbp
  sub    $0x8,%rsp
  lea    0xa08(%rsp),%rax
  push   %rax
  mov    %rdx,%r9
  lea    0x610(%rsp),%r8
  mov    $0x2f,%ecx
  lea    D68(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbp,%rdx
  lea    D15(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <add_makefile_entry_to_file@plt>
  mov    %rbp,%rsp
  jmp    L25
L66:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D117
data_type: string
name: parse_data
arguments: data_label: D5
data_type: string
name: parse_data
arguments: data_label: D102
data_type: string
name: parse_data
arguments: data_label: D58
data_type: string
name: parse_data
arguments: data_label: D95
data_type: string
name: parse_data
arguments: data_label: D62
data_type: string
name: parse_data
arguments: data_label: D15
data_type: string
name: parse_data
arguments: data_label: D93
data_type: string
name: parse_data
arguments: data_label: D96
data_type: string
name: parse_data
arguments: data_label: D68
data_type: string

tool: D117: project name

tool: D5: project type

tool: D102: compile

tool: D58: source dir

tool: D95: build dir

tool: D62: scala

tool: D15: all

tool: D93: debug

tool: D96: scalac -g %s%c*.scala %s -sourcepath %s -d %s

tool: D68: scalac %s%c*.scala %s -sourcepath %s -d %s

assistant: ```c
void save_makefile_scala(char *filename) {
  char str[512];
  char project_type[512];
  char project_name[512];
  char compile_args[512];
  char sourcedir[512];
  char build_dir[512];
  get_setting("project name", project_name);
  get_setting("project type", project_type);
  get_setting("compile", compile_args);
  get_setting("source dir", sourcedir);
  get_setting("build dir", build_dir);
  if (strcmp(project_type, "scala") == 0) {
    if (is_library(project_name) == 0) {
      if (empty_makefile_section(filename, "all") == 1) {
        sprintf(str, "scalac %s%c*.scala %s -sourcepath %s -d %s", sourcedir, '/', compile_args, sourcedir, build_dir);
        add_makefile_entry_to_file(filename, "all", str);
      }
      if (empty_makefile_section(filename, "debug") == 1) {
        sprintf(str, "scalac -g %s%c*.scala %s -sourcepath %s -d %s", sourcedir, '/', compile_args, sourcedir, build_dir);
        add_makefile_entry_to_file(filename, "debug", str);
      }
    } else {
    }
  }
}
```