user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rsi
  lea    D29(%rip),%rdi
  call   <scanf@plt>
  cmp    $0x1,%eax
  je     L7
L83:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L105
  mov    $0x0,%eax
  add    $0x20,%rsp
  pop    %rbx
  ret
L7:
  movsd  0x10(%rsp),%xmm0
  movsd  D125(%rip),%xmm1
  comisd %xmm1,%xmm0
  jb     L111
L138:
  subsd  %xmm1,%xmm0
  comisd %xmm1,%xmm0
  jae    L138
  movsd  %xmm0,0x10(%rsp)
L111:
  movsd  0x10(%rsp),%xmm4
  movsd  %xmm4,0x8(%rsp)
  pxor   %xmm0,%xmm0
  comisd %xmm4,%xmm0
  jbe    L131
  movsd  D125(%rip),%xmm1
L36:
  movsd  0x8(%rsp),%xmm2
  addsd  %xmm1,%xmm2
  movsd  %xmm2,0x8(%rsp)
  comisd %xmm2,%xmm0
  ja     L36
  movsd  %xmm2,0x10(%rsp)
L131:
  movsd  0x8(%rsp),%xmm3
  comisd D126(%rip),%xmm3
  jb     L159
  movq   %xmm3,%rbx
  movsd  D62(%rip),%xmm0
  comisd %xmm3,%xmm0
  ja     L22
L159:
  movsd  0x8(%rsp),%xmm5
  comisd D62(%rip),%xmm5
  jb     L34
  movsd  D114(%rip),%xmm0
  comisd %xmm5,%xmm0
  jbe    L34
  subsd  %xmm5,%xmm0
  movq   %xmm0,%rbx
  jmp    L22
L34:
  movsd  0x8(%rsp),%xmm7
  comisd D114(%rip),%xmm7
  jb     L123
  movsd  D60(%rip),%xmm0
  comisd %xmm7,%xmm0
  jbe    L123
  movsd  D114(%rip),%xmm0
  subsd  %xmm7,%xmm0
  movq   %xmm0,%rbx
  movsd  D125(%rip),%xmm0
  subsd  %xmm7,%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L22
L123:
  movsd  D125(%rip),%xmm0
  movsd  0x8(%rsp),%xmm6
  comisd %xmm6,%xmm0
  jbe    L22
  movapd %xmm6,%xmm7
  subsd  %xmm0,%xmm7
  movq   %xmm7,%rbx
  subsd  %xmm6,%xmm0
  movsd  %xmm0,0x8(%rsp)
L22:
  movq   %rbx,%xmm0
  call   <sine@plt>
  mov    %eax,%esi
  lea    D115(%rip),%rdi
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm0
  call   <cosine@plt>
  mov    %eax,%esi
  lea    D13(%rip),%rdi
  call   <printf@plt>
  jmp    L83
L105:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D29
type: string
name: disassemble_data
arguments: tag: D125
type: byte[8]
name: disassemble_data
arguments: tag: D126
type: byte[16]
name: disassemble_data
arguments: tag: D62
type: f64[2]
name: disassemble_data
arguments: tag: D114
type: f64[2]
name: disassemble_data
arguments: tag: D60
type: byte[8]
name: disassemble_data
arguments: tag: D115
type: string
name: disassemble_data
arguments: tag: D13
type: string

tool: D29: %lf

tool: {"D125": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0x40]}

tool: {"D126": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0x3f]}

tool: {"D62": [1.5707963267948966,3.141592653589793]}

tool: {"D114": [3.141592653589793,4.71238898038469]}

tool: {"D60": [0xd2,0x21,0x33,0x7f,0x7c,0xd9,0x12,0x40]}

tool: D115: sin = %.6lf


tool: D13: cos = %.6lf


assistant: ```c
int main() {
  double x;
  double s, c;
  if (scanf("%lf", &x) == 1) {
    while (x >= 2 * 3.14159265358979323846)
      x -= 2 * 3.14159265358979323846;
    while (x < 0)
      x += 2 * 3.14159265358979323846;
    if (0 <= x && x < 1.57079632679489661923)
      s = x, c = x;
    else if (1.57079632679489661923 <= x && x < 3.14159265358979323846)
      s = 3.14159265358979323846 - x, c = x;
    else if (3.14159265358979323846 <= x && x < 3.14159265358979323846 + 1.57079632679489661923)
      s = 3.14159265358979323846 - x, c = 2 * 3.14159265358979323846 - x;
    else if (3.14159265358979323846 <= 3.14159265358979323846 + 1.57079632679489661923 && x < 2 * 3.14159265358979323846)
      s = x - 2 * 3.14159265358979323846, c = 2 * 3.14159265358979323846 - x;
    printf("sin = %.6lf\n", sine(s));
    printf("cos = %.6lf\n", cosine(c));
  }
  return 0;
}
```