user: Translate the below assembly code into C programming language:

```asm
<double2loc_format>:
  endbr64
  movsd  D2(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L18
  movsd  D71(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L66
  movsd  D70(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L13
  movsd  D69(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L83
  movsd  D35(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L29
  movsd  D16(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L57
  movsd  D81(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L45
  movsd  D65(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L62
  movsd  D28(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L22
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  shl    $0x4,%eax
  or     $0x1,%eax
  ret
  nopl   (%rax)
L66:
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  shl    $0x4,%eax
  or     $0x8,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L18:
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  shl    $0x4,%eax
  or     $0x9,%eax
  ret
  nop
L83:
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  shl    $0x4,%eax
  or     $0x6,%eax
  ret
  nop
L13:
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  shl    $0x4,%eax
  or     $0x7,%eax
  ret
  nop
L29:
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  shl    $0x4,%eax
  or     $0x5,%eax
  ret
  nop
L62:
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  shl    $0x4,%eax
  or     $0x2,%eax
  ret
  nop
L57:
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  shl    $0x4,%eax
  or     $0x4,%eax
  ret
  nop
L45:
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  shl    $0x4,%eax
  or     $0x3,%eax
  ret
  nop
L22:
  cvttsd2si %xmm0,%eax
  shl    $0x4,%eax
  ret
```

tool_calls: name: unpack_data
arguments: label: D2
data_type: byte[8]
name: unpack_data
arguments: label: D71
data_type: byte[8]
name: unpack_data
arguments: label: D70
data_type: byte[8]
name: unpack_data
arguments: label: D69
data_type: byte[8]
name: unpack_data
arguments: label: D35
data_type: byte[8]
name: unpack_data
arguments: label: D16
data_type: byte[8]
name: unpack_data
arguments: label: D81
data_type: byte[8]
name: unpack_data
arguments: label: D65
data_type: byte[8]
name: unpack_data
arguments: label: D28
data_type: byte[8]

tool: {"D2": [0x00,0x00,0x00,0x00,0x65,0xcd,0xcd,0x41]}

tool: {"D71": [0x00,0x00,0x00,0x00,0x84,0xd7,0x97,0x41]}

tool: {"D70": [0x00,0x00,0x00,0x00,0xd0,0x12,0x63,0x41]}

tool: {"D69": [0x00,0x00,0x00,0x00,0x80,0x84,0x2e,0x41]}

tool: {"D35": [0x00,0x00,0x00,0x00,0x00,0x6a,0xf8,0x40]}

tool: {"D16": [0x00,0x00,0x00,0x00,0x00,0x88,0xc3,0x40]}

tool: {"D81": [0x00,0x00,0x00,0x00,0x00,0x40,0x8f,0x40]}

tool: {"D65": [0x00,0x00,0x00,0x00,0x00,0x00,0x59,0x40]}

tool: {"D28": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

assistant: ```c
uint8_t double2loc_format(double val) {
  if (val > 1000000000) {
    return (((uint8_t)(val / 1000000000)) << 4) | 9;
  } else if (val > 100000000) {
    return (((uint8_t)(val / 100000000)) << 4) | 8;
  } else if (val > 10000000) {
    return (((uint8_t)(val / 10000000)) << 4) | 7;
  } else if (val > 1000000) {
    return (((uint8_t)(val / 1000000)) << 4) | 6;
  } else if (val > 100000) {
    return (((uint8_t)(val / 100000)) << 4) | 5;
  } else if (val > 10000) {
    return (((uint8_t)(val / 10000)) << 4) | 4;
  } else if (val > 1000) {
    return (((uint8_t)(val / 1000)) << 4) | 3;
  } else if (val > 100) {
    return (((uint8_t)(val / 100)) << 4) | 2;
  } else if (val > 10) {
    return (((uint8_t)(val / 10)) << 4) | 1;
  } else {
    return (((uint8_t)(val)) << 4);
  }
}
```