user: 请从给定的汇编指令推导出C源代码:

```asm
<gen_switches_and_alarms>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rdi,%rcx
  mov    $0x2c,%edx
  mov    $0x1,%esi
  lea    D3(%rip),%rdi
  call   <fwrite@plt>
  mov    %r12,%rcx
  mov    $0x37,%edx
  mov    $0x1,%esi
  lea    D10(%rip),%rdi
  call   <fwrite@plt>
  mov    $0xd,%edx
  lea    D25(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %r12,%rcx
  mov    $0x48,%edx
  mov    $0x1,%esi
  lea    D68(%rip),%rdi
  call   <fwrite@plt>
  mov    $0x1,%ebx
  lea    D32(%rip),%r15
  lea    D53(%rip),%r14
L5:
  mov    %ebx,%ebp
  add    $0x1,%ebx
  mov    %ebx,%ecx
  mov    %ebp,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %ebx,%ecx
  mov    %ebp,%edx
  mov    %r14,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  lea    0xd(%rbp),%r13d
  mov    %r13d,%ecx
  mov    %ebp,%edx
  lea    D16(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %r13d,%ecx
  mov    %ebp,%edx
  lea    D18(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  cmp    $0xc,%ebx
  jne    L5
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D3
type_guessed: string
name: retrieve_data
arguments: data_tag: D10
type_guessed: string
name: retrieve_data
arguments: data_tag: D25
type_guessed: string
name: retrieve_data
arguments: data_tag: D68
type_guessed: string
name: retrieve_data
arguments: data_tag: D32
type_guessed: string
name: retrieve_data
arguments: data_tag: D53
type_guessed: string
name: retrieve_data
arguments: data_tag: D16
type_guessed: string
name: retrieve_data
arguments: data_tag: D18
type_guessed: string

tool: D3: INTEGER, PARAMETER :: history_only      = 1


tool: D10: INTEGER, PARAMETER :: HISTORY_ALARM     = history_only


tool: D25: INTEGER, PARAMETER :: input_only        = %d


tool: D68: INTEGER, PARAMETER :: INPUT_ALARM       = input_only         ! not used


tool: D32: INTEGER, PARAMETER :: auxhist%d_only     = %d


tool: D53: INTEGER, PARAMETER :: AUXHIST%d_ALARM    = %d


tool: D16: INTEGER, PARAMETER :: auxinput%d_only     = %d


tool: D18: INTEGER, PARAMETER :: AUXINPUT%d_ALARM    = %d


assistant: ```c
int gen_switches_and_alarms(FILE *fp) {
  char *aux, *streamtype, streamno[5];
  int i;
  fprintf(fp, "INTEGER, PARAMETER :: history_only      = 1\n");
  fprintf(fp, "INTEGER, PARAMETER :: HISTORY_ALARM     = history_only\n");
  fprintf(fp, "INTEGER, PARAMETER :: input_only        = %d\n", 12 + 1);
  fprintf(fp, "INTEGER, PARAMETER :: INPUT_ALARM       = input_only         ! not used\n");
  for (i = 1; i < 12; i++) {
    fprintf(fp, "INTEGER, PARAMETER :: auxhist%d_only     = %d\n", i, i + 1);
    fprintf(fp, "INTEGER, PARAMETER :: AUXHIST%d_ALARM    = %d\n", i, i + 1);
    fprintf(fp, "INTEGER, PARAMETER :: auxinput%d_only     = %d\n", i, 12 + i + 1);
    fprintf(fp, "INTEGER, PARAMETER :: AUXINPUT%d_ALARM    = %d\n", i, 12 + i + 1);
  }
  return 0;
}
```