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

```asm
<main>:
  endbr64
  push   %r15
  lea    D170(%rip),%rdi
  push   %r14
  push   %r13
  lea    D69(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%r15
  lea    0x28(%rsp),%r14
  call   <puts@plt>
  lea    D41(%rip),%rdi
  call   <puts@plt>
  lea    D0(%rip),%rdi
  call   <puts@plt>
  lea    D186(%rip),%rdi
  call   <puts@plt>
  lea    D146(%rip),%rdi
  call   <puts@plt>
  lea    D187(%rip),%rdi
  call   <puts@plt>
  lea    D75(%rip),%rdi
  call   <puts@plt>
  lea    D87(%rip),%rdi
  call   <puts@plt>
  lea    D125(%rip),%rdi
  call   <puts@plt>
  lea    D62(%rip),%rdi
  call   <puts@plt>
  lea    0x20(%rsp),%rax
  mov    %rax,0x18(%rsp)
  nopl   (%rax)
L2:
  mov    0x18(%rsp),%rsi
  mov    %r15,%rcx
  mov    %r14,%rdx
  lea    D130(%rip),%rdi
  call   <scanf@plt>
  cmp    $0x3,%eax
  jne    L27
  movsd  0x20(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm0
  lea    D138(%rip),%rbx
  lea    D71(%rip),%r12
  lea    D9(%rip),%rbp
  comisd %xmm2,%xmm0
  jb     L2
  nop
L36:
  cvttsd2si %xmm2,%edi
  movsd  %xmm2,0x10(%rsp)
  call   <log@plt>
  mov    $0x2,%edi
  movsd  %xmm0,(%rsp)
  call   <log@plt>
  movsd  (%rsp),%xmm1
  mov    %r13,%rdi
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  movapd %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  xor    %eax,%eax
  subsd  %xmm1,%xmm0
  mulsd  D133(%rip),%xmm1
  mulsd  D182(%rip),%xmm0
  movsd  %xmm1,(%rsp)
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  movsd  D18(%rip),%xmm5
  addsd  (%rsp),%xmm5
  mov    %rbx,%rdi
  movsd  0x8(%rsp),%xmm0
  mov    $0x2,%eax
  movapd %xmm5,%xmm1
  call   <printf@plt>
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    %rbx,%rdi
  addsd  D137(%rip),%xmm1
  mov    $0x2,%eax
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  movsd  0x10(%rsp),%xmm2
  movapd %xmm2,%xmm0
  movsd  %xmm2,(%rsp)
  call   <printf@plt>
  movsd  (%rsp),%xmm2
  addsd  0x30(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm0
  comisd %xmm2,%xmm0
  jae    L36
  jmp    L2
  nopl   0x0(%rax,%rax,1)
L27:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L20
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L20:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D170
type_infered: string
name: read_data
arguments: data_label: D69
type_infered: string
name: read_data
arguments: data_label: D41
type_infered: string
name: read_data
arguments: data_label: D0
type_infered: string
name: read_data
arguments: data_label: D186
type_infered: string
name: read_data
arguments: data_label: D146
type_infered: string
name: read_data
arguments: data_label: D187
type_infered: string
name: read_data
arguments: data_label: D75
type_infered: string
name: read_data
arguments: data_label: D87
type_infered: string
name: read_data
arguments: data_label: D125
type_infered: string
name: read_data
arguments: data_label: D62
type_infered: string
name: read_data
arguments: data_label: D130
type_infered: string
name: read_data
arguments: data_label: D138
type_infered: string
name: read_data
arguments: data_label: D71
type_infered: string
name: read_data
arguments: data_label: D9
type_infered: string
name: read_data
arguments: data_label: D133
type_infered: byte[8]
name: read_data
arguments: data_label: D182
type_infered: f64
name: read_data
arguments: data_label: D18
type_infered: f64
name: read_data
arguments: data_label: D137
type_infered: f64

tool: D170: Generate scale for spectrum chart.

tool: D69: \psline

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

tool: D0:   exa e18.

tool: D186:  peta e15.

tool: D146:  tera e12.

tool: D187:  giga e9.

tool: D75:  mega e6.

tool: D87:   x step is 0.5 inches.

tool: D125:   y divided into 12 steps.

tool: D62: Ctl-c to exit.

tool: D130: %lf %lf %lf

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

tool: D71: %

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


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

tool: D182: 9.8

tool: D18: 3.05

tool: D137: 3.075

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);
}
```