user: 请将以下的汇编代码转换成C语言代码：

```asm
<grad_to_D>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  comisd D54(%rip),%xmm0
  jb     L219
  movsd  D64(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L39
L219:
  comisd D64(%rip),%xmm0
  jb     L282
  movsd  D248(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L97
L282:
  comisd D248(%rip),%xmm0
  jb     L145
  movsd  D102(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L63
L145:
  comisd D102(%rip),%xmm0
  jb     L90
  movsd  D197(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L54
L90:
  comisd D197(%rip),%xmm0
  jb     L155
  movsd  D66(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L3
L155:
  comisd D66(%rip),%xmm0
  jb     L201
  movsd  D114(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L191
L201:
  comisd D114(%rip),%xmm0
  jb     L131
  movsd  D185(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L235
L131:
  comisd D185(%rip),%xmm0
  jb     L67
  movsd  D255(%rip),%xmm1
  comisd %xmm0,%xmm1
  jae    L45
L67:
  comisd D117(%rip),%xmm0
  jbe    L210
  movsd  D54(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L61
L45:
  lea    D78(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L28
L39:
  lea    D70(%rip),%rsi
  call   <strcpy@plt>
L28:
  mov    %rbx,%rax
  pop    %rbx
  ret
L97:
  lea    D130(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L28
L63:
  lea    D144(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L28
L54:
  lea    D168(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L28
L3:
  lea    D216(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L28
L191:
  lea    D145(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L28
L235:
  lea    D268(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L28
L210:
  ucomisd D117(%rip),%xmm0
  jp     L61
  jne    L61
  lea    D246(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L28
L61:
  lea    D151(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L28
```

tool_calls: name: parse_data
arguments: label: D54
type_guessed: f64[2]
name: parse_data
arguments: label: D64
type_guessed: f64[2]
name: parse_data
arguments: label: D248
type_guessed: f64[2]
name: parse_data
arguments: label: D102
type_guessed: f64[2]
name: parse_data
arguments: label: D197
type_guessed: f64[2]
name: parse_data
arguments: label: D66
type_guessed: f64[2]
name: parse_data
arguments: label: D114
type_guessed: f64[2]
name: parse_data
arguments: label: D185
type_guessed: f64[2]
name: parse_data
arguments: label: D255
type_guessed: f64
name: parse_data
arguments: label: D117
type_guessed: f64
name: parse_data
arguments: label: D78
type_guessed: string
name: parse_data
arguments: label: D70
type_guessed: string
name: parse_data
arguments: label: D130
type_guessed: string
name: parse_data
arguments: label: D144
type_guessed: string
name: parse_data
arguments: label: D168
type_guessed: string
name: parse_data
arguments: label: D216
type_guessed: string
name: parse_data
arguments: label: D145
type_guessed: string
name: parse_data
arguments: label: D268
type_guessed: string
name: parse_data
arguments: label: D246
type_guessed: string
name: parse_data
arguments: label: D151
type_guessed: string

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

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

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

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

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

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

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

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

tool: D255: 360

tool: D117: 0

tool: D78: 8

tool: D70: 1

tool: D130: 2

tool: D144: 3

tool: D168: 4

tool: D216: 5

tool: D145: 6

tool: D268: 7

tool: D246: 0

tool: D151: 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;
}
```