user: 请从给定的汇编指令推导出C源代码：

```asm
<avg_dist_interval>:
  endbr64
  mov    %edi,%eax
  lea    (%rdi,%rsi,1),%r9d
  pxor   %xmm7,%xmm7
  mov    %ecx,%r10d
  lea    (%rdx,%rcx,1),%r8d
  pxor   %xmm6,%xmm6
  lea    -0x1(%r9),%edi
  movsd  D69(%rip),%xmm3
  cvtsi2sd %eax,%xmm7
  pxor   %xmm4,%xmm4
  lea    -0x1(%r8),%ecx
  cvtsi2sd %edx,%xmm6
  pxor   %xmm2,%xmm2
  cvtsi2sd %edi,%xmm4
  cvtsi2sd %ecx,%xmm2
  movapd %xmm7,%xmm0
  movapd %xmm6,%xmm1
  addsd  %xmm4,%xmm0
  addsd  %xmm2,%xmm1
  mulsd  %xmm3,%xmm0
  mulsd  %xmm3,%xmm1
  cmp    %eax,%ecx
  jl     L60
  cmp    %edx,%edi
  jge    L13
L60:
  subsd  %xmm1,%xmm0
  andpd  D9(%rip),%xmm0
  ret
  xchg   %ax,%ax
L13:
  cmp    %r8d,%r9d
  jg     L68
  jge    L14
  movapd %xmm4,%xmm5
  movapd %xmm2,%xmm0
  subsd  %xmm7,%xmm2
  movsd  D64(%rip),%xmm8
  subsd  %xmm7,%xmm5
  subsd  %xmm4,%xmm0
  addsd  %xmm8,%xmm2
  addsd  %xmm8,%xmm5
  mulsd  %xmm3,%xmm5
  mulsd  %xmm0,%xmm5
  mulsd  %xmm2,%xmm5
  movapd %xmm4,%xmm2
  addsd  D50(%rip),%xmm5
L0:
  cmp    %edx,%eax
  jge    L76
L22:
  movapd %xmm2,%xmm0
  pxor   %xmm1,%xmm1
  subsd  %xmm7,%xmm2
  sub    %eax,%edx
  subsd  %xmm6,%xmm0
  subsd  %xmm6,%xmm4
  cvtsi2sd %edx,%xmm1
  addsd  %xmm8,%xmm2
  addsd  %xmm8,%xmm0
  mulsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  movapd %xmm8,%xmm1
  addsd  %xmm4,%xmm1
  mulsd  %xmm2,%xmm0
  movapd %xmm4,%xmm2
  addsd  %xmm0,%xmm5
L43:
  mulsd  %xmm2,%xmm1
  imul   %r10d,%esi
  addsd  D31(%rip),%xmm2
  mulsd  %xmm2,%xmm1
  divsd  D67(%rip),%xmm1
  movapd %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  addsd  %xmm5,%xmm0
  divsd  %xmm1,%xmm0
  ret
  nopl   0x0(%rax,%rax,1)
L68:
  movapd %xmm2,%xmm5
  movapd %xmm4,%xmm0
  subsd  %xmm6,%xmm4
  movsd  D64(%rip),%xmm8
  subsd  %xmm6,%xmm5
  subsd  %xmm2,%xmm0
  addsd  %xmm8,%xmm5
  mulsd  %xmm3,%xmm5
  mulsd  %xmm0,%xmm5
  movapd %xmm4,%xmm0
  movapd %xmm2,%xmm4
  addsd  %xmm8,%xmm0
  mulsd  %xmm0,%xmm5
  addsd  D50(%rip),%xmm5
  cmp    %edx,%eax
  jl     L22
L76:
  movapd %xmm4,%xmm2
  subsd  %xmm7,%xmm2
  movapd %xmm2,%xmm1
  addsd  %xmm8,%xmm1
  jle    L43
  mulsd  %xmm1,%xmm3
  pxor   %xmm7,%xmm7
  subsd  %xmm6,%xmm4
  sub    %edx,%eax
  cvtsi2sd %eax,%xmm7
  movapd %xmm4,%xmm0
  addsd  %xmm8,%xmm0
  mulsd  %xmm3,%xmm7
  mulsd  %xmm7,%xmm0
  addsd  %xmm0,%xmm5
  jmp    L43
  xchg   %ax,%ax
L14:
  movsd  D64(%rip),%xmm8
  pxor   %xmm5,%xmm5
  jmp    L0
```

tool_calls: name: unpack_data
arguments: data_tag: D69
datatype: byte[8]
name: unpack_data
arguments: data_tag: D9
datatype: qword[2]
name: unpack_data
arguments: data_tag: D64
datatype: byte[8]
name: unpack_data
arguments: data_tag: D50
datatype: byte[8]
name: unpack_data
arguments: data_tag: D31
datatype: byte[8]
name: unpack_data
arguments: data_tag: D67
datatype: f64

tool: {"D69": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: {"D9": [0x7fffffffffffffff,0x0000000000000000]}

tool: {"D64": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D50": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D31": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40]}

tool: D67: 3

assistant: ```c
double avg_dist_interval(int set1_low, int set1_span, int set2_low, int set2_span) {
  double set1_high;
  double set1_avg;
  double set2_high;
  double set2_avg;
  double val;
  val = 0;
  set1_high = set1_low + set1_span - 1;
  set1_avg = .5 * (set1_high + set1_low);
  set2_high = set2_low + set2_span - 1;
  set2_avg = .5 * (set2_high + set2_low);
  if (set1_low > set2_high || set2_low > set1_high) {
    val = fabs(set1_avg - set2_avg);
  } else {
    if (set1_high > set2_high) {
      val += .5 * (set2_high - set2_low + 1) * (set1_high - set2_high) * (set1_high - set2_low + 1);
      set1_high = set2_high;
    } else if (set2_high > set1_high) {
      val += .5 * (set1_high - set1_low + 1) * (set2_high - set1_high) * (set2_high - set1_low + 1);
      set2_high = set1_high;
    }
    if (set1_low < set2_low) {
      val += .5 * (set2_high - set2_low + 1) * (set2_low - set1_low) * (set2_high - set1_low + 1);
      set1_low = set2_low;
    } else if (set2_low < set1_low) {
      val += .5 * (set1_high - set1_low + 1) * (set1_low - set2_low) * (set1_high - set2_low + 1);
      set2_low = set1_low;
    }
    val += (set1_high - set1_low) * (set1_high - set1_low + 1) * (set1_high - set1_low + 2) / 3.0;
    val /= set1_span * set2_span;
  }
  return (val);
}
```