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

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    D121(%rip),%rdi
  call   <puts@plt>
  lea    D45(%rip),%rdi
  call   <puts@plt>
  lea    D37(%rip),%rdi
  call   <puts@plt>
  lea    D12(%rip),%rdi
  call   <puts@plt>
  lea    D141(%rip),%rdi
  call   <puts@plt>
  lea    D25(%rip),%rdi
  call   <puts@plt>
  lea    D33(%rip),%rdi
  call   <puts@plt>
  lea    D22(%rip),%rdi
  call   <puts@plt>
  lea    D51(%rip),%rdi
  call   <puts@plt>
  lea    D28(%rip),%rdi
  call   <puts@plt>
  lea    D19(%rip),%r12
  lea    D13(%rip),%rbp
L4:
  lea    0x30(%rsp),%rcx
  lea    0x28(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  cmp    $0x3,%eax
  jne    L1
  movsd  0x20(%rsp),%xmm3
  movsd  %xmm3,0x8(%rsp)
  movsd  0x28(%rsp),%xmm0
  comisd %xmm3,%xmm0
  jb     L4
L43:
  cvttsd2si 0x8(%rsp),%edi
  call   <log@plt>
  movq   %xmm0,%rbx
  mov    $0x2,%edi
  call   <log@plt>
  movapd %xmm0,%xmm1
  movq   %rbx,%xmm0
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  subsd  %xmm1,%xmm0
  mulsd  D30(%rip),%xmm0
  movsd  %xmm0,0x18(%rsp)
  mulsd  D176(%rip),%xmm1
  movsd  %xmm1,0x10(%rsp)
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movsd  0x10(%rsp),%xmm1
  addsd  D84(%rip),%xmm1
  movsd  0x18(%rsp),%xmm0
  lea    D3(%rip),%rbx
  mov    %rbx,%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  movsd  0x10(%rsp),%xmm1
  addsd  D184(%rip),%xmm1
  movsd  0x18(%rsp),%xmm0
  mov    %rbx,%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm0
  lea    D189(%rip),%rsi
  lea    D120(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm2
  addsd  0x30(%rsp),%xmm2
  movsd  %xmm2,0x8(%rsp)
  movsd  0x28(%rsp),%xmm0
  comisd %xmm2,%xmm0
  jae    L43
  jmp    L4
L1:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  mov    $0x0,%eax
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L36:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D121
datatype: string
name: parse_data
arguments: tag: D45
datatype: string
name: parse_data
arguments: tag: D37
datatype: string
name: parse_data
arguments: tag: D12
datatype: string
name: parse_data
arguments: tag: D141
datatype: string
name: parse_data
arguments: tag: D25
datatype: string
name: parse_data
arguments: tag: D33
datatype: string
name: parse_data
arguments: tag: D22
datatype: string
name: parse_data
arguments: tag: D51
datatype: string
name: parse_data
arguments: tag: D28
datatype: string
name: parse_data
arguments: tag: D19
datatype: string
name: parse_data
arguments: tag: D13
datatype: string
name: parse_data
arguments: tag: D30
datatype: f64
name: parse_data
arguments: tag: D176
datatype: byte[8]
name: parse_data
arguments: tag: D84
datatype: f64
name: parse_data
arguments: tag: D3
datatype: string
name: parse_data
arguments: tag: D184
datatype: f64
name: parse_data
arguments: tag: D189
datatype: string
name: parse_data
arguments: tag: D120
datatype: string

tool: D121: Generate scale for spectrum chart.

tool: D45: Enter three space separated frequencies Eg. 300e12 400e12 10e11

tool: D37:   exa e18.

tool: D12:  peta e15.

tool: D141:  tera e12.

tool: D25:  giga e9.

tool: D33:  mega e6.

tool: D22:   x step is 0.5 inches.

tool: D51:   y divided into 12 steps.

tool: D28: Ctl-c to exit.

tool: D19: %lf %lf %lf

tool: D13: \psline

tool: D30: 9.8

tool: {"D176": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: D84: 3.05

tool: D3: (%.3f,%.3f)

tool: D184: 3.075

tool: D189: %

tool: D120: %s 	point=%.2f


assistant: ```c
int main() {
  double point, xpos, start, end, step, startxpos, startypos, endxpos, endypos, position, width;
  int ypos;
  width = 9.8;
  printf("Generate scale for spectrum chart.\n");
  printf("Enter three space separated frequencies Eg. 300e12 400e12 10e11\n");
  printf("  exa e18.\n");
  printf(" peta e15.\n");
  printf(" tera e12.\n");
  printf(" giga e9.\n");
  printf(" mega e6.\n");
  printf("  x step is 0.5 inches.\n");
  printf("  y divided into 12 steps.\n");
  printf("Ctl-c to exit.\n");
  while (scanf("%lf %lf %lf", &start, &end, &step) == 3) {
    for (point = start; point <= end; point = point + step) {
      position = log(point) / log(2);
      ypos = (int)position;
      startxpos = ((position - (double)ypos)) * width;
      startypos = (double)(ypos) / 2 + 3.05;
      endypos = (double)(ypos) / 2 + 3.075;
      printf("\\psline");
      printf("(%.3f,%.3f)", startxpos, startypos);
      printf("(%.3f,%.3f)", startxpos, endypos);
      printf("%s \tpoint=%.2f\n", "%", point);
    }
  }
  return 0;
  position = log(start) / log(2);
  ypos = (int)position;
  startxpos = ((position - (double)ypos)) * width;
  startypos = (double)(ypos) / 2 + 3.05;
  printf("\t(%.2f,%.2f)", startxpos, startypos);
  position = log(end) / log(2);
  ypos = (int)position;
  endxpos = ((position - (double)ypos)) * width;
  endypos = (double)(ypos) / 2 + 3.25;
  printf("(%.2f,%.2f)   ", endxpos, endypos);
  printf("(%.2f,", (endxpos - startxpos) / 2 + startxpos);
  printf("%.2f)\n", (endypos - startypos) / 2 + startypos);
}
```