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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D103(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %al,-0x2b(%rbp)
  mov    $0x0,%eax
  call   <getchar@plt>
  cmpb   $0x79,-0x2b(%rbp)
  je     L13
  cmpb   $0x59,-0x2b(%rbp)
  jne    L171
L13:
  mov    $0x1,%eax
  jmp    L122
L171:
  mov    $0x0,%eax
L122:
  mov    %eax,-0x24(%rbp)
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %al,-0x2b(%rbp)
  mov    $0x0,%eax
  call   <getchar@plt>
  cmpb   $0x79,-0x2b(%rbp)
  je     L59
  cmpb   $0x59,-0x2b(%rbp)
  jne    L144
L59:
  mov    $0x1,%eax
  jmp    L64
L144:
  mov    $0x0,%eax
L64:
  mov    %eax,-0x20(%rbp)
  lea    D98(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %al,-0x2b(%rbp)
  cmpb   $0x79,-0x2b(%rbp)
  je     L113
  cmpb   $0x59,-0x2b(%rbp)
  jne    L97
L113:
  mov    $0x1,%eax
  jmp    L17
L97:
  mov    $0x0,%eax
L17:
  mov    %eax,-0x1c(%rbp)
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <winopen@plt>
  nop
L79:
  lea    -0x2a(%rbp),%rax
  mov    %rax,%rdi
  call   <qread@plt>
  cmp    $0x105,%eax
  jne    L79
  cmpl   $0x0,-0x1c(%rbp)
  je     L99
  mov    $0x0,%eax
  call   <doublebuffer@plt>
L99:
  mov    $0x0,%eax
  call   <gconfig@plt>
  mov    $0x106,%edi
  call   <unqdevice@plt>
  mov    $0x51,%edi
  call   <qdevice@plt>
  mov    $0x1b,%edi
  call   <qdevice@plt>
  mov    $0x105,%edi
  call   <qdevice@plt>
  mov    $0x0,%eax
  call   <makecyl@plt>
  mov    $0x0,%edi
  call   <polymode@plt>
  cmpl   $0x0,-0x20(%rbp)
  je     L130
  mov    $0x1,%edi
  call   <polymode@plt>
L130:
  cmpl   $0x0,-0x24(%rbp)
  je     L23
  mov    $0x1,%edi
  call   <backface@plt>
L23:
  movsd  D57(%rip),%xmm1
  movsd  D41(%rip),%xmm0
  mov    D53(%rip),%rax
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    $0x190,%edi
  call   <perspective@plt>
  movsd  D4(%rip),%xmm0
  mov    $0x0,%esi
  pxor   %xmm4,%xmm4
  pxor   %xmm3,%xmm3
  pxor   %xmm2,%xmm2
  mov    $0x4,%edi
  movapd %xmm0,%xmm1
  mov    D96(%rip),%rax
  movq   %rax,%xmm0
  call   <lookat@plt>
  movl   $0x0,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x14(%rbp)
L81:
  movl   $0x0,-0x28(%rbp)
  jmp    L155
L189:
  mov    $0x0,%edi
  call   <color@plt>
  mov    $0x0,%eax
  call   <clear@plt>
  mov    $0x1,%edi
  call   <color@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x28(%rbp),%xmm1
  movsd  D27(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D74(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D59(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x10(%rbp)
  mov    $0x2,%edi
  call   <getvaluator@plt>
  mov    %eax,%edx
  mov    $0x1f4,%eax
  sub    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    $0x1,%edi
  call   <getvaluator@plt>
  mov    %eax,%edx
  mov    $0x1f4,%eax
  sub    %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    $0x2,%edi
  call   <getvaluator@plt>
  mov    %eax,%edx
  mov    $0x1f4,%eax
  sub    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x14(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    $0x0,%eax
  call   <pushmatrix@plt>
  mov    -0x14(%rbp),%eax
  mov    $0x78,%esi
  mov    %eax,%edi
  call   <rotate@plt>
  mov    -0x18(%rbp),%eax
  mov    $0x79,%esi
  mov    %eax,%edi
  call   <rotate@plt>
  mov    -0x10(%rbp),%eax
  movd   %eax,%xmm0
  call   <piston@plt>
  mov    $0x0,%eax
  call   <popmatrix@plt>
  cmpl   $0x0,-0x1c(%rbp)
  je     L107
  mov    $0x0,%eax
  call   <swapbuffers@plt>
L107:
  mov    $0x0,%eax
  call   <qtest@plt>
  test   %rax,%rax
  je     L41
  lea    -0x2a(%rbp),%rax
  mov    %rax,%rdi
  call   <qread@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x51,-0xc(%rbp)
  je     L180
  cmpl   $0x1b,-0xc(%rbp)
  jne    L41
L180:
  mov    $0x0,%eax
  call   <gexit@plt>
  mov    $0x0,%edi
  call   <exit@plt>
L41:
  addl   $0x5,-0x28(%rbp)
L155:
  cmpl   $0x167,-0x28(%rbp)
  jle    L189
  jmp    L81
```

tool_calls: name: parse_data
arguments: tag: D103
type: string
name: parse_data
arguments: tag: D6
type: string
name: parse_data
arguments: tag: D98
type: string
name: parse_data
arguments: tag: D9
type: string
name: parse_data
arguments: tag: D57
type: f64
name: parse_data
arguments: tag: D41
type: f64
name: parse_data
arguments: tag: D53
type: f64
name: parse_data
arguments: tag: D4
type: f32[2]
name: parse_data
arguments: tag: D96
type: f32[2]
name: parse_data
arguments: tag: D27
type: byte[8]
name: parse_data
arguments: tag: D74
type: f64
name: parse_data
arguments: tag: D59
type: f64

tool: D103: Backfacing ON or OFF (Y/N)? 

tool: D6: Fill the polygons (Y/N)? 

tool: D98: double buffer (Y/N)? 

tool: D9: piston

tool: D57: 600

tool: D41: 0.1

tool: D53: 1.5

tool: {"D4": [0.0,-2.375]}

tool: {"D96": [0.0,0.0]}

tool: {"D27": [0xf1,0xd4,0xc8,0x53,0xfb,0x21,0x19,0x40]}

tool: D74: 180

tool: D59: 1

assistant: ```c
main() {
  int i, itest, dobackface, dofill, dodouble;
  char ans;
  float H;
  short idata;
  int xr, yr;
  printf("Backfacing ON or OFF (Y/N)? ");
  ans = getchar();
  (void)getchar();
  dobackface = (ans == 'y' || ans == 'Y');
  printf("Fill the polygons (Y/N)? ");
  ans = getchar();
  (void)getchar();
  dofill = (ans == 'y' || ans == 'Y');
  printf("double buffer (Y/N)? ");
  ans = getchar();
  dodouble = (ans == 'y' || ans == 'Y');
  winopen("piston");
  while (qread(&idata) != 261)
    ;
  if (dodouble)
    doublebuffer();
  gconfig();
  unqdevice(262);
  qdevice('Q');
  qdevice('\033');
  qdevice(261);
  makecyl();
  polymode(0);
  if (dofill)
    polymode(1);
  if (dobackface)
    backface(1);
  perspective(400, 1.5, 0.1, 600.0);
  lookat(0.0, -6.0, 4., 0.0, 0.0, 0.0, 0);
  xr = yr = 0;
  while (1) {
    for (i = 0; i < 360; i += 5) {
      color(0);
      clear();
      color(1);
      H = 1.0 + cos(2.0 * 3.14159265 * i / 180.0);
      yr = 500 - (int)getvaluator(2);
      xr = 500 - (int)getvaluator(1);
      yr = 500 - (int)getvaluator(2);
      xr *= 3;
      yr *= 3;
      pushmatrix();
      rotate(xr, 'x');
      rotate(yr, 'y');
      piston(H);
      popmatrix();
      if (dodouble)
        swapbuffers();
      if (qtest()) {
        itest = qread(&idata);
        if (itest == 'Q' || itest == '\033') {
          gexit();
          exit(0);
        }
      }
    }
  }
}
```