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

```asm
<grad_to_D>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  comisd D98(%rip),%xmm0
  jb     L264
  movsd  D246(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L264
  mov    -0x8(%rbp),%rax
  lea    D219(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L98
L264:
  movsd  -0x10(%rbp),%xmm0
  comisd D246(%rip),%xmm0
  jb     L140
  movsd  D146(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L140
  mov    -0x8(%rbp),%rax
  lea    D72(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L98
L140:
  movsd  -0x10(%rbp),%xmm0
  comisd D146(%rip),%xmm0
  jb     L39
  movsd  D28(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L39
  mov    -0x8(%rbp),%rax
  lea    D191(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L98
L39:
  movsd  -0x10(%rbp),%xmm0
  comisd D28(%rip),%xmm0
  jb     L125
  movsd  D64(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L125
  mov    -0x8(%rbp),%rax
  lea    D268(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L98
L125:
  movsd  -0x10(%rbp),%xmm0
  comisd D64(%rip),%xmm0
  jb     L32
  movsd  D168(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L32
  mov    -0x8(%rbp),%rax
  lea    D139(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L98
L32:
  movsd  -0x10(%rbp),%xmm0
  comisd D168(%rip),%xmm0
  jb     L65
  movsd  D91(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L65
  mov    -0x8(%rbp),%rax
  lea    D187(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L98
L65:
  movsd  -0x10(%rbp),%xmm0
  comisd D91(%rip),%xmm0
  jb     L198
  movsd  D120(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L198
  mov    -0x8(%rbp),%rax
  lea    D210(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L98
L198:
  movsd  -0x10(%rbp),%xmm0
  comisd D120(%rip),%xmm0
  jb     L83
  movsd  D118(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jae    L0
L83:
  movsd  -0x10(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L276
  movsd  D98(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L276
L0:
  mov    -0x8(%rbp),%rax
  lea    D136(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L98
L276:
  pxor   %xmm0,%xmm0
  ucomisd -0x10(%rbp),%xmm0
  jp     L113
  pxor   %xmm0,%xmm0
  ucomisd -0x10(%rbp),%xmm0
  jne    L113
  mov    -0x8(%rbp),%rax
  lea    D79(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L98
L113:
  mov    -0x8(%rbp),%rax
  lea    D1(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
L98:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D98
data_type: f64[2]
name: retrieve_data
arguments: label: D246
data_type: f64[2]
name: retrieve_data
arguments: label: D219
data_type: string
name: retrieve_data
arguments: label: D146
data_type: f64[2]
name: retrieve_data
arguments: label: D72
data_type: string
name: retrieve_data
arguments: label: D28
data_type: f64[2]
name: retrieve_data
arguments: label: D191
data_type: string
name: retrieve_data
arguments: label: D64
data_type: f64[2]
name: retrieve_data
arguments: label: D268
data_type: string
name: retrieve_data
arguments: label: D168
data_type: f64[2]
name: retrieve_data
arguments: label: D139
data_type: string
name: retrieve_data
arguments: label: D91
data_type: f64[2]
name: retrieve_data
arguments: label: D187
data_type: string
name: retrieve_data
arguments: label: D120
data_type: f64[2]
name: retrieve_data
arguments: label: D210
data_type: string
name: retrieve_data
arguments: label: D118
data_type: f64
name: retrieve_data
arguments: label: D136
data_type: string
name: retrieve_data
arguments: label: D79
data_type: string
name: retrieve_data
arguments: label: D1
data_type: string

tool: {"D98": [22.5,67.5]}

tool: {"D246": [67.5,112.5]}

tool: D219: 1

tool: {"D146": [112.5,157.5]}

tool: D72: 2

tool: {"D28": [157.5,202.5]}

tool: D191: 3

tool: {"D64": [202.5,247.5]}

tool: D268: 4

tool: {"D168": [247.5,292.5]}

tool: D139: 5

tool: {"D91": [292.5,337.5]}

tool: D187: 6

tool: {"D120": [337.5,360.0]}

tool: D210: 7

tool: D118: 360

tool: D136: 8

tool: D79: 0

tool: D1: 9

assistant: ```c
char *grad_to_D(char *D, double grad) {
  if (grad >= 22.5 && grad < 67.5)
    strcpy(D, "1");
  else if (grad >= 67.5 && grad < 112.5)
    strcpy(D, "2");
  else if (grad >= 112.5 && grad < 157.5)
    strcpy(D, "3");
  else if (grad >= 157.5 && grad < 202.5)
    strcpy(D, "4");
  else if (grad >= 202.5 && grad < 247.5)
    strcpy(D, "5");
  else if (grad >= 247.5 && grad < 292.5)
    strcpy(D, "6");
  else if (grad >= 292.5 && grad < 337.5)
    strcpy(D, "7");
  else if ((grad >= 337.5 && grad <= 360.0) || (grad > 0.0 && grad < 22.5))
    strcpy(D, "8");
  else if (grad == 0.0)
    strcpy(D, "0");
  else
    strcpy(D, "9");
  return D;
}
```